www.digitalmars.com         C & C++   DMDScript  

c++.announce - wxWndows compiles and links with digital mars

reply chris elliott <chris_member pathlink.com> writes:
I have compiled the wxWindows library and a minimal sample and comitted the
necessary changes to the wxWindows CVS. Compilation seems quick and produced few
errors which i have worked round:

1) providing functions with const and nonconst paprameters gave a problem

2) extern declarations seemed to require to be extern "C"

Any comments on these appreciated

chris
Apr 19 2003
parent reply Arjan Knepper <ask me.to> writes:
ad 1.
Which version of the compiler are you using? I guess 8.33 because in the 
latest beta these problems are solved.

ad 2.
Where did you have this problem? I don't seem to have this problem here.

Can you try to compile and run the samples\image sample? Compiles OK 
here but crashes when run. I didn't have the time to investigate this 
further. All/most other samples are compiling and running.

B.T.W. I used the wxWindows 2.4.0.

chris elliott wrote:
 I have compiled the wxWindows library and a minimal sample and comitted the
 necessary changes to the wxWindows CVS. Compilation seems quick and produced
few
 errors which i have worked round:
 
 1) providing functions with const and nonconst paprameters gave a problem
 
 2) extern declarations seemed to require to be extern "C"
 
 Any comments on these appreciated
 
 chris
 
 

Apr 19 2003
next sibling parent "chris elliott" <biol75 york.ac.uk> writes:
"Arjan Knepper" <ask me.to> wrote in message
news:b7sc5m$2kh3$1 digitaldaemon.com...
 ad 1.
 Which version of the compiler are you using? I guess 8.33 because in the
 latest beta these problems are solved.

 ad 2.
 Where did you have this problem? I don't seem to have this problem here.

 Can you try to compile and run the samples\image sample? Compiles OK

thanks for the prompt help chris
Apr 20 2003
prev sibling next sibling parent reply "chris elliott" <biol75 york.ac.uk> writes:
"Arjan Knepper" <ask me.to> wrote in message
news:b7sc5m$2kh3$1 digitaldaemon.com...
 ad 1.
 Which version of the compiler are you using? I guess 8.33 because in the
 latest beta these problems are solved.

 ad 2.
 Where did you have this problem? I don't seem to have this problem here.

 Can you try to compile and run the samples\image sample? Compiles OK
 here but crashes when run. I didn't have the time to investigate this
 further. All/most other samples are compiling and running.

I am still stuck on a bug with gethostbyname and other socket code; I did implib /s $(WINSOCKLIB) $(WINDIR)\system32\winsock.dll and got a library lib -l shows the functions, but none have underscores prefixed linking still fails; C:\wxWindows\samples\minimal>make -f makefile.sc link /DELEXECUTABLE /RC minimal, minimal.exe, minimal, c:\wxwindows\lib\wx_sc.l ib advapi32 comctl32 comdlg32 ctl3d32 gc gdi32 kernel32 ole32 oleaut32 snn use r32 uuid c:\wxwindows\lib\winsock_sc.lib OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved c:\wxwindows\lib\wx_sc.lib(utils) Error 42: Symbol Undefined _WSACleanup 0 c:\wxwindows\lib\wx_sc.lib(utils) Error 42: Symbol Undefined _gethostbyaddr 12 c:\wxwindows\lib\wx_sc.lib(utils) Error 42: Symbol Undefined _gethostbyname 4 c:\wxwindows\lib\wx_sc.lib(utils) Error 42: Symbol Undefined _gethostname 8 c:\wxwindows\lib\wx_sc.lib(utils) Error 42: Symbol Undefined _WSAStartup 8 thanks chris
Apr 20 2003
parent reply Arjan Knepper <ask me.to> writes:
I think you should use wsock32 instead of winsock.

Arjan

chris elliott wrote:
 "Arjan Knepper" <ask me.to> wrote in message
 news:b7sc5m$2kh3$1 digitaldaemon.com...
 
ad 1.
Which version of the compiler are you using? I guess 8.33 because in the
latest beta these problems are solved.

ad 2.
Where did you have this problem? I don't seem to have this problem here.

