tags:

views:

34

answers:

1

lets make the simpliest application:

alt text

alt text

alt text

alt text

result: alt text

ok. it works. lets add some SDL with default dynamic linking here!

alt text

alt text

alt text

alt text

result:

alt text works great. at stdout.txt we can see "puchuu"

lets change our makefile a little. just group 2 object files to the static lib:

alt text

result:

alt text

Who is to blame? Me or mingw developers? is it clear to send to it's bug tracker?

+2  A: 

mingw is not to blame. With the (GNU) linker, static libraries have to be listed in the reverse dependency order.

g++ -o program.exe libpuchuu.a -lSDL will not work if something in libpuchuu.a depends on something in libSDL.

It should be g++ -o program.exe -lSDL libpuchuu.a

If you have a cyclic dependency, you even have to list them twice. Consider e.g. libfoo.a depends on stuff in libbar.a ,and libbar.a depends on something in libfoo.a . You'll have to do: g++ -o fooprogram libbar.a libfoo.a libbar.a

nos
ctrl+c ctrl+v your post to notebook...
puchu