简体   繁体   中英

CodeLite MinGW32 cannot link to .dll.a file

I've recently moved over to CodeLite for C development, and i've been trying to get sigil to work for MinGW32. I've been trying to include it locally from the project settings using the path F:/sigil-mingw32 , where the library is located.

I have the parameter " Compiler/ Include Paths " set to F:/sigil-mingw32/include And my linker path in " Linker/ Libraries Search Path " set to F:/sigil-mingw32/lib respectively.

I've set my " Linker/ Libraries " to include the library "libsigil.dll.a", But when i build my project i get the output:

c:/Program Files (x86)/mingw-w64/i686-8.1.0-posix-dwarf-rt_v6-rev0/mingw32/bin/../lib/gcc/i686-w64-mingw32/8.1.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -l-libsigil.dll

And then the build fails. Why is the linker excluding the.a suffix from the library dll file?

Turns out that CodeLite can directly link imported libraries without having to add the full path into your linker settings. Unlike in CodeBlocks, the linker will not remove the "lib" prefix in dll.a libraries when given a direct path to the library file. So instead of "path/lib/libsigil.dll.a" Only the location of the library folder is provided in Linker/Libraries Search Path and the Libraries parameter will be passed to gcc directly, which excludes the "lib" prefix. So setting the parameter as "sigil" instead of "libsigil.dll.a" is enough.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM