Compiling code include Eigen library needs permission

I just copy the Eigen folder to /usr/local/include according to this post, to use Eigen library.

Now to compile a simple example it needs to compile with sudo:

simple1.cpp:2:23: fatal error: /usr/local/include/Eigen/Dense: Permission denied

What's wrong? I think it should not ask for permission. Can I fix it?

Edit

I also changed the permission of folder to drwxr-xr-x and added

export LD_LIBRARY_PATH="/usr/local/include/Eigen/"

and log out once. Still, I need permission to compile.

namei -lx /usr/local/include/Eigen/Dense
f: /usr/local/include/Eigen/Dense
Drwxr-xr-x root root /
drwxr-xr-x root root usr
drwxr-xr-x root root local
drwxr-xr-x root root include
drwxr-xr-x root root Eigen
-rw-r--r-- root root Dense
6 Reset to default

Know someone who can answer? Share a link to this question via email, Twitter, or Facebook.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like