Thread overview
libraries
Jan 20, 2007
Brecht Machiels
Jan 20, 2007
Walter Bright
Jan 20, 2007
Brecht Machiels
Jan 21, 2007
Walter Bright
Jan 21, 2007
Brecht Machiels
Jan 21, 2007
Walter Bright
Jan 21, 2007
Pavel Vozenilek
Jan 22, 2007
chris elliott
Jan 23, 2007
Brecht Machiels
Jan 28, 2007
copx
January 20, 2007
Hello,

I'd like to replace the slow MinGW GCC with DMC. Unfortunately, DMC doesn't seem to be supported by any of the libraries I use, so I have to waste time with implib and/or adjusting makefiles to generate the .lib files to link with.

I've been having "fun" for a couple of hours now trying to compile a very simple SDL application. Fortunately SDL comes with libs for the Borland compiler. I'm currently stuck at the following error message (during linking):

"OPTLINK : Warning 134: No Start Address"

Doing some more googling, I came across a tip to specify /ENTRY. Using "/ENTRY:WinMain" gets me a little bit further:

C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
 Error 42: Symbol Undefined __streams
C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
 Error 42: Symbol Undefined GetModuleHandleA
C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
 Error 42: Symbol Undefined _SDL_main
C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
 Error 42: Symbol Undefined ___alloca_helper
C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
 Error 42: Symbol Undefined LoadLibraryA
C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
 Error 42: Symbol Undefined FreeLibrary
C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
 Error 42: Symbol Undefined GetCommandLineA

Stuff like this has made me give up on DMC in the past... Yes there are some clues in the newsgroup archives, but it remains to be a real chore.