Can you try to compile and run the samples\image sample? Compiles OK
here but crashes when run. I didn't have the time to investigate this
further. All/most other samples are compiling and running.

I am still stuck on a bug with gethostbyname and other socket code; I did implib /s $(WINSOCKLIB) $(WINDIR)\system32\winsock.dll and got a library lib -l shows the functions, but none have underscores prefixed linking still fails; C:\wxWindows\samples\minimal>make -f makefile.sc link /DELEXECUTABLE /RC minimal, minimal.exe, minimal, c:\wxwindows\lib\wx_sc.l ib advapi32 comctl32 comdlg32 ctl3d32 gc gdi32 kernel32 ole32 oleaut32 snn use r32 uuid c:\wxwindows\lib\winsock_sc.lib OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved c:\wxwindows\lib\wx_sc.lib(utils) Error 42: Symbol Undefined _WSACleanup 0 c:\wxwindows\lib\wx_sc.lib(utils) Error 42: Symbol Undefined _gethostbyaddr 12 c:\wxwindows\lib\wx_sc.lib(utils) Error 42: Symbol Undefined _gethostbyname 4 c:\wxwindows\lib\wx_sc.lib(utils) Error 42: Symbol Undefined _gethostname 8 c:\wxwindows\lib\wx_sc.lib(utils) Error 42: Symbol Undefined _WSAStartup 8 thanks chris

Apr 20 2003
parent reply Arjan Knepper <ask me.to> writes:
And take a look at:
http://www.digitalmars.com/~jan/
has a modified implib which helps you to get the decoration right with 
use of the M$ Platform api headers.

It is very usefull!

Arjan

Arjan Knepper wrote:
 I think you should use wsock32 instead of winsock.
 
 Arjan
 
 chris elliott wrote:
 
 "Arjan Knepper" <ask me.to> wrote in message
 news:b7sc5m$2kh3$1 digitaldaemon.com...

 ad 1.
 Which version of the compiler are you using? I guess 8.33 because in the
 latest beta these problems are solved.

 ad 2.
 Where did you have this problem? I don't seem to have this problem here.

 Can you try to compile and run the samples\image sample? Compiles OK
 here but crashes when run. I didn't have the time to investigate this
 further. All/most other samples are compiling and running.

I am still stuck on a bug with gethostbyname and other socket code; I did implib /s $(WINSOCKLIB) $(WINDIR)\system32\winsock.dll and got a library lib -l shows the functions, but none have underscores prefixed linking still fails; C:\wxWindows\samples\minimal>make -f makefile.sc link /DELEXECUTABLE /RC minimal, minimal.exe, minimal, c:\wxwindows\lib\wx_sc.l ib advapi32 comctl32 comdlg32 ctl3d32 gc gdi32 kernel32 ole32 oleaut32 snn use r32 uuid c:\wxwindows\lib\winsock_sc.lib OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved c:\wxwindows\lib\wx_sc.lib(utils) Error 42: Symbol Undefined _WSACleanup 0 c:\wxwindows\lib\wx_sc.lib(utils) Error 42: Symbol Undefined _gethostbyaddr 12 c:\wxwindows\lib\wx_sc.lib(utils) Error 42: Symbol Undefined _gethostbyname 4 c:\wxwindows\lib\wx_sc.lib(utils) Error 42: Symbol Undefined _gethostname 8 c:\wxwindows\lib\wx_sc.lib(utils) Error 42: Symbol Undefined _WSAStartup 8 thanks chris


Apr 21 2003
parent reply "chris elliott" <biol75 york.ac.uk> writes:
"Arjan Knepper" <ask me.to> wrote in message
news:b805mo$1v17$1 digitaldaemon.com...
 And take a look at:
 http://www.digitalmars.com/~jan/
 has a modified implib which helps you to get the decoration right with
 use of the M$ Platform api headers.

 It is very usefull!

 Arjan

 Arjan Knepper wrote:
 I think you should use wsock32 instead of winsock.


