Hi,
I just installed Lenny in “server” configuration. I am building a simple C++ program with a makefile and it works file, IF I am root. If not, I get the following error and output:
g++ -Wall -std=c++0x -g -O0 -o gorillas gorillas.cpp
gorillas.cpp:1: fatal error: can’t open /tmp/ccrkCbcb.s for writing: Permission denied
compilation terminated.
make: *** [gorillas] Error 1
the permissions on /tmp/ are as follows:
drwxrwxrwt 6 root root 4096 2011-03-13 00:00 tmp
Any idea what I’m doing wrong?
Thanks
Ean
Gary
[ Editor ]
As your non root user (I’ll use the name someuser in this answer, adjust as appropriate)
mkdir /home/someuser/tmp;The gcc documentation has a section on Environment Variables, which is worth a read.
export TMPDIR=/home/someuser/tmp;
g++ -Wall -std=c++0x -g -O0 -o gorillas gorillas.cpp
Compiling in some VPS environments and in small form environments, where space is limited is sometimes best done, by you manually specifying TMPDIR before compiling.