0

I cannot seem to get Eigen 3.4.0 running in VS2010.

This is supposed to be so easy, but I cannot manage to do it.

  1. I downloaded the latest Eigen library, version 3.4.0, and unpacked the zip file.
  2. I opened VS2010, started a New Project --> Empty Project.
  3. Then I dragged the folder Eigen from eigen-3.4.0 onto the Project in Solution Explorer in VS2010.
  4. This resulted in the .h files being loaded into the Header Files folder in the Solution Explorer.
  5. I created a new .cpp file in the Source Files folder of the solution, with a very simple test script. (How to use Eigen in a C++ program?)
  6. I added the Eigen folder to the Include paths: Solution Explorer --> Right-click on Solution --> Properties --> Configuration Properties --> VC++ Directories --> Include Directories --> added D:\my folder\testingEigen\eigen-3.4.0\
  7. Also added this path to C/C++ --> General --> Additional Include Directories; then applied the changes.
  8. I did this for both the default setting of Win32 (Platform) as well as x64, both using Debug.
  9. I cannot compile successfully, the errors I get are as follows:
Error   1   error C2059: syntax error : 'identifier'    d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\util\Meta.h    755
Error   2   error C2039: 'rint' : is not a member of '`global namespace''   d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\MathFunctions.h    552
Error   3   error C3861: 'rint': identifier not found   d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\MathFunctions.h    552
Error   4   error C2039: 'rintf' : is not a member of '`global namespace''  d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\MathFunctions.h    560
Error   5   error C3861: 'rintf': identifier not found  d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\MathFunctions.h    560
Error   7   error C2039: 'rintf' : is not a member of '`global namespace''  d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\Half.h    730
Error   8   error C3861: 'rintf': identifier not found  d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\Half.h    730
Error   9   error C2039: 'roundf' : is not a member of '`global namespace'' d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\Half.h    733
Error   10  error C3861: 'roundf': identifier not found d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\Half.h    733
Error   12  error C2039: 'signbit' : is not a member of 'std'   d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    251
Error   13  error C3861: 'signbit': identifier not found    d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    251
Error   14  error C2039: 'signbit' : is not a member of 'std'   d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    286
Error   15  error C3861: 'signbit': identifier not found    d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    286
Error   16  error C2039: 'isinf' : is not a member of 'std' d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    477
Error   17  error C2873: 'isinf' : symbol cannot be used in a using-declaration d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    477
Error   18  error C2664: 'Eigen::bfloat16_impl::isinf' : cannot convert parameter 1 from 'float' to 'const Eigen::bfloat16 &'   d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    478
Error   19  error C2039: 'isnan' : is not a member of 'std' d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    481
Error   20  error C2873: 'isnan' : symbol cannot be used in a using-declaration d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    481
Error   21  error C2664: 'Eigen::bfloat16_impl::isnan' : cannot convert parameter 1 from 'float' to 'const Eigen::bfloat16 &'   d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    482
Error   22  error C2039: 'rintf' : is not a member of '`global namespace''  d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    562
Error   23  error C3861: 'rintf': identifier not found  d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    562
Error   24  error C2039: 'roundf' : is not a member of '`global namespace'' d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    565
Error   25  error C3861: 'roundf': identifier not found d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    565
Error   26  error C2039: 'fminf' : is not a member of '`global namespace''  d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    585
Error   27  error C3861: 'fminf': identifier not found  d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    585
Error   28  error C2039: 'fmaxf' : is not a member of '`global namespace''  d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    590
Error   29  error C3861: 'fmaxf': identifier not found  d:\my folder\testingeigen\eigen-3.4.0\eigen\src\Core\arch\Default\BFloat16.h    590

Now for Error 1, it seems to be a leftover issue maybe:

Code for error 1

Wildly guessing it is not important for what I want to use Eigen for, I have commented it out, but Error 2 and following still remain, for which the code is:

code for error 2

13
  • 1
    Step 3 is wrong. Eigen is not part of your project, it's a third party library. The way to handle third party libraries is to install them where they want to be installed and then tell your project where you installed them, not copy them into your project. Commented Oct 11, 2024 at 5:05
  • 3
    What version of C++ are you compiling for? Please also show the code you are compiling. Also don't show screen shots of code, include all code as text in the question. Commented Oct 11, 2024 at 5:38
  • 4
    Just noticed that you are using VS2010. That is very old, that's probably the issue here. Time to upgrade. Commented Oct 11, 2024 at 5:39
  • 1
    VS2010 ??? Wow, why not upgrade so you can use vcpkg instead? Commented Oct 11, 2024 at 5:45
  • 1
    You will most likely have to install an old version of this library. You can't use a modern version with a 14+ year old compiler. Also remember that before VS 2015 the msvc compiler was incompatible across major versions. You likely can't use compiled binaries from any compiler other compiler version. Commented Oct 11, 2024 at 12:35

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.