Compiling c++ with Armadillo library at NeatBeans

I am going to compile C++ program which contains Armadillo library.
This issue is feasible via command line with this command:

g++ '/arm.cpp' -o example -O1 -larmadillo

But when I add -O1 -larmadillo to the compile options of my NetBeans project I get a considerable amount of errors.
Compiler errors? Linker errors? Runtime errors?
I got these errors

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/atx/NetBeansProjects/armadillo'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/armadillo
make[2]: Entering directory `/home/atx/NetBeansProjects/armadillo'
mkdir -p dist/Debug/GNU-Linux-x86
g++ -O3    -o dist/Debug/GNU-Linux-x86/armadillo build/Debug/GNU-Linux-x86/main.o  
build/Debug/GNU-Linux-x86/main.o: In function `gemv<double>':
/usr/include/armadillo_bits/blas_wrapper.hpp:79: undefined reference to `wrapper_dgemv_'
/usr/include/armadillo_bits/blas_wrapper.hpp:79: undefined reference to `wrapper_dgemv_'
/usr/include/armadillo_bits/blas_wrapper.hpp:79: undefined reference to `wrapper_dgemv_'
/usr/include/armadillo_bits/blas_wrapper.hpp:79: undefined reference to `wrapper_dgemv_'
build/Debug/GNU-Linux-x86/main.o: In function `gemm<double>':
/usr/include/armadillo_bits/blas_wrapper.hpp:114: undefined reference to `wrapper_dgemm_'
/usr/include/armadillo_bits/blas_wrapper.hpp:114: undefined reference to `wrapper_dgemm_'
/usr/include/armadillo_bits/blas_wrapper.hpp:114: undefined reference to `wrapper_dgemm_'
/usr/include/armadillo_bits/blas_wrapper.hpp:114: undefined reference to `wrapper_dgemm_'
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux-x86/armadillo] Error 1
make[2]: Leaving directory `/home/atx/NetBeansProjects/armadillo'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/atx/NetBeansProjects/armadillo'
make: *** [.build-impl] Error 2


BUILD FAILED (exit value 2, total time: 136ms)


This is most likely caused by a previous version of Armadillo interfering with a new version.

I recommend to first remove the previous version, which includes removing the run-time library (it lives either in /usr/lib/, /usr/lib64/, /usr/local/lib, /usr/local/lib64). Then install a freshly downloaded version from:
http://arma.sourceforge.net/download.html

If the errors you're getting still persist, edit "include/armadillo_bits/config.hpp" (make sure you're editing the installed file, which might be in /usr/include or /usr/local/include) and comment out ARMA_USE_WRAPPER. Then link with -llapack -lblas instead of -larmadillo.

Topic archived. No new replies allowed.