• Advertisement
Sign in to follow this  

Linker settings for SDL2 on Linux

This topic is 1410 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

I'm trying to get a basic SDL2 program to run, but I'm running into issues with my linker settings.  Namely the linker settings I have are resulting in the following errors:

 

 

ld||cannot find -lmingw32|
ld||cannot find -ldinput8|
ld||cannot find -ldxguid|
ld||cannot find -ldxerr8|
ld||cannot find -luser32|
ld||cannot find -lgdi32|
ld||cannot find -lwinmm|
ld||cannot find -limm32|
 

...

ld||cannot find -luuid|
||=== Build finished: 26 errors, 0 warnings ===|

 

I have the SDL2.a, SDL2main.a, and SDL2_image.a files under link libraries, I have the necessary header files in search directories for the compiler.

 

I am using Codeblocks on Ubuntu 12.04, and I have installed mingw32 on this system.  What am I doing incorrectly?

Share this post


Link to post
Share on other sites
Advertisement

Hmm, are you trying to cross compile for Windows? In this case you need to get a hold of the shared libraries

that you are missing (dinput8, dxguid, dxerr8, ...).

 

Since you said that you are just trying to get a simple SDL2 program to run, I assume the above is not the case.

 

If you are just trying to compile the SDL2 project, you would not use mingw on linux. Just go with

 

g++ -o <OutputFileName> <ListOfSrcFiled> -lSDL2

 

appending whatever other libraries you need.

Share this post


Link to post
Share on other sites

yeah, everyone of those libs is windows specific. Are you using a tutorial?

 

The linker settings I found on a stackoverflow response to a question regarding setup.  I honestly forgot if it was meant specifically for windows, although I do plan on cross-compiling when I have a finished product.  I'm still learning, so it's not a very complicated project at all.  I'm going to go with the advice of the response above and report back later.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement