gpt4 book ai didi

c++ - 使用 GMP 设置 Netbeans,如何指定编译选项?

转载 作者:行者123 更新时间:2023-11-30 04:54:26 25 4
gpt4 key购买 nike

我正在尝试在 Windows 上的 Netbeans 中使用 GMP。构建失败给出输出:

cd 'C:\Users\dev1\Documents\NetBeansProjects\Simple Test'
C:\MinGW\msys\1.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中修改的设置,猜猜错误在哪里

project properites

如何让 GMP 工作以便在我的源代码中使用它?

这绝对是 Netbeans 上的设置,因为我可以使用 g++ test.cpp -o test.exe -lgmpxx -lgmp

从命令行编译它

最佳答案

mathGl / MinGW undefined reference Netbeans IDE 得到这个答案

  1. 右键单击项目并转到属性

  2. 在左 Pane 中选择链接器

  3. 单击库旁边的“...”

  4. 点击“添加选项”

  5. 选择“其他选项”并输入 -lgmpxx -lgmp

  6. 点击确定

    现在应该看到... Netbeans

关于c++ - 使用 GMP 设置 Netbeans,如何指定编译选项?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53592657/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com