hi && thanks for the prompt reply; my XP box has winsock.dll, but no winsock32 I tried building a .lib file from the winsock.dll using this, but got a corrupt library (which i could send ): C:\wx\dm\bin>implib /system /v /suffix /Ic:\wx\dm\include\win32 c:\wxwindows\lib \winsock_sc.lib c:\windows\system32\winsock.dll Digital Mars Import Library Manager Version 7.5B4n Copyright (C) Digital Mars 1999-2002. All Rights Reserved. Modified by Jan Knepper Include Path : 'c:\wx\dm\include\win32' Suffix::Include ( c:\wx\dm\include\win32 ) c:\wxwindows\lib\winsock_sc.lib Input is a Windows WIN3 DLL file. Output is a Windows WIN3 import library. Digital Mars Import Library Creator complete. C:\wx\dm\bin>lib -l \wxwindows\lib\winsock_sc.lib Digital Mars Librarian Version 8.00n Copyright (C) Digital Mars 2000-2002 All Rights Reserved www.digitalmars.com Error: Corrupt file '\wxwindows\lib\winsock_sc.lib', Typ=xf1, Len=x6d09 C:\wx\dm\bin> Chris
Apr 22 2003
next sibling parent reply Jan Knepper <jan smartsoft.us> writes:
chris elliott wrote:

 "Arjan Knepper" <ask me.to> wrote in message
 news:b805mo$1v17$1 digitaldaemon.com...
 And take a look at:
 http://www.digitalmars.com/~jan/
 has a modified implib which helps you to get the decoration right with
 use of the M$ Platform api headers.

 It is very usefull!

 Arjan

 Arjan Knepper wrote:
 I think you should use wsock32 instead of winsock.


hi && thanks for the prompt reply; my XP box has winsock.dll, but no winsock32

It's the .LIB in the /lib directory...
 I tried building a .lib file from the winsock.dll using this, but got a
 corrupt library (which i could send ):

 C:\wx\dm\bin>implib /system /v /suffix /Ic:\wx\dm\include\win32
 c:\wxwindows\lib
 \winsock_sc.lib c:\windows\system32\winsock.dll
 Digital Mars Import Library Manager Version 7.5B4n
 Copyright (C) Digital Mars 1999-2002.  All Rights Reserved.
 Modified by Jan Knepper
 Include Path : 'c:\wx\dm\include\win32'
 Suffix::Include ( c:\wx\dm\include\win32 )
 c:\wxwindows\lib\winsock_sc.lib
 Input is a Windows WIN3 DLL file.
 Output is a Windows WIN3 import library.
 Digital Mars Import Library Creator complete.

 C:\wx\dm\bin>lib -l \wxwindows\lib\winsock_sc.lib
 Digital Mars Librarian Version 8.00n
 Copyright (C) Digital Mars 2000-2002 All Rights Reserved www.digitalmars.com

 Error: Corrupt file '\wxwindows\lib\winsock_sc.lib', Typ=xf1, Len=x6d09

The library (.lib) works just fine. There is something with one byte (in the .lib) that's different for which ever reason LIB can not deal with the .lib. I know the problem exists. I however do not have the time to look into it at this moment. Jan
Apr 22 2003
parent reply "chris elliott" <biol75 york.ac.uk> writes:
"Jan Knepper" <jan smartsoft.us> wrote in message
news:3EA5AFB7.A446B8AE smartsoft.us...
 chris elliott wrote:

 "Arjan Knepper" <ask me.to> wrote in message
 news:b805mo$1v17$1 digitaldaemon.com...
 And take a look at:
 http://www.digitalmars.com/~jan/
 has a modified implib which helps you to get the decoration right with
 use of the M$ Platform api headers.

 It is very usefull!

 Arjan

 Arjan Knepper wrote:
 I think you should use wsock32 instead of winsock.




