使用 GMP 设置 Netbeans,如何指定编译选项?
Setting up Netbeans with GMP, how to specify compile options?
我正尝试在 Windows 上的 Netbeans 中使用 GMP。构建失败给出输出:
cd 'C:\Users\dev1\Documents\NetBeansProjects\Simple Test'
C:\MinGW\msys.0\bin\make.exe -f Makefile CONF=Debug
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/dev1/Documents/NetBeansProjects/Simple Test'
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/simple_test.exe
make.exe[2]: Entering directory `/c/Users/dev1/Documents/NetBeansProjects/Simple Test'
mkdir -p dist/Debug/MinGW-Windows
g++ -o dist/Debug/MinGW-Windows/simple_test build/Debug/MinGW-Windows/main.o
build/Debug/MinGW-Windows/main.o: In function `ZN17__gmp_binary_plus4evalEP12__mpz_structPKS0_m':
c:/mingw/include/gmpxx.h:196: undefined reference to `__gmpz_add_ui'
build/Debug/MinGW-Windows/main.o: In function
c:/mingw/include/gmpxx.h:1497: undefined reference to `__gmpz_init'
//...same thing
collect2.exe: error: ld returned 1 exit status
make.exe[2]: *** [dist/Debug/MinGW-Windows/simple_test.exe] Error 1
make.exe[2]: Leaving directory `/c/Users/dev1/Documents/NetBeansProjects/Simple Test'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/dev1/Documents/NetBeansProjects/Simple Test'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
下面是我在Netbeans中修改的设置,猜猜错误在哪里
如何让 GMP 工作以便在我的源代码中使用它?
这绝对是 Netbeans 上的设置,因为我可以使用 g++ test.cpp -o test.exe -lgmpxx -lgmp
从命令行编译它
从 mathGl / MinGW undefined reference Netbeans IDE
得到这个答案
右键单击项目并转到属性
在左窗格中 select 链接器
单击库旁边的“...”
点击“添加选项”
select“其他选项”并输入 -lgmpxx -lgmp
点击确定
现在应该看到...
我正尝试在 Windows 上的 Netbeans 中使用 GMP。构建失败给出输出:
cd 'C:\Users\dev1\Documents\NetBeansProjects\Simple Test'
C:\MinGW\msys.0\bin\make.exe -f Makefile CONF=Debug
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make.exe[1]: Entering directory `/c/Users/dev1/Documents/NetBeansProjects/Simple Test'
"/C/MinGW/msys/1.0/bin/make.exe" -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/simple_test.exe
make.exe[2]: Entering directory `/c/Users/dev1/Documents/NetBeansProjects/Simple Test'
mkdir -p dist/Debug/MinGW-Windows
g++ -o dist/Debug/MinGW-Windows/simple_test build/Debug/MinGW-Windows/main.o
build/Debug/MinGW-Windows/main.o: In function `ZN17__gmp_binary_plus4evalEP12__mpz_structPKS0_m':
c:/mingw/include/gmpxx.h:196: undefined reference to `__gmpz_add_ui'
build/Debug/MinGW-Windows/main.o: In function
c:/mingw/include/gmpxx.h:1497: undefined reference to `__gmpz_init'
//...same thing
collect2.exe: error: ld returned 1 exit status
make.exe[2]: *** [dist/Debug/MinGW-Windows/simple_test.exe] Error 1
make.exe[2]: Leaving directory `/c/Users/dev1/Documents/NetBeansProjects/Simple Test'
make.exe[1]: *** [.build-conf] Error 2
make.exe[1]: Leaving directory `/c/Users/dev1/Documents/NetBeansProjects/Simple Test'
make.exe": *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 2s)
下面是我在Netbeans中修改的设置,猜猜错误在哪里
如何让 GMP 工作以便在我的源代码中使用它?
这绝对是 Netbeans 上的设置,因为我可以使用 g++ test.cpp -o test.exe -lgmpxx -lgmp
从 mathGl / MinGW undefined reference Netbeans IDE
得到这个答案右键单击项目并转到属性
在左窗格中 select 链接器
单击库旁边的“...”
点击“添加选项”
select“其他选项”并输入
-lgmpxx -lgmp
点击确定
现在应该看到...