编译 libpng 并将其与 netbeans 和 mingw 一起使用
我以前只使用 Visual Studio 来开发 C++,但我刚刚转向 NetBeans,并且遇到了一些问题。
我安装了 mingw,以便我的项目可以编译,但我不知道如何向其中添加外部库。我想使用静态库,而不是 dll。
我特别关注的库是 libpng
我希望这不是太 IDE具体来说,我也想知道如何准备图书馆。
Windows 操作系统。
I have only previously used visual studio for developing c++ but I've just moved to netbeans and am having some issues.
I got mingw installed so that my projects will compile but I dont know how to add external libraries to that. I want to use a static library, not a dll.
The library I specifically am looking at is libpng
I hope this isn't too IDE specific, I'm also looking to know how to prepare the library.
Windows OS.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我或多或少明白了。我使用了 cmake gui,为 msys
make
和 mingwg++ 配置
和gcc
,在 zlib 源目录中,然后在输出目录中运行 msysmake
和make install
。之后我对 libpng 做了同样的事情,但我必须添加一些变量以指向 cmake 中的 zlib include 和库目录。然后在 netbeans 中,我右键单击项目上的“属性”,并为两个库中的每一个添加了 include 和 lib 位置。我也可以将这些文件复制到我的 mingw 目录中。
现在我只是陷入这个问题。
I figured it out more or less. I used the cmake gui, configured for msys
make
and mingwg++
andgcc
, on the zlib source directory and then ran msysmake
andmake install
on the output directory. After that I did the same on libpng, but I had to add some variables to point to the zlib include and library directories within cmake.Then in netbeans, I right clicked>>properties on my project and added include and lib location for each of the two libraries. I also could have copied the files into my mingw directories.
Now I'm just stuck with this issue.