LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   GNU make, libboost-filesystem1.40-dev and Linux file permissions (https://www.linuxquestions.org/questions/programming-9/gnu-make-libboost-filesystem1-40-dev-and-linux-file-permissions-785017/)

aryan1 01-27-2010 02:52 AM

GNU make, libboost-filesystem1.40-dev and Linux file permissions
 
Hi All,

I am trying to compile a C++ source file into a static library using make with root priviliges (i.e., using "sudo").

However, I "sometimes" get the following compilation error:

Code:

g++ -Wall -g -fPIC -W -c /home/project/ether/src/packet-ethernet.cc
ar  -cvq libether.a /home/project/ether/src/packet-ethernet.o
ar: /home/project/ether/src/packet-ethernet.o: No such file or directory
make: *** [libether.a] Error 1

I checked /home/project/ether/src folder to see if packet-ethernet.o in fact does not exist, and saw that it is actually located there, but its owner is "root", which is different from the current user. If I change the owner of packet_ethernet.o from root to the current user using "chown" command and execute make again with sudo, everything seems to be fine.

It may be a coincidence that I recently migrated to 64-bit platform from 32-bit, and then installed libboost-filesystem1.40-dev. After that, I began to experience such errors.
I have "never" come across such a compilation error before. Even though I completely removed libboost-filesystem1.40-dev afterwards to see if it causes the problem, nothing changed.

After migrating to 64-bit and installing libboost-filesystem1.40-dev, my application exhibited another "weird" behaviour such that it produced "hidden" files using mkdir() system call, which were previously created as regular ones on the filesystem.

Can compiler options that I use cause such problems ?

OR

Is it possible that libboost-filesystem1.40-dev overwrote some system libraries so that I am getting such errors ?

Thanks.

alunduil 01-27-2010 07:50 PM

Why don't you run the make step as your user? It's only necessary to do the install as root.

Regards,

Alunduil


All times are GMT -5. The time now is 01:39 AM.