FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Compile errors for simple Hello World
Goto page 1, 2  Next
 
Post new topic   Reply to topic     Forum Index -> Tioport
View previous topic :: View next topic  
Author Message
Bradley Smith



Joined: 20 Jun 2006
Posts: 60

PostPosted: Thu Apr 12, 2007 10:49 am    Post subject: Compile errors for simple Hello World Reply with quote

I can't get a simple Hello World progam to compile.

Code:
import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import dejavu.lang.String;

void main(char[][] args) {
  Display display = new Display();
  Shell shell = new Shell(display);
 
  shell.setText(new String("Hello, world!"));
 
  shell.open();

  while (!shell.isDisposed()) {
    if (!display.readAndDispatch()) {
      display.sleep();
    }
  }

  display.dispose();
}


Code:
org\eclipse\swt\widgets\Display.d(2304): Error: undefined identifier package win32.INPUT
org\eclipse\swt\widgets\Display.d(2304): Error: no property 'INPUT' for type 'void'
org\eclipse\swt\widgets\Display.d(2304): Error: no property 'sizeof_KEYWORDESCAPE' for type 'int'
org\eclipse\swt\widgets\Display.d(2307): Error: undefined identifier package win32.INPUT
org\eclipse\swt\widgets\Display.d(2307): Error: no property 'INPUT' for type 'void'
org\eclipse\swt\widgets\Display.d(2307): Error: no property 'sizeof_KEYWORDESCAPE' for type 'int'
org\eclipse\swt\widgets\Display.d(2354): Error: undefined identifier package win32.INPUT
org\eclipse\swt\widgets\Display.d(2354): Error: no property 'INPUT' for type 'void'
org\eclipse\swt\widgets\Display.d(2354): Error: no property 'sizeof_KEYWORDESCAPE' for type 'int'
org\eclipse\swt\widgets\Display.d(2357): Error: undefined identifier package win32.INPUT
org\eclipse\swt\widgets\Display.d(2357): Error: no property 'INPUT' for type 'void'
org\eclipse\swt\widgets\Display.d(2357): Error: no property 'sizeof_KEYWORDESCAPE' for type 'int'
Back to top
View user's profile Send private message
doob



Joined: 06 Jan 2007
Posts: 367

PostPosted: Thu Apr 12, 2007 1:29 pm    Post subject: Reply with quote

I'm getting the same errors
Back to top
View user's profile Send private message
keinfarbton



Joined: 03 Dec 2005
Posts: 224
Location: Stuttgart - Germany

PostPosted: Thu Apr 12, 2007 7:17 pm    Post subject: Reply with quote

On this page, i wrote a minimal howto build the examples.

http://dsource.org/projects/tioport/wiki/port_swt

For windows, actually only the paint example was build. You are very welcome to improve the windows build support. I am primary working on linux.
Back to top
View user's profile Send private message
keinfarbton



Joined: 03 Dec 2005
Posts: 224
Location: Stuttgart - Germany

PostPosted: Thu Apr 12, 2007 7:33 pm    Post subject: Reply with quote

the funny thing is, this seems to be a compiler error in the wrong direction Smile
If the module is used and all missing modules are loaded from other modules, dmd does not give these errors and compiles successfully.

I need to fix TioPort to add also imports for field references.

However, you should be able to run the paint example.
Back to top
View user's profile Send private message
Bradley Smith



Joined: 20 Jun 2006
Posts: 60

PostPosted: Thu Apr 12, 2007 10:58 pm    Post subject: Reply with quote

keinfarbton wrote:
On this page, i wrote a minimal howto build the examples.

http://dsource.org/projects/tioport/wiki/port_swt

For windows, actually only the paint example was build. You are very welcome to improve the windows build support. I am primary working on linux.


That page says to "First build the TioPort program", but the page linked to has not been created. To improve Windows support, would I need to do know how to build the TioPort program?

There are some English mistakes on that page:
"convertion" should be conversion.
"This is not only necessary for a new version of SWT or if tioport is changed/fixed." should be "This is only necessary for a new version of SWT or if tioport is changed/fixed."
"Same like on linux," should be "Same as on linux,".
Back to top
View user's profile Send private message
Bradley Smith



