Netbeans C ++使用MinGW和libnoise库 [英] Netbeans C++ using MinGW and the libnoise library

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

问题描述

使用netbeans 7.2和最新版本的MinGW(使用安装程序)我无法使用libnoise库。我正确地包括头文件,自动完成确认这一点,但是库简直不工作。有一个.lib文件和一个.dll。我试过了所有可能的组合添加他们在项目>属性>构建>链接器以及将.dll放在基本项目目录中。尽管所有这些,我仍然得到未定义的引用错误,当我尝试和运行代码。

Using netbeans 7.2 and the most recent version of MinGW (using installer) I can't use the libnoise library. I am properly including the header files, the auto completion confirms this, however the library is simply not working. There is a .lib file and a .dll. I have tried every possible combination of adding them under project > properties > Build > Linker as well as putting the .dll in the base project directory. Despite all this I am still getting undefined reference errors whenever I try and run the code. Does anyone know what to do?

推荐答案

我知道可以链接导入库文件(* .lib)和MinGW ,但我仍然建议重新编译libnoise。

I know that it is possible to link import library files (*.lib) with MinGW, but I still suggest to recompile libnoise.

对于当前的Makefile,这不是很容易,可能会中断。因此,我写了一个CMake脚本,它不仅在Windows上工作,但应该在所有支持CMake的平台上工作。除此之外,我已经清理了目录结构。代码本身没有被触及,当你建立一个库,它应该基本上与当前一样。

With the current Makefile, this is not very easy and may break. Thus I've written a CMake script, which doesn't only work on Windows, but should work on all CMake supported platforms. In addition to this, I've cleaned up the directory structure. The code itself hasn't been touched and when you build a library it should essentially be the same as the current one.

libnoise on GitHub

构建完共享库后, code> libnoise.dll.a 和 libnoise.dll 文件。然后,将 libnoise.dll.a 添加到链接设置,并将DLL本身放在二进制文件或工作目录旁边。

After you've built your shared library, you'll have a libnoise.dll.a and libnoise.dll file. You then add libnoise.dll.a to the linking settings and put the DLL itself next to the binary, or in the working directory.

这篇关于Netbeans C ++使用MinGW和libnoise库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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