Thanks ; your implib is happy with wsock32 but it wants sppn.exe C:\wxWindows\src\msw>implib /system /v /suffix /Ic:\wx\dm\include\win32 c:\wxwin dows\lib\winsock_sc.lib c:\windows\system32\wsock32.dll Digital Mars Import Library Manager Version 7.5B4n Copyright (C) Digital Mars 1999-2002. All Rights Reserved. Modified by Jan Knepper Include Path : 'c:\wx\dm\include\win32' Suffix::Include ( c:\wx\dm\include\win32 ) c:\wxwindows\lib\winsock_sc.lib Input is a Windows NT DLL file 'WSOCK32.dll'. Could not start SPPN.EXE! my dm/bin dir has Directory of C:\wx\dm\bin [.] [..] bcc.exe cl.exe dmc.exe gc.dll implib.exe implib.ini lib.exe libunres.exe link.exe make.exe men.exe mex.exe rcc.exe sc.exe sc.ini scppn.exe scppnd.dll shell.exe 18 File(s) 3,003,317 bytes chris
Apr 24 2003
parent Arjan Knepper <ask me.to> writes:
sppn.exe is the preprocessor.

Maybe you can achive the same with scppn.exe and same commandline 
option. When you really need sppn.exe take a look in in this file:
ftp://ftp.digitalmars.com/Digital_Mars_C++/Patch/cd832.zip

Arjan

chris elliott wrote:
 "Jan Knepper" <jan smartsoft.us> wrote in message
 news:3EA5AFB7.A446B8AE smartsoft.us...
 
chris elliott wrote:


"Arjan Knepper" <ask me.to> wrote in message
news:b805mo$1v17$1 digitaldaemon.com...

And take a look at:
http://www.digitalmars.com/~jan/
has a modified implib which helps you to get the decoration right with
use of the M$ Platform api headers.

It is very usefull!

Arjan

Arjan Knepper wrote:

I think you should use wsock32 instead of winsock.




Thanks ; your implib is happy with wsock32 but it wants sppn.exe C:\wxWindows\src\msw>implib /system /v /suffix /Ic:\wx\dm\include\win32 c:\wxwin dows\lib\winsock_sc.lib c:\windows\system32\wsock32.dll Digital Mars Import Library Manager Version 7.5B4n Copyright (C) Digital Mars 1999-2002. All Rights Reserved. Modified by Jan Knepper Include Path : 'c:\wx\dm\include\win32' Suffix::Include ( c:\wx\dm\include\win32 ) c:\wxwindows\lib\winsock_sc.lib Input is a Windows NT DLL file 'WSOCK32.dll'. Could not start SPPN.EXE! my dm/bin dir has Directory of C:\wx\dm\bin [.] [..] bcc.exe cl.exe dmc.exe gc.dll implib.exe implib.ini lib.exe libunres.exe link.exe make.exe men.exe mex.exe rcc.exe sc.exe sc.ini scppn.exe scppnd.dll shell.exe 18 File(s) 3,003,317 bytes chris

Apr 24 2003
prev sibling parent Arjan Knepper <ask me.to> writes:
Mine XP 'home edition' has.

C:\windows\system32\wsock32.dll and
C:\windows\system32\winsock.dll

If you still having troubles getting the right lib or the lib right let 
me know.

Arjan

chris elliott wrote:
 "Arjan Knepper" <ask me.to> wrote in message
 news:b805mo$1v17$1 digitaldaemon.com...
 
And take a look at:
http://www.digitalmars.com/~jan/
has a modified implib which helps you to get the decoration right with
use of the M$ Platform api headers.

It is very usefull!

Arjan

Arjan Knepper wrote:

I think you should use wsock32 instead of winsock.


hi && thanks for the prompt reply; my XP box has winsock.dll, but no winsock32 I tried building a .lib file from the winsock.dll using this, but got a corrupt library (which i could send ): C:\wx\dm\bin>implib /system /v /suffix /Ic:\wx\dm\include\win32 c:\wxwindows\lib \winsock_sc.lib c:\windows\system32\winsock.dll Digital Mars Import Library Manager Version 7.5B4n Copyright (C) Digital Mars 1999-2002. All Rights Reserved. Modified by Jan Knepper Include Path : 'c:\wx\dm\include\win32' Suffix::Include ( c:\wx\dm\include\win32 ) c:\wxwindows\lib\winsock_sc.lib Input is a Windows WIN3 DLL file. Output is a Windows WIN3 import library. Digital Mars Import Library Creator complete. C:\wx\dm\bin>lib -l \wxwindows\lib\winsock_sc.lib Digital Mars Librarian Version 8.00n Copyright (C) Digital Mars 2000-2002 All Rights Reserved www.digitalmars.com Error: Corrupt file '\wxwindows\lib\winsock_sc.lib', Typ=xf1, Len=x6d09 C:\wx\dm\bin> Chris