Joined: 20 Jun 2006
Posts: 60

PostPosted: Thu Apr 12, 2007 11:41 pm    Post subject: Reply with quote

In addition, the instructions neglect to mention that the Windows build files assume that the environment is configured exactly a certian way. I don't have tango in "c:\project\tango" and I don't have a "c:\tools\dmd\dmd\lib\" for linking.
Back to top
View user's profile Send private message
miasma



Joined: 08 Feb 2007
Posts: 13

PostPosted: Fri Apr 13, 2007 3:24 am    Post subject: Reply with quote

Bradley Smith wrote:
There are some English mistakes on that page:


Oh, come on. Nothing is preventing you from fixing the spelling in the wiki. Not everyone is a native english speaker. I updated those that you mentioned.
Back to top
View user's profile Send private message
keinfarbton



Joined: 03 Dec 2005
Posts: 224
Location: Stuttgart - Germany

PostPosted: Fri Apr 13, 2007 3:31 am    Post subject: Reply with quote

Quote:

That page says to "First build the TioPort program", but the page linked to has not been created. To improve Windows support, would I need to do know how to build the TioPort program?


No, like said in the first sentence, you do not need this for using SWT.

Quote:

There are some English mistakes on that page:

Why not just click on "Edit this Page" ? Wink
Thanks, those things are corrected now.

Quote:
In addition, the instructions neglect to...

ok, thanks, i added a note to the page.
well, like i said..
I don't do development on windows. Please, can you do better build file?
If you want, i can give you commit rights for the svn.

After all, did the example work for you?
Back to top
View user's profile Send private message
keinfarbton



Joined: 03 Dec 2005
Posts: 224
Location: Stuttgart - Germany

PostPosted: Fri Apr 13, 2007 4:42 am    Post subject: Reply with quote

With revision 263 the missing imports should be fixed. Thanks for the report.
Back to top
View user's profile Send private message
keinfarbton



Joined: 03 Dec 2005
Posts: 224
Location: Stuttgart - Germany

PostPosted: Fri Apr 13, 2007 12:06 pm    Post subject: Reply with quote

The example directory contains now a minimumhelloworld.d.

The Code looks like this:
Code:
module minimumhelloworld;

import org.eclipse.swt.widgets.Display;
import org.eclipse.swt.widgets.Shell;
import dejavu.lang.String;

import StaticCtorsSwt;

// dummy function to access compiled in resources (here we do not use this feature)
extern(C) ubyte[] resources_getDataById( char[] aId ){
    return null;
}

void main(char[][] args) {
    // initialize SWT
    StaticCtorsSwt.callAllStaticCtors();

    Display display = new Display();
    Shell shell = new Shell(display);

    shell.setText(String.fromUtf8("Hello, world!"));
    shell.open();

    while (!shell.isDisposed()) {
        if (!display.readAndDispatch()) {
            display.sleep();
        }
    }

    display.dispose();
}


Only tested on linux, the Makefile.linux has a minimumhelloworld target.
Back to top
View user's profile Send private message
doob



Joined: 06 Jan 2007
Posts: 367

PostPosted: Sat Apr 14, 2007 8:47 am    Post subject: Reply with quote

Is it me doing something wrong, I can't compile the hello world program. I'm now getting these errors using bud(build):

