Sign in to follow this  
Concentrate

This linker problem is killing me

Recommended Posts

I just want to program is that too much to ask for? I'm trying to link SDL_mixer into eclipse C++ on my mac. I get bunch of undefined reference for SDL_mixer functions. Please anyone able to help, help!!!

regards, D.chhetri

Share this post


Link to post
Share on other sites
I can't particularly help you with your question, but you should know you're not likely to get much help with such a vague problem description.

Put up the exact errors you get, and describe the steps you have taken so far to link, maybe you'll get more help that way.

Share this post


Link to post
Share on other sites
[quote name='karwosts' timestamp='1305499419' post='4811247']
I can't particularly help you with your question, but you should know you're not likely to get much help with such a vague problem description.

Put up the exact errors you get, and describe the steps you have taken so far to link, maybe you'll get more help that way.
[/quote]

Thanks.

The errors :
[code]
Undefined symbols:

"_Mix_PauseMusic", referenced from:

handleEvent(SDL_Event const&)in main.o

"_Mix_FreeMusic", referenced from:

_SDL_main in main.o

"_Mix_OpenAudio", referenced from:

_SDL_main in main.o

"_Mix_CloseAudio", referenced from:

_SDL_main in main.o

"_Mix_LoadMUS", referenced from:



//...and so on

[/code]




The steps I took to link SDL_mixer on eclipse C++ on my mac OS X




1) Download SDL_mixer.dmg

2) Included it inside SDL.framework which is located in my system/library/frameworks

3) In Eclipse, I went to Project->properties, under GCC C++ compiler -- Includes , I added the SDL_mixer.h directory

4) Test run, I get undefined reference errors[ logical since it does not know where to find its definition ]




Right now I'm trying to add SDL_mixer executable[ which I assume is the .lib file ] that is located in system/library/frameworks/SDL.frameworks/SDL_mixer.frameworks/

but I'm getting no luck. It shouldn't be complicated to add external libraries, but somehow I'm making it as if it were.

Share this post


Link to post
Share on other sites
Wow I got it, and it was soo stupid. I inserted SDL_mixer.framework inside of SDL.framework just so I could have it in the same director but that caused some problem I guess. So I added SDL_mixer.framework in the same directory as SDL.framework and not inside SDL.framework and now it works. So in all these are the steps I took to link SDL_mixer in eclipse C++ on MAC OS X

1) Download SDL_mixer.dmg for mac
2) Now copy or transfer the SDL_mixer.framework folder into the directory /System/libraries/Frameworks/
3) Now in eclipse go into Project->preference
4) Under C/C++ Build , Under Settings , click on the Miscellaneous tab
5) In the Linker Flags add "-framework SDL_mixer" without the quotes. This should be where you have -framework SDL as well
6) Now under GCC C++ compiler section, under 'includes'
- add the directory where your SDL_mixer.framework is[ if you followed step 1, it should be something like "/System/Library/Frameworks/SDL_mixer.framework" ]
- add the directory where SDL_mixer.h is located, it will be something like "/System/Library/Frameworks/SDL.framework/SDL_mixer.framework/Versions/A/Headers" if you followed step 1

7) Now the headers and frameworks are setup, you should have no linkage errors


I wrote the above step for reference for other people in the future, as I know sometimes linkage problems give so much trouble.

Thanks and regards, D.Chhetri

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this