Build errors while using sdl_ttf - MAC OS X

I’m trying to do the same thing and getting the same error. All other SDL-components work just fine (SDL_mixer, SDL_Image and SDL).

Code:

“_TTF_Init”, referenced from:
cwing::System::System()in System.o
cwing::System::System()in System.o
"_TTF_Quit", referenced from:
cwing::System::~System()in System.o
cwing::System::~System()in System.o
"_TTF_CloseFont", referenced from:
cwing::System::~System()in System.o
cwing::System::~System()in System.o
cwing::System::~System()in System.o
cwing::System::~System()in System.o
"_TTF_OpenFont", referenced from:
cwing::System::System()in System.o
cwing::System::System()in System.o
cwing::System::System()in System.o
cwing::System::System()in System.o
"_TTF_RenderText_Blended", referenced from:
cwing::label::setText(std::basic_string<char, std::char_traits, std::allocator >)in Label.o
cwing::label::Label(int, int, std::basic_string<char, std::char_traits, std::allocator >)in Label.o
cwing::label::Label(int, int, std::basic_string<char, std::char_traits, std::allocator >)in Label.o
cwing::Button::Button(int, int, std::basic_string<char, std::char_traits, std::allocator >)in Button.o
cwing::Button::Button(int, int, std::basic_string<char, std::char_traits, std::allocator >)in Button.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Anyone got any ideas of what could be wrong? This is driving me nuts! :smiley:

I have tried using different kind of include-formats such as:

Code:

//First format
#include “SDL_ttf.h”

//Second format
#include <SDL_ttf/SDL_ttf.h>

And neither of them work. Iv’e also tried to delete all my SDL-frameworks and reinstalling them without any luck.

Oh, and i’ve also tried to add a linker flag to the project:

Project > Project Settings > Build > Linking > Other Linking Flags > “lSDL_ttf”. This gives the following output:

Code:

Command /Developer/usr/bin/g+±4.2 failed with exit code 1

Any help would be much appreciated! :slight_smile:

Which version of SDl do you use ? 1.2.14 or 1.3 ?? Which platafform do
you use Win, Mac or Linux ??
SDL_ttf is not able for SDL 1.3.
El 14/01/2010, a las 17:05, runan escribi?:> I’m trying to do the same thing and getting the same error. All

other SDL-components work just fine (SDL_mixer, SDL_Image and SDL).

Code:

“_TTF_Init”, referenced from:
cwing::System::System()in System.o
cwing::System::System()in System.o
"_TTF_Quit", referenced from:
cwing::System::~System()in System.o
cwing::System::~System()in System.o
"_TTF_CloseFont", referenced from:
cwing::System::~System()in System.o
cwing::System::~System()in System.o
cwing::System::~System()in System.o
cwing::System::~System()in System.o
"_TTF_OpenFont", referenced from:
cwing::System::System()in System.o
cwing::System::System()in System.o
cwing::System::System()in System.o
cwing::System::System()in System.o
"_TTF_RenderText_Blended", referenced from:
cwing::label::setText(std::basic_string, std::allocator >)in
Label.o
cwing::label::Label(int, int, std::basic_string,
std::allocator >)in Label.o
cwing::label::Label(int, int, std::basic_string,
std::allocator >)in Label.o
cwing::Button::Button(int, int, std::basic_string,
std::allocator >)in Button.o
cwing::Button::Button(int, int, std::basic_string,
std::allocator >)in Button.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Anyone got any ideas of what could be wrong? This is driving me nuts!

I have tried using different kind of include-formats such as:

Code:

//First format
#include “SDL_ttf.h”

//Second format
#include

And neither of them work. Iv’e also tried to delete all my SDL-
frameworks and reinstalling them without any luck.

Oh, and i’ve also tried to add a linker flag to the project:

Project > Project Settings > Build > Linking > Other Linking Flags >
“lSDL_ttf”. This gives the following output:

Code:

Command /Developer/usr/bin/g+±4.2 failed with exit code 1

Any help would be much appreciated!


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

It’s pretty clearly a link problem, so changing your #include directives
won’t help. Try changing the link flag you add to -lSDL_ttf (put a dash in
front of what you already had), that’s the form I use. Also, you should
probably doublecheck that SDL_ttf is built correctly and in the right place.

-JOn Thu, Jan 14, 2010 at 11:05 AM, runan wrote:

I’m trying to do the same thing and getting the same error. All other
SDL-components work just fine (SDL_mixer, SDL_Image and SDL).

Code:

