I can reproduce this locally. Looking at the code in file emcc, if you specify -lfile, it will try to find the library file in question in the following order:
file.a file.dylib file.so file.dll libfile.a libfile.dylib libfile.so libfile.dll This causes it to catch SDL2.dll before it find libsdl2.a. The reason why dll files are looked for comes from an ancient commit: https://github.com/kripken/emscripten/commit/49c3db581aaf5122a10e500839989330b4f7e45f . The commit does not list a reason, but given the timeframe and that it's by Ehsan, I assume it would have to do something with emulating Ogre3D build system for Emscripten, he worked on that a long time ago. I think we should revise the libs search code for -lfile to look only for files libfile.bc libfile.a file.bc file.a in that exact order. I think we should deprecate the support for linking in files with other suffixes, and instruct people to use proper file suffixes for their generated static libraries. The fact that we try to link in .so and .dylib is lazy form (and .dll is most likely accidental and was added just for "completeness" at the time), and we should avoid that. I would be happy to see us grow a more rigorous convention here. What do you think Alon? 2014-07-02 11:55 GMT+03:00 Mark Callow <[email protected]>: > In my emcc command I specify "-Lsomedir -lSDL2". In "somedir" I have > files called "libSDL2.a" and "SDL2.dll". emcc spits out the following > strange message: > > 1> C:/Program Files/Emscripten/clang/e1.16.0_64bit\llvm-nm: > c:/users/callow~1/appdata/local/temp\tmppkhq8x\SDL2_18.dll: unrecognizable > file type > > Why is SDL2.dll being copied (and renamed) to this temp folder and why is > emcc running llvm-nm on it? It is not mentioned in the command at all. Here > is the full command: > > C:\Program Files\Emscripten\emscripten\1.16.0\emcc.bat > Emscripten/Debug/obj/a.o Emscripten/Debug/obj/b.o Emscripten/Debug/obj/c.o > /full/path/to/Emscripten/Debug/lib/appfwSDL.bc > /full/path/to/Emscripten/Debug/lib/platform.bc > /full/path/to/Emscripten/Debug/lib/graphics.bc -o > /full/path/to/Emscripten/Debug/TestAppSDL.html > -O0 -L../../other_lib/win/Emscripten -lSDL2 -s > "ERROR_ON_UNDEFINED_SYMBOLS=1" -s "MEMORY_SIZE=33554432" -s > "NO_EXIT_RUNTIME=1" --preload-file /full/path/to//Emscripten/Debug/data@ > /data > > Regards > > -Mark > -- > 注意:この電子メールには、株式会社エイチアイの機密情報が含まれている場合が有ります。正式なメール受信者では無い場合はメール複製、 > 再配信または情報の使用を固く禁じております。エラー、手違いでこのメールを受け取られましたら削除を行い配信者にご連絡をお願いいたし ます. > > NOTE: This electronic mail message may contain confidential and privileged > information from HI Corporation. If you are not the intended recipient, any > disclosure, photocopying, distribution or use of the contents of the > received information is prohibited. If you have received this e-mail in > error, please notify the sender immediately and permanently delete this > message and all related copies. > > -- > You received this message because you are subscribed to the Google Groups > "emscripten-discuss" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected]. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "emscripten-discuss" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