Code:
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined __d_switch_string
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined __d_arraycatT
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D14TypeInfo_Tuple6__vtblZ
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined __d_interface_cast
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D5tango2io6Stdout6StdoutC5tango2io5Print12__T5PrintTaZ5Print
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D5tango2io5Print12__T5PrintTaZ5Print8formatlnMFAaYC5tango2io5Print12__T5PrintTaZ5Print
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined __d_assert
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined __fltused
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined __d_assert_msg
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D5tango4stdc7stringz9fromUtf8zFPaZAa
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined __d_newclass
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D5tango4text7convert3Utf7toUtf16FAaAuPkZAu
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D5tango4text7convert6Layout13__T6LayoutTaZ6Layout7convertMFAaYAa
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D10TypeInfo_P6__initZ
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined __aaIn
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined __aaDel
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D5tango4stdc7stringz7toUtf8zFAaZPa
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined __aaGet
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined __aaGetRvalue
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D5tango4text7convert6Layout13__T6LayoutTaZ6Layout7__ClassZ
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D11TypeInfo_Aa6__initZ
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D10TypeInfo_l6__initZ
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D6object6Object8opEqualsMFC6ObjectZi
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D6object6Object5opCmpMFC6ObjectZi
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D6object6Object6toHashMFZk
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D6object6Object6toUtf8MFZAa
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D6Object7__ClassZ
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D9ClassInfo6__vtblZ
dejavu\lang\Class.obj(Class)
 Error 42: Symbol Undefined __d_arrayappendcT
dejavu\lang\Class.obj(Class)
 Error 42: Symbol Undefined _D14TypeInfo_Array6__vtblZ
dejavu\lang\Class.obj(Class)
 Error 42: Symbol Undefined _D14TypeInfo_Class6__vtblZ
dejavu\lang\Class.obj(Class)
 Error 42: Symbol Undefined _D10TypeInfo_a6__initZ
dejavu\lang\Class.obj(Class)
 Error 42: Symbol Undefined __adEq
dejavu\lang\Class.obj(Class)
 Error 42: Symbol Undefined __d_throw@4
dejavu\lang\Class.obj(Class)
 Error 42: Symbol Undefined __d_arrayappendT
dejavu\lang\Class.obj(Class)
 Error 42: Symbol Undefined __adDupT
dejavu\lang\Class.obj(Class)
 Error 42: Symbol Undefined _resources_getDataById
dejavu\io\InputStream.obj(InputStream)
 Error 42: Symbol Undefined __except_list
dejavu\io\InputStream.obj(InputStream)
 Error 42: Symbol Undefined __d_monitor_prolog
dejavu\io\InputStream.obj(InputStream)
 Error 42: Symbol Undefined __d_monitor_epilog
dejavu\io\InputStream.obj(InputStream)
 Error 42: Symbol Undefined __d_monitor_handler
dejavu\lang\JArray.obj(JArray)
 Error 42: Symbol Undefined _memmove
dejavu\lang\JArray.obj(JArray)
 Error 42: Symbol Undefined _D11TypeInfo_Ab6__initZ
dejavu\lang\JArray.obj(JArray)
 Error 42: Symbol Undefined __d_arraysetlengthT
dejavu\lang\JArray.obj(JArray)
 Error 42: Symbol Undefined _D11TypeInfo_Ag6__initZ
dejavu\lang\JArray.obj(JArray)
 Error 42: Symbol Undefined _D11TypeInfo_As6__initZ
dejavu\lang\JArray.obj(JArray)
 Error 42: Symbol Undefined _D10TypeInfo_s6__initZ
dejavu\lang\JArray.obj(JArray)
 Error 42: Symbol Undefined _D11TypeInfo_Ai6__initZ
dejavu\lang\JArray.obj(JArray)
 Error 42: Symbol Undefined __LDIV@
dejavu\lang\JArray.obj(JArray)
 Error 42: Symbol Undefined _D11TypeInfo_Al6__initZ
dejavu\lang\JArray.obj(JArray)
 Error 42: Symbol Undefined _D11TypeInfo_Af6__initZ
dejavu\lang\JArray.obj(JArray)
 Error 42: Symbol Undefined __d_arraysetlengthiT
dejavu\lang\JArray.obj(JArray)
 Error 42: Symbol Undefined _D11TypeInfo_Ad6__initZ
dejavu\lang\JArray.obj(JArray)
 Error 42: Symbol Undefined _D11TypeInfo_Au6__initZ
dejavu\lang\String.obj(String)
 Error 42: Symbol Undefined _D10TypeInfo_u6__initZ
dejavu\lang\String.obj(String)
 Error 42: Symbol Undefined __d_dynamic_cast
