gpt4 book ai didi

c++ - NAG库Mark 26编译

转载 作者:行者123 更新时间:2023-12-02 10:59:36 26 4
gpt4 key购买 nike

我以前有NAG C库Mark 23,并且以前通过

g++ -std=c++11  -lm file.cpp -o output.o -I/opt/NAG/clmi623dgl/include 
/opt/NAG/clmi623dgl/lib/libnagc_nag.a -L/opt/NAG/clmi623dgl/lib -lpthread

一切都很好。现在,我正在使用NAG Mark 26,并且尝试使用
g++ -std=c++11  -lm file.cpp -o output.o -I/Users/user/NAG/clmi626ddl/include 
-L/Users/user/NAG/clmi626ddl/lib -lpthread
/Users/user/NAG/clmi626ddl/lib/libnagc_mkl.a
/Users/user/NAG/clmi626ddl/lib/libnagc_nag.a

但是我收到错误
Undefined symbols for architecture x86_64:
"_CFDictionarySetValue", referenced from:
_Ff75173be03ba8abe1a864da3d5eb72fd in libnagc_mkl.a(p01zzfn.o)
"_CFNumberCreate", referenced from:
_Ff75173be03ba8abe1a864da3d5eb72fd in libnagc_mkl.a(p01zzfn.o)

...

ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see
invocation)

要使用NAG mark 26进行正确编译,我该怎么做?

最佳答案

我在文件夹NAG/clmi626ddl/scripts中找到了解决方案:

对于英特尔编译器:

icpc -I/Users/user/NAG/clmi626ddl/include 
/Users/user/NAG/clmi626ddl/lib/libnagc_nag.a -framework IOKit
-framework CoreFoundation /Users/user/NAG/clmi626ddl/rtl/libifcoremt.a
-lpthread -lc++ -lm file.cpp -o file.o -std=c++11 -O3 -lm

对于c
clang -I/Users/user/NAG/clmi626ddl/include
/Users/user/NAG/clmi626ddl/lib/libnagc_nag.a -framework IOKit
-framework CoreFoundation /Users/user/NAG/clmi626ddl/rtl/libifcoremt.a
/Users/user/NAG/clmi626ddl/rtl/libimf.a
/Users/user/NAG/clmi626ddl/rtl/libirc.a
/Users/user/NAG/clmi626ddl/rtl/libsvml.a -lpthread -lm -lstdc++

关于c++ - NAG库Mark 26编译,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/47146057/

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