“_TTF_Init”, referenced from:
cwing::System::System()in System.o
cwing::System::System()in System.o
"_TTF_Quit", referenced from:
cwing::System::~System()in System.o
cwing::System::~System()in System.o
"_TTF_CloseFont", referenced from:
cwing::System::~System()in System.o
cwing::System::~System()in System.o
cwing::System::~System()in System.o
cwing::System::~System()in System.o
"_TTF_OpenFont", referenced from:
cwing::System::System()in System.o
cwing::System::System()in System.o
cwing::System::System()in System.o
cwing::System::System()in System.o
"_TTF_RenderText_Blended", referenced from:
cwing::label::setText(std::basic_string, std::allocator >)in Label.o
cwing::label::Label(int, int, std::basic_string, std::allocator >)in
Label.o
cwing::label::Label(int, int, std::basic_string, std::allocator >)in
Label.o
cwing::Button::Button(int, int, std::basic_string, std::allocator

)in Button.o
cwing::Button::Button(int, int, std::basic_string, std::allocator
)in Button.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Anyone got any ideas of what could be wrong? This is driving me nuts! [image:
Very Happy]

I have tried using different kind of include-formats such as:

Code:

//First format
#include “SDL_ttf.h”

//Second format
#include

And neither of them work. Iv’e also tried to delete all my SDL-frameworks
and reinstalling them without any luck.

Oh, and i’ve also tried to add a linker flag to the project:

Project > Project Settings > Build > Linking > Other Linking Flags >
“lSDL_ttf”. This gives the following output:

Code:

Command /Developer/usr/bin/g+±4.2 failed with exit code 1

Any help would be much appreciated! [image: Smile]


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org

Im using SDL 1.2.14, OS X 10.6.2 (Snow Leopard). All my other SDL_modules are working (SDL, SDL_mixer and SDL_image).

memmaker650 wrote:> Which version of SDl do you use ? 1.2.14 or 1.3 ?? Which platafform do you use Win, Mac or Linux ??SDL_ttf is not able for SDL 1.3.

El 14/01/2010, a las 17:05, runan escribi?:

I’m trying to do the same thing and getting the same error. All other SDL-components work just fine (SDL_mixer, SDL_Image and SDL).