dejavu\lang\String.obj(String)
 Error 42: Symbol Undefined __adCmp
dejavu\lang\String.obj(String)
 Error 42: Symbol Undefined _D11TypeInfo_Aw6__initZ
dejavu\lang\String.obj(String)
 Error 42: Symbol Undefined __d_arrayliteralT
dejavu\lang\String.obj(String)
 Error 42: Symbol Undefined _D5tango4text7convert3Utf7toUtf16FAwAuPkZAu
dejavu\lang\String.obj(String)
 Error 42: Symbol Undefined _D5tango4text5Ascii7toLowerFAaAaZAa
dejavu\lang\String.obj(String)
 Error 42: Symbol Undefined _D5tango4text5Ascii7toUpperFAaAaZAa
dejavu\lang\String.obj(String)
 Error 42: Symbol Undefined _D5tango4text7convert3Utf6toUtf8FAuAaPkZAa
dejavu\lang\StringBuffer.obj(StringBuffer)
 Error 42: Symbol Undefined _D5tango4text7convert7Integer7toUtf16FlE5tango4text7convert7Integer5StyleE5tango4text7convert7Integer5FlagsZAu
dejavu\lang\StringBuffer.obj(StringBuffer)
 Error 42: Symbol Undefined _D5tango4text7convert5Float7toUtf16FekbZAu
dejavu\lang\IndexOutOfBoundsException.obj(IndexOutOfBoundsException)
 Error 42: Symbol Undefined _D6object9Exception5_ctorMFAaC9ExceptionZC9Exception
dejavu\lang\Throwable.obj(Throwable)
 Error 42: Symbol Undefined _D10TypeInfo_k6__initZ
dejavu\lang\Throwable.obj(Throwable)
 Error 42: Symbol Undefined _D9Exception7__ClassZ
dejavu\io\File.obj(File)
 Error 42: Symbol Undefined _D5tango2io10FileSystem10FileSystem10toAbsoluteFC5tango2io8FilePath8FilePathAaZC5tango2io8FilePath8FilePath
dejavu\io\File.obj(File)
 Error 42: Symbol Undefined _D5tango2io8FilePath8FilePath6toUtf8MFZAa
dejavu\io\File.obj(File)
 Error 42: Symbol Undefined _D5tango2io8FilePath8FilePath7__ClassZ
dejavu\io\File.obj(File)
 Error 42: Symbol Undefined _D5tango2io8FilePath8FilePath5_ctorMFAabZC5tango2io8FilePath8FilePath
dejavu\io\File.obj(File)
 Error 42: Symbol Undefined _D5tango2io8FilePath8FilePath10isWritableMFZb
dejavu\io\File.obj(File)
 Error 42: Symbol Undefined _D5tango2io8FilePath8FilePath6existsMFZb
dejavu\io\File.obj(File)
 Error 42: Symbol Undefined _D5tango2io8FilePath8FilePath8isFolderMFZb
dejavu\lang\Integer.obj(Integer)
 Error 42: Symbol Undefined _D5tango4text7convert7Integer6toUtf8FlE5tango4text7convert7Integer5StyleE5tango4text7convert7Integer5FlagsZAa
dejavu\lang\JThread.obj(JThread)
 Error 42: Symbol Undefined _D5tango4core6Thread6Thread7__ClassZ
dejavu\lang\JThread.obj(JThread)
 Error 42: Symbol Undefined _D5tango4core6Thread6Thread5_ctorMFDFZvZC5tango4core6Thread6Thread
dejavu\lang\JThread.obj(JThread)
 Error 42: Symbol Undefined __d_local_unwind2
dejavu\lang\JThread.obj(JThread)
 Error 42: Symbol Undefined __d_framehandler
dejavu\lang\JThread.obj(JThread)
 Error 42: Symbol Undefined _D5tango4core6Thread6Thread5startMFZv
dejavu\util\Hashtable.obj(Hashtable)
 Error 42: Symbol Undefined _D18TypeInfo_Interface6__vtblZ
dejavu\util\Hashtable.obj(Hashtable)
 Error 42: Symbol Undefined __aaKeys