And once I finally get the SDL library to link properly with my little application, I soon will have similar wonderful adventures with libpng, libz, libjpeg and many others! :(

Is there perhaps a repository of pre-built libs for DMC, or perhaps a straight-forward guide to work with third party libraries (a wiki perhaps)? Something in the style of the Dev-C++ devpacks would be a godsend.

Please help me get past this library-hacking, so I can do what I wanted to do in the first place: compile *my* code.

I apologize for any traces of sarcasm in the above.

Regards,
soon-to-go-berserk Brecht
January 20, 2007
Brecht Machiels wrote:
> Hello,
> 
> I'd like to replace the slow MinGW GCC with DMC. Unfortunately, DMC doesn't seem to be supported by any of the libraries I use, so I have to waste time with implib and/or adjusting makefiles to generate the .lib files to link with.
> 
> I've been having "fun" for a couple of hours now trying to compile a very simple SDL application. Fortunately SDL comes with libs for the Borland compiler. I'm currently stuck at the following error message (during linking):
> 
> "OPTLINK : Warning 134: No Start Address"
> 
> Doing some more googling, I came across a tip to specify /ENTRY. Using "/ENTRY:WinMain" gets me a little bit further:
> 
> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>  Error 42: Symbol Undefined __streams
> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>  Error 42: Symbol Undefined GetModuleHandleA
> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>  Error 42: Symbol Undefined _SDL_main
> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>  Error 42: Symbol Undefined ___alloca_helper
> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>  Error 42: Symbol Undefined LoadLibraryA
> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>  Error 42: Symbol Undefined FreeLibrary
> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>  Error 42: Symbol Undefined GetCommandLineA
>
> Stuff like this has made me give up on DMC in the past... Yes there are some clues in the newsgroup archives, but it remains to be a real chore.

The easy way to find out which library a name is defined in is:

	grep GetCommandLineA \dm\lib\*.lib

which gives:

\dm\lib\kernel32.lib:.GetCommandLineA
\dm\lib\kernel32.lib:._GetCommandLineA@0.KERNEL32.GetCommandLineA
\dm\lib\kernel32.lib:._GetCommandLineA@0f.
\dm\lib\SCRNSAVE.LIB:.__imp__GetCommandLineA@0
\dm\lib\SND.lib:.__imp__GetCommandLineA@0
\dm\lib\SND.lib:.__imp__GetCommandLineA@0
\dm\lib\SND.lib:.__imp__GetCommandLineA@0
\dm\lib\SNDD.lib:.__imp__GetCommandLineA@0
\dm\lib\SNDD.lib:.__imp__GetCommandLineA@0
\dm\lib\SNDD.lib:.__imp__GetCommandLineA@0
\dm\lib\snn.lib:.__imp__GetCommandLineA@0
\dm\lib\snn.lib:.__imp__GetCommandLineA@0
\dm\lib\snn.lib:.__imp__GetCommandLineA@0
\dm\lib\snnd.lib:.__imp__GetCommandLineA@0
\dm\lib\snnd.lib:.__imp__GetCommandLineA@0
\dm\lib\snnd.lib:.__imp__GetCommandLineA@0

Looks like you need to link in kernel32.lib.


> And once I finally get the SDL library to link properly with my little application, I soon will have similar wonderful adventures with libpng, libz, libjpeg and many others! :(
> 
> Is there perhaps a repository of pre-built libs for DMC, or perhaps a straight-forward guide to work with third party libraries (a wiki perhaps)? Something in the style of the Dev-C++ devpacks would be a godsend.
> 
> Please help me get past this library-hacking, so I can do what I wanted to do in the first place: compile *my* code.
> 
> I apologize for any traces of sarcasm in the above.
> 
> Regards,
> soon-to-go-berserk Brecht
January 20, 2007
Hello,

It seems kernel32 is linked in by default. Running

dmc.exe "..\common\timer.obj" "..\common\conio.obj" "..\common\vga.obj" -ostars_sdl.exe SDLmain.lib SDL.lib -L/ENTRY:WinMain

results in the following OPTLINK call:

link ..\common\timer.obj+..\common\conio.obj+..\common\vga.obj,stars_sdl.exe,,SD
Lmain+SDL+user32+kernel32/noi/ENTRY:WinMain;

Notice "kernel32" in there. I also tried adding kernel32.lib explicitly:

dmc.exe "..\common\timer.obj" "..\common\conio.obj" "..\common\vga.obj" -ostars_sdl.exe SDLmain.lib SDL.lib kernel32.lib -L/ENTRY:WinMain

which results in

link ..\common\timer.obj+..\common\conio.obj+..\common\vga.obj,stars_sdl.exe,,SD
Lmain+SDL+kernel32+user32+kernel32/noi/ENTRY:WinMain;

OPTLINK returns the same errors though.

Any ideas?

On a side note, a library repository for DMC such as http://devpaks.org/ for MinGW would be great. I'm sure many of the DMC users out there have each built some libraries with/for DMC. Perhaps it's possible to collect those somewhere?

Regards,
Brecht

Walter Bright wrote:
> Brecht Machiels wrote:
>> Hello,
>>
>> I'd like to replace the slow MinGW GCC with DMC. Unfortunately, DMC doesn't seem to be supported by any of the libraries I use, so I have to waste time with implib and/or adjusting makefiles to generate the .lib files to link with.
>>
>> I've been having "fun" for a couple of hours now trying to compile a very simple SDL application. Fortunately SDL comes with libs for the Borland compiler. I'm currently stuck at the following error message (during linking):
>>
>> "OPTLINK : Warning 134: No Start Address"
>>
>> Doing some more googling, I came across a tip to specify /ENTRY. Using "/ENTRY:WinMain" gets me a little bit further:
>>
>> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>>  Error 42: Symbol Undefined __streams
>> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>>  Error 42: Symbol Undefined GetModuleHandleA
>> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>>  Error 42: Symbol Undefined _SDL_main
>> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>>  Error 42: Symbol Undefined ___alloca_helper
>> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>>  Error 42: Symbol Undefined LoadLibraryA
>> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>>  Error 42: Symbol Undefined FreeLibrary
>> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>>  Error 42: Symbol Undefined GetCommandLineA
>>
>> Stuff like this has made me give up on DMC in the past... Yes there are some clues in the newsgroup archives, but it remains to be a real chore.
> 
> The easy way to find out which library a name is defined in is:
> 
>     grep GetCommandLineA \dm\lib\*.lib
> 
> which gives:
> 
> \dm\lib\kernel32.lib:.GetCommandLineA
> \dm\lib\kernel32.lib:._GetCommandLineA@0.KERNEL32.GetCommandLineA
> \dm\lib\kernel32.lib:._GetCommandLineA@0f.
> \dm\lib\SCRNSAVE.LIB:.__imp__GetCommandLineA@0
> \dm\lib\SND.lib:.__imp__GetCommandLineA@0
> \dm\lib\SND.lib:.__imp__GetCommandLineA@0
> \dm\lib\SND.lib:.__imp__GetCommandLineA@0
> \dm\lib\SNDD.lib:.__imp__GetCommandLineA@0
> \dm\lib\SNDD.lib:.__imp__GetCommandLineA@0
> \dm\lib\SNDD.lib:.__imp__GetCommandLineA@0
> \dm\lib\snn.lib:.__imp__GetCommandLineA@0
> \dm\lib\snn.lib:.__imp__GetCommandLineA@0
> \dm\lib\snn.lib:.__imp__GetCommandLineA@0
> \dm\lib\snnd.lib:.__imp__GetCommandLineA@0
> \dm\lib\snnd.lib:.__imp__GetCommandLineA@0
> \dm\lib\snnd.lib:.__imp__GetCommandLineA@0
> 
> Looks like you need to link in kernel32.lib.
> 
> 
>> And once I finally get the SDL library to link properly with my little application, I soon will have similar wonderful adventures with libpng, libz, libjpeg and many others! :(
>>
>> Is there perhaps a repository of pre-built libs for DMC, or perhaps a straight-forward guide to work with third party libraries (a wiki perhaps)? Something in the style of the Dev-C++ devpacks would be a godsend.
>>
>> Please help me get past this library-hacking, so I can do what I wanted to do in the first place: compile *my* code.
>>
>> I apologize for any traces of sarcasm in the above.
>>
>> Regards,
>> soon-to-go-berserk Brecht
January 21, 2007
Brecht Machiels wrote:
> Any ideas?

optlink probably isn't finding kernel32.lib. Verify that you have it, that it is in the right place, and your LIB environment variable is set up to point to it.
January 21, 2007
"Brecht Machiels" wrote:

> I'd like to replace the slow MinGW GCC with DMC.

Partially OT: Dev-Cpp now has an experimental support
for DMC (with a devpak).

The relevant discussion is on: http://wxforum.shadonet.com/viewtopic.php?t=12155

/Pavel





January 21, 2007
Walter Bright wrote:
> Brecht Machiels wrote:
>> Any ideas?
> 
> optlink probably isn't finding kernel32.lib. Verify that you have it, that it is in the right place, and your LIB environment variable is set up to point to it.

I believe it does find kernel32.lib. It comes with the compiler, no?

When I try to link with kernel33.lib like this:
                              ^^
link ..\common\timer.obj+..\common\conio.obj+..\common\vga.obj,stars_sdl.exe,,SDLmain+SDL+user32+kernel33/noi/ENTRY:WinMain

the results are:

kernel33.lib
 Warning 2: File Not Found kernel33.lib
C:\Program Files\dm\bin\..\lib\SNN.lib(_exit)
 Error 42: Symbol Undefined _ExitProcess@4
<more of this kind>
C:\Program Files\dm\bin\..\lib\SNN.lib(sbrk)
 Error 42: Symbol Undefined _VirtualAlloc@16
C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
 Error 42: Symbol Undefined __streams
C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
 Error 42: Symbol Undefined GetModuleHandleA
C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
 Error 42: Symbol Undefined _SDL_main
C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
 Error 42: Symbol Undefined ___alloca_helper
C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
 Error 42: Symbol Undefined LoadLibraryA
C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
 Error 42: Symbol Undefined FreeLibrary
C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
 Error 42: Symbol Undefined GetCommandLineA
C:\Program Files\dm\bin\..\lib\SNN.lib(_fopen)
 Error 42: Symbol Undefined _CreateFileA@28

So it definitely complains when it doesn't find a lib. I suspect the link errors have something to do with the decoration of function names. It always seems to come down to that.

Thanks for your patience,
Brecht
January 21, 2007
Brecht Machiels wrote:
> So it definitely complains when it doesn't find a lib. I suspect the link errors have something to do with the decoration of function names. It always seems to come down to that.

The next step is write a trivial D program that just calls a function in kernel32.lib. See if that works.
January 22, 2007
LoadLibraryA and getmodulehandleA suggest failures with linking with unicode/ansi

It's unlikely that libraries compiled for Borland would link with DMC

chris



Brecht Machiels wrote:
> Hello,
> 
> I'd like to replace the slow MinGW GCC with DMC. Unfortunately, DMC doesn't seem to be supported by any of the libraries I use, so I have to waste time with implib and/or adjusting makefiles to generate the .lib files to link with.
> 
> I've been having "fun" for a couple of hours now trying to compile a very simple SDL application. Fortunately SDL comes with libs for the Borland compiler. I'm currently stuck at the following error message (during linking):
> 
> "OPTLINK : Warning 134: No Start Address"
> 
> Doing some more googling, I came across a tip to specify /ENTRY. Using "/ENTRY:WinMain" gets me a little bit further:
> 
> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>  Error 42: Symbol Undefined __streams
> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>  Error 42: Symbol Undefined GetModuleHandleA
> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>  Error 42: Symbol Undefined _SDL_main
> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>  Error 42: Symbol Undefined ___alloca_helper
> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>  Error 42: Symbol Undefined LoadLibraryA
> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>  Error 42: Symbol Undefined FreeLibrary
> C:\Program Files\dm\local\lib\SDLmain.lib(SDL_main)
>  Error 42: Symbol Undefined GetCommandLineA
> 
> Stuff like this has made me give up on DMC in the past... Yes there are some clues in the newsgroup archives, but it remains to be a real chore.
> 
> And once I finally get the SDL library to link properly with my little application, I soon will have similar wonderful adventures with libpng, libz, libjpeg and many others! :(
> 
> Is there perhaps a repository of pre-built libs for DMC, or perhaps a straight-forward guide to work with third party libraries (a wiki perhaps)? Something in the style of the Dev-C++ devpacks would be a godsend.
> 
> Please help me get past this library-hacking, so I can do what I wanted to do in the first place: compile *my* code.
> 
> I apologize for any traces of sarcasm in the above.
> 
> Regards,
> soon-to-go-berserk Brecht
January 23, 2007
Hello,

chris elliott wrote:
> LoadLibraryA and getmodulehandleA suggest failures with linking with unicode/ansi
> 
> It's unlikely that libraries compiled for Borland would link with DMC

That might indeed have been the problem.

I have finally managed to get the SDL application working. I have generated an import library with the help of implib and compiled SDL_main from source and link with that instead.

The window frame looks a bit retro though (old windows headers supplied with DMC?). But for the rest it runs fine.

Regards,
Brecht
January 28, 2007
"Brecht Machiels" <brecht@mos6581.org> schrieb im Newsbeitrag news:eoteav$28dg$1@digitaldaemon.com...
> Hello,
>
> I'd like to replace the slow MinGW GCC with DMC. Unfortunately, DMC doesn't seem to be supported by any of the libraries I use, so I have to waste time with implib and/or adjusting makefiles to generate the .lib files to link with.

We are in the same situation!