actually i create a CMake script to localize the DevIL library using MSYS/MinGW on win32 platform. I've extend the origin FindDevIL CMake script to regard the MinGW root when try to find DevIL. The DevIL .dll files are placed in bin subfolder, the DevIL.lib and DevIL.a files in the lib subfolder of MinGW root (c:/mingw). I use find_library() to check if a library exists.
Find_libary() returns allways the path to the dll files - but I can't link against this library using MinGW:
Linking CXX executable DevILTest.exe /C/binrev/development/mingw/bin/g++.exe "CMakeFiles/DevILTest.dir /winmain.cpp.obj" -o DevILTest.exe -Wl,--out-implib,libDevILTest.dll.a -Wl,--ma 32 -lopengl32 DevIL.dll -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut32 -luuid -lcomdlg32 -ladvapi32 CMakeFiles/DevILTest.dir/winmain.cpp.obj:winmain.cpp:(.text+0xcc8): undefined reference to `_imp__ilOriginFunc@4' CMakeFiles/DevILTest.dir/winmain.cpp.obj:winmain.cpp:(.text+0xce0): undefined reference to `_imp__ilEnable@4' CMakeFiles/DevILTest.dir/winmain.cpp.obj:winmain.cpp:(.text+0xcf9): undefined reference to `_imp__ilSetInteger@8'
If i remove the dll files and run the cmake skript the DevIL.lib library is localized correctly and i go no linker failures:
-- Detected OpenGL path is : glu32;opengl32 -- Found DevIL includes at: C:/mingw/include/IL -- Found DevIL library at: C:/mingw/lib/DevIL.lib
But in this case the applicaton crashes on start up while missing the dll files. If i add those dlls back to mingw bin subfolder or application root the application runs, but fails again on cmake execution while localize the dll files instead of .lib ...
Has anyone an idea how i could solve this issue? I would be deeply gratefull for any hint.
Best regards,
Christian