Code:
"_TTF_Init", referenced from:
cwing::System::System()in System.o
cwing::System::System()in System.o
"_TTF_Quit", referenced from:
cwing::System::~System()in System.o
cwing::System::~System()in System.o
"_TTF_CloseFont", referenced from:
cwing::System::~System()in System.o
cwing::System::~System()in System.o
cwing::System::~System()in System.o
cwing::System::~System()in System.o
"_TTF_OpenFont", referenced from:
cwing::System::System()in System.o
cwing::System::System()in System.o
cwing::System::System()in System.o
cwing::System::System()in System.o
"_TTF_RenderText_Blended", referenced from:
cwing::label::setText(std::basic_string, std::allocator >)in Label.o
cwing::label::Label(int, int, std::basic_string, std::allocator >)in Label.o
cwing::label::Label(int, int, std::basic_string, std::allocator >)in Label.o
cwing::Button::Button(int, int, std::basic_string, std::allocator >)in Button.o
cwing::Button::Button(int, int, std::basic_string, std::allocator >)in Button.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Anyone got any ideas of what could be wrong? This is driving me nuts! [Image: http://forums.libsdl.org/images/smiles/icon_biggrin.gif ]

I have tried using different kind of include-formats such as:

Code:
//First format
#include “SDL_ttf.h”

//Second format
#include

And neither of them work. Iv’e also tried to delete all my SDL-frameworks and reinstalling them without any luck.

Oh, and i’ve also tried to add a linker flag to the project:

Project > Project Settings > Build > Linking > Other Linking Flags > “lSDL_ttf”. This gives the following output:

Code:
Command /Developer/usr/bin/g+±4.2 failed with exit code 1

Any help would be much appreciated! [Image: http://forums.libsdl.org/images/smiles/icon_smile.gif ]


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

Actually, i think that did the trick!

i changed the flag from “lSDL_ttf” to " -lSDL_ttf" and now at least the compile part is working. However i get some weird unhandled exception when i run the code, but that could well be that my code shouldn’t be working atm! ;-).

Thanks a bunch Justin!

Justin Coleman wrote:> It’s pretty clearly a link problem, so changing your #include directives won’t help. Try changing the link flag you add to -lSDL_ttf (put a dash in front of what you already had), that’s the form I use. Also, you should probably doublecheck that SDL_ttf is built correctly and in the right place.

-J

On Thu, Jan 14, 2010 at 11:05 AM, runan <@runan (@runan)> wrote:

  I'm trying to do the same thing and getting the same error. All other SDL-components work just fine (SDL_mixer, SDL_Image and SDL).



Code:


? 

“_TTF_Init”, referenced from:
? ? ? cwing::System::System()in System.o
? ? ? cwing::System::System()in System.o
? “_TTF_Quit”, referenced from:
? ? ? cwing::System::~System()in System.o
? ? ? cwing::System::~System()in System.o
? “_TTF_CloseFont”, referenced from:
? ? ? cwing::System::~System()in System.o
? ? ? cwing::System::~System()in System.o
? ? ? cwing::System::~System()in System.o
? ? ? cwing::System::~System()in System.o
? “_TTF_OpenFont”, referenced from:
? ? ? cwing::System::System()in System.o
? ? ? cwing::System::System()in System.o
? ? ? cwing::System::System()in System.o
? ? ? cwing::System::System()in System.o
? “_TTF_RenderText_Blended”, referenced from:
? ? ? cwing::label::setText(std::basic_string, std::allocator >)in Label.o
? ? ? cwing::label::Label(int, int, std::basic_string, std::allocator >)in Label.o
? ? ? cwing::label::Label(int, int, std::basic_string, std::allocator >)in Label.o
? ? ? cwing::Button::Button(int, int, std::basic_string, std::allocator >)in Button.o
? ? ? cwing::Button::Button(int, int, std::basic_string, std::allocator >)in Button.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Anyone got any ideas of what could be wrong? This is driving me nuts!

I have tried using different kind of include-formats such as:

Code:

//First format
#include “SDL_ttf.h”

//Second format
#include

And neither of them work. Iv’e also tried to delete all my SDL-frameworks and reinstalling them without any luck.

Oh, and i’ve also tried to add a linker flag to the project:

Project > Project Settings > Build > Linking > Other Linking Flags > “lSDL_ttf”. This gives the following output:

Code:

Command /Developer/usr/bin/g+±4.2 failed with exit code 1

Any help would be much appreciated!


SDL mailing list
SDL at lists.libsdl.org (SDL at lists.libsdl.org)
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org (http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org)

No problem :slight_smile:

Next is checking all your pointers and such, making sure all the resource
files (fonts etc) are where you expect them to be, etc. I’m not sure if your
IDE supports debugging, but you could just use a bunch of printf or fprintf
statements to see if your variables are good before you use them. (If you
use fprintf, make sure to use fflush too :wink:

Happy coding,

-JustinOn Sun, Jan 17, 2010 at 1:46 PM, runan wrote:

Actually, i think that did the trick!

i changed the flag from “lSDL_ttf” to " -lSDL_ttf" and now at least the
compile part is working. However i get some weird unhandled exception when i
run the code, but that could well be that my code shouldn’t be working
atm! [image: Wink].

Thanks a bunch Justin!

Justin Coleman wrote:

It’s pretty clearly a link problem, so changing your #include directives
won’t help. Try changing the link flag you add to -lSDL_ttf (put a dash in
front of what you already had), that’s the form I use. Also, you should
probably doublecheck that SDL_ttf is built correctly and in the right place.

-J

On Thu, Jan 14, 2010 at 11:05 AM, runan <> wrote:

Quote:

I’m trying to do the same thing and getting the same error. All other
SDL-components work just fine (SDL_mixer, SDL_Image and SDL).

Code:

“_TTF_Init”, referenced from:
cwing::System::System()in System.o
cwing::System::System()in System.o
"_TTF_Quit", referenced from:
cwing::System::~System()in System.o
cwing::System::~System()in System.o
"_TTF_CloseFont", referenced from:
cwing::System::~System()in System.o
cwing::System::~System()in System.o
cwing::System::~System()in System.o
cwing::System::~System()in System.o
"_TTF_OpenFont", referenced from:
cwing::System::System()in System.o
cwing::System::System()in System.o
cwing::System::System()in System.o
cwing::System::System()in System.o
"_TTF_RenderText_Blended", referenced from:
cwing::label::setText(std::basic_string, std::allocator >)in Label.o
cwing::label::Label(int, int, std::basic_string, std::allocator >)in
Label.o
cwing::label::Label(int, int, std::basic_string, std::allocator >)in
Label.o
cwing::Button::Button(int, int, std::basic_string, std::allocator

)in Button.o
cwing::Button::Button(int, int, std::basic_string, std::allocator
)in Button.o
ld: symbol(s) not found
collect2: ld returned 1 exit status

Anyone got any ideas of what could be wrong? This is driving me nuts!

I have tried using different kind of include-formats such as:

Code:

//First format
#include “SDL_ttf.h”

//Second format
#include

And neither of them work. Iv’e also tried to delete all my SDL-frameworks
and reinstalling them without any luck.

Oh, and i’ve also tried to add a linker flag to the project:

Project > Project Settings > Build > Linking > Other Linking Flags >
“lSDL_ttf”. This gives the following output:

Code:

Command /Developer/usr/bin/g+±4.2 failed with exit code 1

Any help would be much appreciated!


SDL mailing list

http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org


SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org