Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: vurentjie on January 14, 2009, 01:30:26 am

Title: linking question
Post by: vurentjie on January 14, 2009, 01:30:26 am

I just read your 'before you post' notice, nevertheless here is my query....

I am trying to get FTGL compiled on code::blocks(win32), I first compiled a freetype.dll assuming this is what I would need with FTGL, and copied it to system32, I then attempted to compile first, an ftgl dll, and then just even one of the demos with the source. Both times I get the following error showing....

ld.exe||cannot find -lfreetype|
||=== Build finished: 1 errors, 0 warnings ===|

Which seems a linking issue.

I have tried adding -lfreetype under Other linker options (project build options)

Also tried adding freetype under Linker libraries  (project build options)

I understand this might not essentially be a code::blocks question but if anybody can offer advice here. Much appreciated.

Title: Re: linking question
Post by: stahta01 on January 14, 2009, 03:39:01 pm
First, Code::Blocks is an IDE not an compiler!
In other words, state the name and version of the Compiler for questions about compiling/linking.

Second, where is the library file located?
libname.lib (MSVC) or libname.a (MinGW GCC)

Did you set the search folder to the Library?
Using "Project" -> "Build options"
In left Column, Select the correct sub "Build Target" or the whole project.
Tab "Search Directory" Tab "linker"

Tim S
Title: Re: linking question
Post by: vurentjie on January 14, 2009, 08:55:43 pm

IDE/Compiler -- understand the differentiating but always say the wrong thing here,

but building libraries still feels awkward to me (just need some more experience and practice),
but you have helped me make sense of some, I managed to get freetype built and workin properly, and after reading your reply I think I will eventually come right with ftgl.

EDIT: I have managed to correct the linking issue. But my build halts at the following...

Linking dynamic library: ..\Build\ftgl.dll
Creating library file: ..\Build\libftgl.a
Cannot export freetype6_NULL_THUNK_DATA: symbol not found
collect2: ld returned 1 exit status

I am using the GCC compiler. I dont know what the heck this means.

Title: Re: linking question
Post by: vurentjie on January 14, 2009, 11:10:08 pm
stahta01, you helped me out great and taught me a bit more, i needed to link to the .a lib and not .lib lib. That was my other problem. Solved now.

And I just tested ftgl, and managed to render fonts,smiles.

Title: Re: linking question
Post by: mikethebike on January 17, 2009, 03:32:53 pm
ld.exe||cannot find -lSDL.dll|

Where do I have to add this SDL.dll?
Thanks Michael