D - DMD: LINK!!! Please link!
- andy (39/39) Sep 10 2002 Hi I've some code I'm compiling on Linux with DLI, but I wanted to cross...
- Pavel Minayev (6/13) Sep 10 2002 Just don't forget to link with import libs, ws2_32.lib in this case:
- andy (2/23) Sep 10 2002
- andy (38/59) Sep 10 2002 Okay so I found your site. And I downloaded the ws2_32.lib however its
- Pavel Minayev (4/9) Sep 10 2002 Judging by mangled function names, you've used extern(C) convention.
- andy (2/19) Sep 11 2002
- andy (4/25) Sep 11 2002 Thanks!
- Pavel Minayev (2/5) Sep 11 2002 It ought to be there as well... How did you declare it?
- andy (2/12) Sep 12 2002 extern (Windows): ushort htons(ushort fd);
Hi I've some code I'm compiling on Linux with DLI, but I wanted to cross test with the DMD compiler. It seems however (latest version) that the linker hates my guts. I keep getting this: D:\d\dmd\samples\d>dmd -v ServerSocket snn.lib -I..\..\..\dm\include\*.c parse ServerSocket semantic ServerSocket semantic2 ServerSocket semantic3 ServerSocket code ServerSocket generating code for function 'this()' generating code for function 'openSocket' generating code for function 'bindSocket' generating code for function 'closeSocket' generating code for function 'listenSocket' generating code for function 'acceptSocket' generating code for function 'readSocket' generating code for function 'main' link ServerSocket,,,snn.lib+user32+kernel32/noi; OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved ServerSocket.obj(ServerSocket) Error 42: Symbol Undefined _socket ServerSocket.obj(ServerSocket) Error 42: Symbol Undefined _bind ServerSocket.obj(ServerSocket) Error 42: Symbol Undefined _listen ServerSocket.obj(ServerSocket) Error 42: Symbol Undefined _accept ServerSocket.obj(ServerSocket) Error 42: Symbol Undefined _htons ServerSocket.obj(ServerSocket) Error 42: Symbol Undefined _inet_addr ServerSocket.obj(ServerSocket) Error 42: Symbol Undefined _htonl --- errorlevel 7 I've tried a few variations to try and compile but it never can find the standard C libraries I fear. Any ideas? I'm sure I'm doing something minor and stupid. -Andy
Sep 10 2002
andy wrote:Hi I've some code I'm compiling on Linux with DLI, but I wanted to cross test with the DMD compiler. It seems however (latest version) that the linker hates my guts. I keep getting this:...I've tried a few variations to try and compile but it never can find the standard C libraries I fear. Any ideas? I'm sure I'm doing something minor and stupid.Just don't forget to link with import libs, ws2_32.lib in this case: dmd -v ServerSocket snn.lib ws2_32.lib -I..\..\..\dm\include\*.c If you don't have the lib, you can get it with my winsock module from my site.
Sep 10 2002
Ahh thanks. URL? Pavel Minayev wrote:andy wrote:Hi I've some code I'm compiling on Linux with DLI, but I wanted to cross test with the DMD compiler. It seems however (latest version) that the linker hates my guts. I keep getting this:...I've tried a few variations to try and compile but it never can find the standard C libraries I fear. Any ideas? I'm sure I'm doing something minor and stupid.Just don't forget to link with import libs, ws2_32.lib in this case: dmd -v ServerSocket snn.lib ws2_32.lib -I..\..\..\dm\include\*.c If you don't have the lib, you can get it with my winsock module from my site.
Sep 10 2002
Okay so I found your site. And I downloaded the ws2_32.lib however its still reporting negative. is there another lib I need to support basic functions like bind and accept, etc? D:\d\dmd\samples\d>dmd -v ServerSocket snn.lib ws2_32.lib -I..\..\..\dm\include\ *.c parse ServerSocket semantic ServerSocket semantic2 ServerSocket semantic3 ServerSocket code ServerSocket generating code for function 'this()' generating code for function 'openSocket' generating code for function 'bindSocket' generating code for function 'closeSocket' generating code for function 'listenSocket' generating code for function 'acceptSocket' generating code for function 'readSocket' generating code for function 'main' link ServerSocket,,,snn.lib+ws2_32.lib+user32+kernel32/noi; OPTLINK (R) for Win32 Release 7.50B1 Copyright (C) Digital Mars 1989 - 2001 All Rights Reserved ServerSocket.obj(ServerSocket) Error 42: Symbol Undefined _socket ServerSocket.obj(ServerSocket) Error 42: Symbol Undefined _bind ServerSocket.obj(ServerSocket) Error 42: Symbol Undefined _listen ServerSocket.obj(ServerSocket) Error 42: Symbol Undefined _accept ServerSocket.obj(ServerSocket) Error 42: Symbol Undefined _htons ServerSocket.obj(ServerSocket) Error 42: Symbol Undefined _inet_addr ServerSocket.obj(ServerSocket) Error 42: Symbol Undefined _htonl --- errorlevel 7 Pavel Minayev wrote:andy wrote:Hi I've some code I'm compiling on Linux with DLI, but I wanted to cross test with the DMD compiler. It seems however (latest version) that the linker hates my guts. I keep getting this:...I've tried a few variations to try and compile but it never can find the standard C libraries I fear. Any ideas? I'm sure I'm doing something minor and stupid.Just don't forget to link with import libs, ws2_32.lib in this case: dmd -v ServerSocket snn.lib ws2_32.lib -I..\..\..\dm\include\*.c If you don't have the lib, you can get it with my winsock module from my site.
Sep 10 2002
andy wrote:Okay so I found your site. And I downloaded the ws2_32.lib however its still reporting negative. is there another lib I need to support basic functions like bind and accept, etc? ServerSocket.obj(ServerSocket) Error 42: Symbol Undefined _socketJudging by mangled function names, you've used extern(C) convention. Under Windows it should be extern(Windows): extern(Windows) int connect(SOCKET s, sockaddr* name, int namelen);
Sep 10 2002
Ahh.. I'll try that. Thanks. Pavel Minayev wrote:andy wrote:Okay so I found your site. And I downloaded the ws2_32.lib however its still reporting negative. is there another lib I need to support basic functions like bind and accept, etc?>ServerSocket.obj(ServerSocket) Error 42: Symbol Undefined _socketJudging by mangled function names, you've used extern(C) convention. Under Windows it should be extern(Windows): extern(Windows) int connect(SOCKET s, sockaddr* name, int namelen);
Sep 11 2002
Thanks! So looks like I'm down to the last unresolved... Where would I get htons? -Andy Pavel Minayev wrote:andy wrote:Hi I've some code I'm compiling on Linux with DLI, but I wanted to cross test with the DMD compiler. It seems however (latest version) that the linker hates my guts. I keep getting this:...I've tried a few variations to try and compile but it never can find the standard C libraries I fear. Any ideas? I'm sure I'm doing something minor and stupid.Just don't forget to link with import libs, ws2_32.lib in this case: dmd -v ServerSocket snn.lib ws2_32.lib -I..\..\..\dm\include\*.c If you don't have the lib, you can get it with my winsock module from my site.
Sep 11 2002
andy wrote:Thanks! So looks like I'm down to the last unresolved... Where would I get htons?It ought to be there as well... How did you declare it?
Sep 11 2002
Pavel Minayev wrote:andy wrote:extern (Windows): ushort htons(ushort fd);Thanks! So looks like I'm down to the last unresolved... Where would I get htons?It ought to be there as well... How did you declare it?
Sep 12 2002