problem with compiling

New to FreeBASIC? Post your questions here.
Post Reply
justfree
Posts: 18
Joined: May 12, 2014 2:42

problem with compiling

Post by justfree »

I am using FbEdit, Win 8,

When I run Nehe examples by directly loading an example, it compiles and run fine. But when I use SDL files or the Dll example, I get this:

C:\FreeBASIC\bin\win32\ld.exe: cannot find -lSDL

or this:

C:\FreeBASIC\bin\win32\ld.exe: cannot find -lmydll

There is something I don't know here, documentations and tutorial not helpful in this case. Need help.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: problem with compiling

Post by MrSwiss »

sorry not complete, read next ...
Last edited by MrSwiss on Aug 11, 2014 16:05, edited 2 times in total.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: problem with compiling

Post by MrSwiss »

Hi,

if it says in the source something like:
'' mydll.bas MUST BE COMPILED FIRST (as DLL) --> fbc -dll mydll.bas
then, if you don't do that, you'll be getting compile faults like you mentioned above:
because the Linker (LD.exe) expects the DLL to be made allready.

There is nothing wrong with the documentation!
justfree
Posts: 18
Joined: May 12, 2014 2:42

Re: problem with compiling

Post by justfree »

Thanks,

For sure nothing wrong with documentation.

Yes, it says, I didn't read the source code carefully, just ran the program. OK, I compiled the dll and it works now.

How about the SDL examples? I picked mouse example. It seems I need SDL.dll. Should I compile it myself or it is precompiled somewhere for download?
dkl
Site Admin
Posts: 3235
Joined: Jul 28, 2005 14:45
Location: Germany

Re: problem with compiling

Post by dkl »

Hi,

SDL is a popular graphics library, you can download it from their homepage:
https://www.libsdl.org/

For more information about what to download:
http://www.freebasic.net/forum/viewtopi ... 68#p197768
justfree
Posts: 18
Joined: May 12, 2014 2:42

Re: problem with compiling

Post by justfree »

OK, I got SDL 1.2 binary which has the dll for win32, now the example works. Thanks. So, answer to my question is: you need SDL.dll, which is not automatically provided.
MrSwiss
Posts: 3910
Joined: Jun 02, 2013 9:27
Location: Switzerland

Re: problem with compiling

Post by MrSwiss »

Working with external librarys (statically or dynamically linked) is in most
programming languages very similar.
The reason for those external binarys/source code not beeing part of the
fbc-package may vary, possible reasons beeing:
- licensing
- other restrictions
- it simply is a question of size, maintainability or any combination therof.
Post Reply