LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   C++ compiler cannot create executables (solution) (https://www.linuxquestions.org/questions/linux-newbie-8/c-compiler-cannot-create-executables-solution-654337/)

DennisC31 07-08-2008 11:15 AM

C++ compiler cannot create executables (solution)
 
Just thought I would put this question out and supply the answer since I had trouble with it.

While compiling rsyncrypto-1.11, I got the error C++ compiler cannot create executables.

I hadn't installed gcc-c++ AND the extracted file was not chowned to root.

So, if you get this error, check that gcc-c++ is actually installed (rpm -qa |grep gcc) and then change rights on the source code directory (chown -R root:root <path to source directory>).

-DennisC31

trickykid 07-08-2008 11:41 AM

Yeah, usual Fedora and Red Hat installs won't include gcc, you have to specify it. Also, it's not always needed to change the source directory to root:root. Usually during compile time you're installing as root if you want the program system wide and not for an individual user account, etc.

jdines 07-08-2008 02:38 PM

NEVER compile as the root user!
 
Quote:

While compiling rsyncrypto-1.11, I got the error C++ compiler cannot create executables.
Presumably you were not compiling. You were running ./configure.

Code:

I hadn't installed gcc-c++ AND the extracted file was not chowned to root.
What extracted file?

Quote:

So, if you get this error, check that gcc-c++ is actually installed (rpm -qa |grep gcc) and then change rights on the source code directory (chown -R root:root <path to source directory>).
The first part is correct, but you should NOT be changing the source code to be owned by root. NEVER compile as the root user! You should do the autoconf, ./configure, and make as a normal user, and then do the make install, and ONLY the make install as root.


All times are GMT -5. The time now is 05:02 PM.