LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Compiling From Source Problem(g++) (https://www.linuxquestions.org/questions/linux-software-2/compiling-from-source-problem-g-140534/)

Chryzmo 01-30-2004 06:49 PM

Compiling From Source Problem(g++)
 
Heyas,

I am running Mandrake 9.2 and just came across this error when I tried to compile KMud.

checking for g++... g++
checking whether the C++ compiler (g++ -s) works... no
configure: error: installation or configuration problem: C++ compiler cannot create executables.

I then did a search on this site, but it seems most people who have an error similar to this have a problem with gcc and compiling C code. I have all the gcc-devel packages installed, however in the Software Manager I did not see anything pertaining to g++. Does anyone know how to fix this?

Thanks,
Chris

kilgoretrout 01-30-2004 07:26 PM

Run:

# rpm -qa | grep gcc

and compare your output with mine:

Code:

# rpm -qa | grep gcc
gcc-c++-3.3.1-2mdk
gcc-3.3.1-2mdk
gcc-cpp-3.3.1-2mdk
libgcc1-3.3.1-2mdk

Make sure you have all the above packages installed. I do and have no problems compiling C++ code.

Chryzmo 01-30-2004 08:25 PM

I get essentially the same thing, it is just in a different order. I guess itd not a missiong package. Could it possible be that the compiler is not configured correctly?

This is what I get:

# rpm -qa | grep gcc

gcc-c++-3.3.1-2mdk
libgcc1-3.3.1-2mdk
gcc-cpp-3.3.1-2mdk
gcc-3.3.1-2mdk

Chryzmo 01-30-2004 08:34 PM

I just tried compiling another program, a different MUD client, and I got this error:

checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
checking for g++... g++
checking whether we are using the GNU C++ compiler... no
checking whether g++ accepts -g... no
checking dependency style of g++... none
checking whether g++ supports -Wundef... no
checking whether g++ supports -Wno-long-long... no
checking whether g++ supports -Wnon-virtual-dtor... no
checking how to run the C++ preprocessor... /lib/cpp
configure: error: C++ preprocessor "/lib/cpp" fails sanity check

Perhaps, this extra information will help?

YMHiK 01-30-2004 11:37 PM

Well, what it says is that it cannot compile programs..
I've had it once on my RedHat when I somehow messed up my gcc libraries, the fix for me was to reinstall gcc.
You may try to run as root 'ldconfig' so it may fix it for you, but you may also need to reinstall all of you gcc stuf. And if you want to compile gcc yourself make sure you follow compile instructions cause it is not that simple...

Chryzmo 01-31-2004 08:20 AM

Would I be able ot just use the RPM manager and uninstall all the GCC packages, reboot, then reinstall them?

YMHiK 01-31-2004 11:52 AM

Yep, you can do it without reboot.

Make sure you can download or you have already your packages to install later.

Just use your RPM to uninstall as follows:
rpm -e --nodeps gcc-c++-3.3.1-2mdk
rpm -e --nodeps gcc-cpp-3.3.1-2mdk
rpm -e --nodeps libgcc1-3.3.1-2mdk
rpm -e --nodeps gcc-3.3.1-2mdk

Then just install you packages... rpm -ihv <package>

Pwnz3r 01-31-2004 12:01 PM

In Mandrake they have a GUI interface for RPM. I think that's what he intends to use. It doesn't require a reboot either. The most you should have to do is logout and login.


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