MinGW的库问题 [英] MinGW libraries issues

查看:93
本文介绍了MinGW的库问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在从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 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