MinGW的库问题 [英] MinGW libraries issues
问题描述
在从Linux的移植一个C项目到Windows的过程
In the process of porting a C project from Linux to Windows
已经安装的MinGW
Have installed MinGW
编译使用的Makefile我的共享库
Have compiled my shared library using a Makefile
这产生 libExample.so
现在我想这个共享库链接到测试工具,所以我可以看到,如果一切都按预期工作。
Now I'm trying to link this shared library to a test harness so I can see if everything is working as expected
在线束的Makefile我指定库的位置,例如 -LE:/ libExample_dir
和库的名称 -lExample
In the harness Makefile I specify the location of the library, e.g. -LE:/libExample_dir
and the name of the library -lExample
但它的抱怨无法找到,也就是连接与失败找不到-lExample库
- 有没有提供关于Windows中的一些差异的.so ,我很想念
和的.dll
或者路径名?
but its complaining it cannot find the library, i.e. linker is failing with cannot find -lExample
- is there some difference with windows regarding .so
and .dll
or perhaps pathnames that I am missing?
推荐答案
使用MinGW的编译C code生成一个共享库,请记住输出从 libExample.so $重命名C $ C>为
libExample.dll
否则,链接器将无法找到您的库
Using MinGw to compile C code to produce a shared library, remember to rename the output from libExample.so
to libExample.dll
otherwise the linker will fail to find your library
这篇关于MinGW的库问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!