简体   繁体   English

CodeLite MinGW32 无法链接到.dll.a 文件

[英]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.我最近转移到 CodeLite 进行 C 开发,我一直在努力让 sigil 为 MinGW32 工作。 I've been trying to include it locally from the project settings using the path F:/sigil-mingw32 , where the library is located.我一直在尝试使用库所在的路径F:/sigil-mingw32从项目设置中将其包含在本地。

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.我将参数“编译器/包含路径”设置为F:/sigil-mingw32/include并将“链接器/库搜索路径”中的 linker 路径分别设置为F:/sigil-mingw32/lib

I've set my " Linker/ Libraries " to include the library "libsigil.dll.a", But when i build my project i get the output:我已经将我的“链接器/库”设置为包括库“libsigil.dll.a”,但是当我构建我的项目时,我得到了 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?为什么 linker 不包括库 dll 文件中的 .a 后缀?

Turns out that CodeLite can directly link imported libraries without having to add the full path into your linker settings.事实证明,CodeLite 可以直接链接导入的库,而无需将完整路径添加到您的 linker 设置中。 Unlike in CodeBlocks, the linker will not remove the "lib" prefix in dll.a libraries when given a direct path to the library file.与 CodeBlocks 不同,当给定库文件的直接路径时,linker 不会删除 dll.a 库中的“lib”前缀。 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.因此,而不是“path/lib/libsigil.dll.a”,仅在链接器/库搜索路径中提供库文件夹的位置,并且参数将直接传递给 gcc,其中不包括“lib”前缀。 So setting the parameter as "sigil" instead of "libsigil.dll.a" is enough.所以将参数设置为“sigil”而不是“libsigil.dll.a”就足够了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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