1

I have integrated Armadillo into my working environment, following the steps as listed here: How to link Armadillo with Eclipse

I am trying to run this simple code:

#include <iostream>
#include <armadillo>

using namespace std;
using namespace arma;

int main()
{
    mat A = randu<mat>(4, 5);
    mat B = randu<mat>(4, 5);
    cout << A*B.t() << endl;
    return 0;
}

I am compiling with the Mingw G++ compiler and everytime I get the following error:

 ***20:45:00 **** Rebuild of configuration Debug for project Trying Armadillo     ****
 Info: Internal Builder is used for build
 g++ "-ID:\\C++ Development\\armadillo-7.800.0\\include" -O0 -g3 -Wall -c -fmessage-length=0 -o TryNow.o "..\\TryNow.cpp" 
 g++ "-LD:\\C++ Development\\armadillo-7.800.0\\examples\\lib_win64" -o "Trying Armadillo.exe" TryNow.o -llapack_win64_MT -lblas_win64_MT 
 D:\C++ Development\armadillo-7.800.0\examples\lib_win64/blas_win64_MT.lib: error adding symbols: File in wrong format
 collect2.exe: error: ld returned 1 exit status***

The same library works wonderfully with the Microsoft Visual Studio, 2015. Is it an eclipse issue that is bugging me?

Community
  • 1
  • 1
  • "blas_win64_MT.lib" Looks like you are loading visual studio libraries into the GCC linker backing Eclipse. Solution: Recompile library for GCC or find precompiled GCC library. – user4581301 Feb 21 '17 at 02:54
  • Thanks a lot for the fast response. I started with C++ a couple of days back and wish to know how to compile a library with gcc. Thanks. – Bodhisatta Pramanik Feb 21 '17 at 03:09
  • Ayyyiii. That can be a tough one for a complex software project. For Armadillo hope the writers give you instructions or a build script. – user4581301 Feb 21 '17 at 03:18
  • Get the precompiled version from the [OpenBLAS](http://xianyi.github.io/OpenBLAS/) project -- see the Binary Packages section. It's a very fast version of both BLAS and LAPACK. I think they compile it with MinGW. – mtall Feb 23 '17 at 02:53

0 Answers0