Quantcast
Channel: Active questions tagged gcc - Stack Overflow
Viewing all articles
Browse latest Browse all 21994

Which codeblock compiler is needed to use Eigen C++?

$
0
0

Currently, I use mingw32-g++.exe (GNU GCC Compiler) for codeblock, with -std=C++14. The compiler was downloaded here: http://www.codeblocks.org/downloads/26

However, all tutorial programs here fail to compile: https://eigen.tuxfamily.org/dox/group__TutorialLinearAlgebra.html

The #include has been done correctly. Only the compute lines such as

Matrix2f x = A.ldlt().solve(b); and Matrix2f x = A.ldlt().solve(b); fails. I also tried using the Intel C++ compiler, but it still fails.

What compilers should I download to use Eigen C++ ?

Thank you very much for your help

Update1: using the "Basic linear solving" example, I get this error:

File IndexedViewHelper.h:

"undefined reference to Eigen::fix<1>", line 57

"Undefined reference to Eigen::fix<0>"

Update 2: using the second example A.ldlt().solve(b), I get this:

"[ skipping 3 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]", line 100

"[ skipping 3 instantiation contexts, use -ftemplate-backtrace-limit=0 to disable ]", line 90

...

Update 3: Full code + compiler: Literally just one main.cpp file + add eigen folder to search directories

` #include <Eigen/Dense>
using namespace std;
using namespace Eigen;
int main()
{
   Matrix2f A, b;
   A << 2, -1, -1, 3;
   b << 1, 2, 3, 1;
   cout << "Here is the matrix A:\n"<< A << endl;
   cout << "Here is the right hand side b:\n"<< b << endl;
   Matrix2f x = A.ldlt().solve(b);
   cout << "The solution is:\n"<< x << endl;
}`

Viewing all articles
Browse latest Browse all 21994

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>