Search code examples
xcodec++11eigen

How to set search paths in Xcode for Eigen library


I am a new one who just gets started using Xcode. I have set the Header files path and the library files path, however, I cannot use the following coding.

using namespace Eigen;

I am not sure where the problem is. Thank you, everyone! enter image description here


Solution

  • The directive using namespace Eigen; does not import the Eigen project into your code, but rather allows you to type MatrixXd instead of Eigen::MatrixXd. When you type #include <Eigen/Dense> you actually insert the file Dense into your code at that point, effectively importing the Eigen project into your directory. The file Dense is just a regular text file. On your computer it's located at /usr/local/Cellar/eigen/3.3.4/include/eigen3/Eigen/Dense. Open it in a text editor to see what it looks like.