当在一个__gmpz_set_str()中调用NS3时,我得到了以下错误:
未定义的对__gmpz_set_str collect2的引用:错误: ld返回1退出状态
我已经包括了#include <gmpxx.h>,我还安装了libgmp3-dev和libgmp-dev。
有什么想法吗?这是到waf:https://github.com/nsnam/ns-3-dev-git/blob/master/waf的链接和wscript:https://github.com/nsnam/ns-3-dev-git/blob/master/wscript的链接。
# This is the make file content:
#Makefile wrapper for waf
all:
./waf
#free free to change this part to suit your requirements
configure:
./waf configure --enable-examples --enable-tests
build:
./waf build
install:
./waf install
clean:
./waf clean
distclean:
./waf distclean发布于 2021-07-22 17:55:45
编译标志需要在配置时设置,因此正确的咒语是:
LDFLAGS=-lgmp ./waf configure现在,您可以简单地运行./waf来构建整个代码库,并且将使用-lgmp标志。如果您真的想使用make(1),那么
LDFLAGS=-lgmp make configure应该也能工作,但是我建议直接使用waf,因为它是实际的构建系统,而不是make。
发布于 2021-07-19 10:08:52
https://stackoverflow.com/questions/68437605
复制相似问题