linker - How to fix the armadillo library to c++ -
i'm using macbook program bits of code here , there. wanted in c++ armadillo library. after installation , doesn't seem work.
for instance can write arma::mat
variable, etc when run code in textmate:
vec q = randu<vec>(5); cout << normalise(q);
i error output:
"undefined symbols architecture x86_64: "_wrapper_dgesdd_", referenced from: void arma::lapack::gesdd<double>(char*, int*, int*, double*, int*, double*, double*, int*, double*, int*, double*, int*, int*, int*) in test-56d704.o ld: symbol(s) not found architecture x86_64 clang: error: linker command failed exit code 1 (use -v see invocation) rm: /var/folders/sh/vr2n15ln47j0k33yh1j0_tyw0000gn/t/test.cpp.sfz5vezn: no such file or directory
the weird thing if don't use normalise or norm functions compiles well.
i include library #include '/usr/local/include/armadillo'
edit: i've installed armadillo package both trying "brew install armadillo
" steps mentioned in readme.txt if download armadillo webpage.
edit2: in textmate added flag variables in tm_cxx_flags : -i /usr/local/include -darma_dont_use_wrapper -lblas -llapack .. seems solve problem when compiling through textmate.. can't understand how fix in xcode
edit3: found warnings when compiling...
clang: warning: -lblas: 'linker' input unused clang: warning: -llapack: 'linker' input unused clang: warning: -llapack: 'linker' input unused clang: warning: -lblas: 'linker' input unused
anyone know how add flags compiler in xcode?
i had same problem first when started program armadillo. g++ had add -larmadillo
command line option. such this
g++ -o2 -o armadillo_example armadillo_example.cpp -larmadillo
Comments
Post a Comment