LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 01-27-2010, 02:52 AM   #1
aryan1
Member
 
Registered: Jul 2009
Posts: 50

Rep: Reputation: 16
Question 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.
 
Old 01-27-2010, 07:50 PM   #2
alunduil
Member
 
Registered: Feb 2005
Location: San Antonio, TX
Distribution: Gentoo
Posts: 684

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

Regards,

Alunduil
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
GNU Make and GNU GCC DEBUG vs RELEASE compiler options aryan1 Programming 1 01-12-2010 12:29 PM
GNU Make and Linux file permissions aryan1 Programming 14 01-12-2010 03:02 AM
How are you able to compile libraries as "-dev" (i.e. libboost-devel) guille4ty Linux - Software 2 07-22-2008 06:51 PM
why file permissions in /dev/ files reset to root after every reboot engekay69 Linux - Newbie 2 04-16-2008 12:23 PM
LXer: File permissions in GNU/Linux LXer Syndicated Linux News 0 11-30-2007 05:10 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 01:46 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration