Advertisement

Linker settings for SDL2 on Linux

Started by March 12, 2014 10:19 PM
2 comments, last by maxter 10 years, 8 months ago

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?

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.

Advertisement

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

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.

This topic is closed to new replies.

Advertisement