Apr 22 2003
prev sibling parent reply "chris elliott" <biol75 york.ac.uk> writes:
"Arjan Knepper" <ask me.to> wrote in message
news:b7sc5m$2kh3$1 digitaldaemon.com...
 ad 1.
 Which version of the compiler are you using? I guess 8.33 because in the
 latest beta these problems are solved.

 ad 2.
 Where did you have this problem? I don't seem to have this problem here.

 Can you try to compile and run the samples\image sample? Compiles OK
 here but crashes when run. I didn't have the time to investigate this

I have now built the image sample and run it with no crashes - the wxWindows CVS server seems down for the holiday but I will commit the changes as soon as possible thanks for the help chris
Apr 21 2003
next sibling parent reply "Walter" <walter digitalmars.com> writes:
"chris elliott" <biol75 york.ac.uk> wrote in message
news:b8190m$2luq$1 digitaldaemon.com...
 I have now built the image sample and run it with no crashes - the

 CVS server seems down for the holiday but I will commit the changes as

 as possible
 thanks for the help
 chris

Any problems with DMC I should know about?
Apr 21 2003
next sibling parent "chris elliott" <biol75 york.ac.uk> writes:
"Walter" <walter digitalmars.com> wrote in message
news:b81sbn$1jg$2 digitaldaemon.com...
 "chris elliott" <biol75 york.ac.uk> wrote in message
 news:b8190m$2luq$1 digitaldaemon.com...
 I have now built the image sample and run it with no crashes - the

 CVS server seems down for the holiday but I will commit the changes as

 as possible
 thanks for the help
 chris

Any problems with DMC I should know about?

no compiler bugs at present - still a problem with getting a winsock library on XP (see recent post). I'll have a look on a 98 box next keep up the helpful mailings chris
Apr 22 2003
prev sibling parent reply "chris elliott" <biol75 york.ac.uk> writes:
"Walter" <walter digitalmars.com> wrote in message
news:b81sbn$1jg$2 digitaldaemon.com...

 Any problems with DMC I should know about?

I'd like to draw your attention to several places where I have had to apply extern "C" to functions. You can find them in the wxWindows/src/msw directory in several cpp files. These compile fine, but don't link with DMC; but compile and link with other compilers. I had to fix several of them for the minimal sample to compile. Note that the CVS will require you to set wxUSE_DRAG_AND_DROP to 0 as I still have a linker problem with the winsock library chris
Apr 24 2003
parent reply "Walter" <walter digitalmars.com> writes:
"chris elliott" <biol75 york.ac.uk> wrote in message
news:b89kbv$2b9g$1 digitaldaemon.com...
 "Walter" <walter digitalmars.com> wrote in message
 news:b81sbn$1jg$2 digitaldaemon.com...

 Any problems with DMC I should know about?

I'd like to draw your attention to several places where I have had to

 extern "C"

 to functions. You can find them in the wxWindows/src/msw directory in
 several cpp files. These compile fine, but don't link with DMC; but

 and link with other compilers.

Hmm. DMC's extern "C" behavior matches MSVC's. In general, to link with C functions in C++, you need to use extern "C".
 I had to fix several of them for the minimal
 sample to compile. Note that the CVS will require you to set
 wxUSE_DRAG_AND_DROP to 0 as I still have a linker problem with the winsock
 library

 chris

Apr 24 2003
next sibling parent chris elliott <biol75 york.ac.uk> writes:
Walter wrote:
 "chris elliott" <biol75 york.ac.uk> wrote in message
 news:b89kbv$2b9g$1 digitaldaemon.com...
 
"Walter" <walter digitalmars.com> wrote in message
news:b81sbn$1jg$2 digitaldaemon.com...

Any problems with DMC I should know about?

I'd like to draw your attention to several places where I have had to

apply
extern "C"

to functions. You can find them in the wxWindows/src/msw directory in
several cpp files. These compile fine, but don't link with DMC; but

compile
and link with other compilers.

Hmm. DMC's extern "C" behavior matches MSVC's. In general, to link with C functions in C++, you need to use extern "C".

extern but not "C"; in other cases they needed both extern and "C" added chris
Apr 25 2003
prev sibling parent reply chris elliott <biol75 york.ac.uk> writes:
Walter wrote:
 "chris elliott" <biol75 york.ac.uk> wrote in message
 news:b89kbv$2b9g$1 digitaldaemon.com...
 
"Walter" <walter digitalmars.com> wrote in message
news:b81sbn$1jg$2 digitaldaemon.com...

Any problems with DMC I should know about?

I'd like to draw your attention to several places where I have had to

apply
extern "C"

to functions. You can find them in the wxWindows/src/msw directory in
several cpp files. These compile fine, but don't link with DMC; but

compile
and link with other compilers.

Hmm. DMC's extern "C" behavior matches MSVC's. In general, to link with C functions in C++, you need to use extern "C".

extern but not "C"; in other cases they needed both extern and "C" added chris
Apr 25 2003
parent reply "Walter" <walter digitalmars.com> writes:
"chris elliott" <biol75 york.ac.uk> wrote in message
news:3EA8ECBF.9050302 york.ac.uk...
 Hmm. DMC's extern "C" behavior matches MSVC's. In general, to link with


 functions in C++, you need to use extern "C".

extern but not "C"; in other cases they needed both extern and "C" added

Can you duplicate it with a small example?
Apr 25 2003
parent Arjan Knepper <ask me.to> writes:
I have compiled the wxWindows-2.4.0 lib's and samples and _never_ had to 
  add any extern "C" to any src file.

Are you aware of the fact dmc still defines __SC__ as well? Because 
glancig over the current wxWindows cvs checkout, I saw you leave a lot 
of those intact, where they should have been disabled IMO when compiling 
with DMC. Further defs.h should have : HAVE_BOOL and HAVE_EXPLICIT, and 
the private wxString(int) ctor must bij commented out. What commandline 
options do you use to compile?

I can compile and run the 'minimal example' and most/all of the other 
sampels without any problem. The only problem I discovered sofar was 
with the image sample which crashes on JPEG's only.

Again this in 2.4.0. When I some time I will try to compile the cvs 
checkout.

Arjan

Walter wrote:
 "chris elliott" <biol75 york.ac.uk> wrote in message
 news:3EA8ECBF.9050302 york.ac.uk...
 
Hmm. DMC's extern "C" behavior matches MSVC's. In general, to link with


C
functions in C++, you need to use extern "C".

These functions link fine with VC6; in some cases they were declared as extern but not "C"; in other cases they needed both extern and "C" added

Can you duplicate it with a small example?

Apr 26 2003
prev sibling parent reply Arjan Knepper <ask me.to> writes:
Thanks!

Could you annouce it here when the updates are available in the CVS?

Arjan

chris elliott wrote:
 "Arjan Knepper" <ask me.to> wrote in message
 news:b7sc5m$2kh3$1 digitaldaemon.com...
 
ad 1.
Which version of the compiler are you using? I guess 8.33 because in the
latest beta these problems are solved.

ad 2.
Where did you have this problem? I don't seem to have this problem here.

Can you try to compile and run the samples\image sample? Compiles OK
here but crashes when run. I didn't have the time to investigate this

I have now built the image sample and run it with no crashes - the wxWindows CVS server seems down for the holiday but I will commit the changes as soon as possible thanks for the help chris

Apr 22 2003
parent "chris elliott" <biol75 york.ac.uk> writes:
"Arjan Knepper" <ask me.to> wrote in message
news:b830kh$q73$1 digitaldaemon.com...
 Thanks!

 Could you annouce it here when the updates are available in the CVS?

commited to wxWindows CVS now - http://www.wxwindows.org/cvs.htm makefiles to build minimal and image samples should compile/link/run chris
Apr 22 2003