dejavu\util\Hashtable.obj(Hashtable)
 Error 42: Symbol Undefined __aaRehash
dejavu\util\Hashtable.obj(Hashtable)
 Error 42: Symbol Undefined __aaValues
dejavu\util\Hashtable.obj(Hashtable)
 Error 42: Symbol Undefined __aaLen
dejavu\util\Calendar.obj(Calendar)
 Error 42: Symbol Undefined __d_monitorenter
dejavu\util\Calendar.obj(Calendar)
 Error 42: Symbol Undefined __d_monitorexit
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined __nullext
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D5tango2io7Console12__ModuleInfoZ
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D5tango2io11FileConduit12__ModuleInfoZ
dejavu\Intern.obj(Intern)
 Error 42: Symbol Undefined _D5tango2io6Stdout12__ModuleInfoZ
OPTLINK : Warning 134: No Start Address
Back to top
View user's profile Send private message
keinfarbton



Joined: 03 Dec 2005
Posts: 224
Location: Stuttgart - Germany

PostPosted: Sun Apr 15, 2007 4:42 am    Post subject: Reply with quote

You did compile successfully, because these are linker errors.

How does your link call look like?
Do you use the latest Tango trunk checkout?
Can you link and build other tango examples?
Back to top
View user's profile Send private message
doob



Joined: 06 Jan 2007
Posts: 367

PostPosted: Sun Apr 15, 2007 5:41 am    Post subject: Reply with quote

I used build like this: "build -clean main.d"
I use tango snapshot 20070413 and I have only compiled the hello world program in the tango install folder
Back to top
View user's profile Send private message
keinfarbton



Joined: 03 Dec 2005
Posts: 224
Location: Stuttgart - Germany

PostPosted: Sun Apr 15, 2007 5:54 am    Post subject: Reply with quote

hm, building this on win32 is actually a bit more complicated.
Can you please try to install 'rebuild' and use the batch file to compile the paint example?
You will need to customize the paths in the batchfile and the used .rf files.
You are also welcome to join the IRC #D to get my support.
Back to top
View user's profile Send private message
doob



Joined: 06 Jan 2007
Posts: 367

PostPosted: Sun Apr 15, 2007 9:25 am    Post subject: Reply with quote

I have now tried with rebuild and a batch file and two .rf files.

main.bat:
Code:
del obj\*.obj
rebuild -rfrebuild.rf
D:\applications\dmd-t\dm\bin\link.exe @optlink.rf


rebuild.rf:
Code:
main.d
-oqobj
-I"D:\applications\dmd-t\dmd\import\tango"
-I"swt"
-I"dejavu"
-c
-d


optlink.rf:
Code:
obj\*,
main.exe,,
D:\applications\dmd-t\dmd\import\tango\lib\+
swt-wgl-win32-3235+
swt-awt-win32-3235+
swt-gdip-win32-3235+
swt-win32-3235+
user32+
kernel32/noi;


That outputs:
Code:
D:\test>main.bat

D:\test>del obj\*.obj

D:\test>rebuild -rfrebuild.rf

D:\test>D:\applications\dmd-t\dm\bin\link.exe @optlink.rf
OPTLINK (R) for Win32  Release 7.50B1
Copyright (C) Digital Mars 1989 - 2001  All Rights Reserved

obj\dejavu-lang-Character.obj(dejavu-lang-Character)
 Error 42: Symbol Undefined _D4util7UniChar10isUniAlphaFwZb
obj\dejavu-lang-Character.obj(dejavu-lang-Character)
 Error 42: Symbol Undefined _D4util7UniChar10isUniDigitFwZb
obj\dejavu-lang-Character.obj(dejavu-lang-Character)
 Error 42: Symbol Undefined _D4util7UniChar10isUniUpperFwZb
obj\dejavu-lang-Character.obj(dejavu-lang-Character)
 Error 42: Symbol Undefined _D4util7UniChar10isUniLowerFwZb

D:\test>
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic     Forum Index -> Tioport All times are GMT - 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group