Makefile 在安装CLHEP期间,我遇到了一个错误,如:架构x86_64的未定义符号:
我在安装CLHEP并键入“make”时出错,如下所示:Makefile 在安装CLHEP期间,我遇到了一个错误,如:架构x86_64的未定义符号:,makefile,Makefile,我在安装CLHEP并键入“make”时出错,如下所示: Undefined symbols for architecture x86_64: "CLHEP::HepVector::num_row() const", referenced from: CLHEP::HepRandomVector::operator()() in RandomVector.cc.o ld: symbol(s) not found for architecture x86_64 clang: erro
Undefined symbols for architecture x86_64:
"CLHEP::HepVector::num_row() const", referenced from:
CLHEP::HepRandomVector::operator()() in RandomVector.cc.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make[2]: *** [lib/libCLHEP-RandomObjects-2.1.4.1.dylib] Error 1
make[1]: *** [RandomObjects/src/CMakeFiles/RandomObjects.dir/all] Error 2
make[1]: *** Waiting for unfinished jobs....
[ 99%] Building CXX object RandomObjects/src/CMakeFiles/RandomObjectsS.dir/RandomVector.cc.o
[ 99%] Built target ExceptionsS
Linking CXX static library ../../lib/libCLHEP-RandomObjects-2.1.4.1.a
[ 99%] Built target RandomObjectsS
Linking CXX executable testInstanceRestore
[ 99%] Built target testInstanceRestore
make: *** [all] Error 2
你能帮我找出问题所在吗?查看发布的解决方案
--- CLHEP/Matrix/src/Vector.cc.orig 2014-04-01 09:21:25.000000000 +0200
+++ CLHEP/Matrix/src/Vector.cc 2014-04-01 09:22:17.000000000 +0200
@@ -114,9 +114,9 @@
// trivial methods
-inline int HepVector::num_row() const {return nrow;}
-inline int HepVector::num_size() const {return nrow;}
-inline int HepVector::num_col() const { return 1; }
+int HepVector::num_row() const {return nrow;}
+int HepVector::num_size() const {return nrow;}
+int HepVector::num_col() const { return 1; }