lets make the simpliest application:




result:

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




result:

works great. at stdout.txt we can see “puchuu”
lets change our makefile a little.
just group 2 object files to the static lib:

result:

Who is to blame?
Me or mingw developers?
is it clear to send to it’s bug tracker?
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 -lSDLwill not work if something in libpuchuu.a depends on something in libSDL.It should be
g++ -o program.exe -lSDL libpuchuu.aIf 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