Netbeans和MinGW的-W64Netbeans、MinGW

由网友(骨子透傲气的小女人)分享简介:我想对WIN7 64位配置我的NetBeans,以及与MinGW-W64工作。所以我把在%PATH%变量编译器的以下路径:C:\ MinGW的-W64-bin_i686 \ MinGW的\ BIN C:\ MinGW的-MSYS \ MSYS \ BIN C:\ MinGW的-W64-bin_i686 \ li...

我想对WIN7 64位配置我的NetBeans,以及与MinGW-W64工作。 所以我把在%PATH%变量编译器的以下路径: C: MinGW的-W64-bin_i686 MinGW的 BIN C: MinGW的-MSYS MSYS BIN C: MinGW的-W64-bin_i686 libexec目录 GCC x86_64的-W64-的mingw32 4.7.0

I'm trying to configure my NetBeans on win7 64bit, to work with the MinGW-w64. So I put in the %PATH% variable the following paths of the compiler: C:mingw-w64-bin_i686mingwbin C:minGw-MSYSmsysbin C:mingw-w64-bin_i686libexecgccx86_64-w64-mingw324.7.0

然后我打开NetBeans和这是配置:

Then I opened NetBeans and this was configured:

我试着编译一个小测试程序,但我收到此错误:

I tried to compile a little test program but I received this error:

G ++ EXE:致命错误: - 保险丝连接体 - 插件,但liblto_plugin-0.dll不   发现编译终止。使[2]: *   [测距/调试/ MinGW的Windows的/ test.exe的]错误1请 1 : [.build设置]   错误2化妆:* 的* [.build-implement执行]错误2

g++.exe: fatal error: -fuse-linker-plugin, but liblto_plugin-0.dll not found compilation terminated. make[2]: * [dist/Debug/MinGW-Windows/test.exe] Error 1 make1: [.build-conf] Error 2 make: ** [.build-impl] Error 2

BUILD失败(退出值2,总时间:1秒)

BUILD FAILED (exit value 2, total time: 1s)

我有这个文件位于C: MinGW的-W64-bin_i686 libexec目录 GCC x86_64的-W64-的mingw32 4.7.0

I do have this file in C:mingw-w64-bin_i686libexecgccx86_64-w64-mingw324.7.0

我在想什么?

推荐答案

右,后的个月把这一关,我终于坐了下来,做它的。我可能会做出对我的博客有pretty的图片更详细的文章,但这里是修剪下来,版本,希望这将是够你(和其他人),以获得与去。

Right, after months of putting this off I've finally sat down and done it. I'll probably make a more detailed post on my blog with pretty pictures but here is a trimmed down SO version which will hopefully be enough for you (and everyone else) to get going with.

删除MinGW的,MSYS和CMake的,如果你有他们,都不能失去他们(我们将重新安装MinGW的(OBV)和MSYS但CMake的,因为它似乎没有必要。)

Remove MinGW, MSYS and CMake if you have them and can afford to lose them (we will reinstall MinGW (obv.) and MSYS but not CMake as it doesn't appear to be needed.)

在Netbeans的或其他合适的IDE 在64位的Windows。 EnvMan (可选的,但方便的用于管理Windows环境 变量。) Netbeans or other suitable IDE 64bit Windows. EnvMan (optional but handy for managing Windows Environment variables.)

的MinGW-W64 C编译器和MSYS

MinGW-W64 C compiler and MSYS

在下载和安装的MinGW-W64 http://mingw-w64.sourceforge.net/ (链接在左侧菜单中有 超链接称为WIN64下载。) 有很多,可以是一个有点复杂的版本。我们 使用MinGW-W64-bin_i686-mingw_20111220去(虽然这些数字 末可以是不同的),其基本上说,我们所需的版本 与Windows二进制文件。 一旦下载完成后(约300MB那么10分钟左右)解压到 C: MinGW的-W64或相似。 确保没有任何空间的 道路! Download and install MinGW-W64 http://mingw-w64.sourceforge.net/ (link is on the left menu with a hyperlink called 'WIN64 Downloads'.) There are a lot of versions which can be a bit complicated. We are going with mingw-w64-bin_i686-mingw_20111220 (although the numbers at the end may be different) which basically says we want the version with the windows binaries. Once the download is complete (about 300mb so 10min or so) extract to C:MinGW-W64 or similar. Make sure there aren't any spaces in the path! 在采取了一些搜索 http://sourceforge.net/apps/trac/mingw-w64/wiki/MSYS 是维基的 并 http://sourceforge.net/projects/mingw-w64/files/External%20binary%20packages%20%28Win64%20hosted%29/MSYS%20%2832-bit%29/ 是,我发现下载和我去的版本是 MSYS-20111123 一旦下载完成文件解压到C:或MSys的 类似。 确保没有任何空格的路径! Took a bit of searching http://sourceforge.net/apps/trac/mingw-w64/wiki/MSYS is the wiki for it and http://sourceforge.net/projects/mingw-w64/files/External%20binary%20packages%20%28Win64%20hosted%29/MSYS%20%2832-bit%29/ is where I found the download and the version I went with was MSYS-20111123 Once the download is complete extract the files to C:MSys or similar. Make sure there aren't any spaces in the path! 添加C: MinGW的-W64 BIN'。到Windows PATH变量 添加C: MSys的 MSYS BIN'。到Windows PATH变量 启动Netbeans和去工具 - >选项 - > C / C ++。 单击添加,在工具集合,选择的基本目录 MinGW的-W64。(C: MinGW的-W64 BIN) 选择MinGW的从工具集合系列如果不是 自动检测并点击确定。 将C编译器C: MinGW的-W64 BIN x86_64的-W64-的mingw32-gcc.exe 将C ++编译器C: MinGW的-W64 BIN x86_64的-W64-的mingw32-G ++ EXE 将make命令到C: MSys的 MSYS BIN make.exe Add 'C:MinGW-W64bin' to your Windows PATH variable. Add 'C:MSysmsysbin' to your Windows PATH variable. Start Netbeans and go to Tools -> Options -> C/C++. Click 'Add' under 'Tool Collection' and select the base directory of MinGW-W64 (C:MinGW-W64bin). Select 'MinGW' from 'Tool Collection Family' if it isn't auto-detected and click 'OK'. Set the 'C Compiler to C:MinGW-W64binx86_64-w64-mingw32-gcc.exe. Set the 'C++ Compiler to C:MinGW-W64binx86_64-w64-mingw32-g++.exe. Set the 'Make Command' to C:MSysmsysbinmake.exe.

这应该是它!

我要指出,我现在用的系统编译库文件是通过JNI的使用等都有为我错过了,因为他们没有在这里需要一些额外的步骤。不过,我做了一个快速的'Hello World程序,并将其编译并很好地运行。

I should note that I am using the system to compile a library file to be use via JNI so have some additional steps for that which I missed out as they weren't needed here. However I made a quick 'Hello World' program and it compiled and ran nicely.

编程快乐!

阅读全文

相关推荐

最新文章