Author Topic: linking question  (Read 4088 times)

Offline vurentjie

  • Multiple posting newcomer
  • *
  • Posts: 13
linking question
« 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.


Offline stahta01

  • Lives here!
  • ****
  • Posts: 7149
    • My Best Post
Re: linking question
« Reply #1 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
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Stretch, compiling CB Trunk against wxWidgets 3.0.
When in doubt, read the CB WiKi FAQ.

Offline vurentjie

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: linking question
« Reply #2 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.

« Last Edit: January 14, 2009, 10:16:29 pm by vurentjie »

Offline vurentjie

  • Multiple posting newcomer
  • *
  • Posts: 13
Re: linking question
« Reply #3 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.

« Last Edit: January 14, 2009, 11:49:03 pm by vurentjie »

Offline mikethebike

  • Multiple posting newcomer
  • *
  • Posts: 24
    • Homepage
Re: linking question
« Reply #4 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