Click to See Complete Forum and Search --> : help compiling tarball


ciphrix
08-08-2002, 12:32 AM
Ugh,

This is my first attempt to compile a tarball and I need help...

I'm trying to install a program called napshare.

I downloaded the tar.gz file, I extracted the tarball, changed into the directory it created, ran ./configure and that's when I got the error...

"checking whether the C compiler (gcc ) works... no
configure: error: installation or configuration problem: C compiler cannot create executables"

I have no idea what this means. I would paste more from the terminal window but I don't know how to copy and paste from the terminal. :(

If you need more info just ask and I will try to answer, bare with me, I'm a hardcore Linux n00b who is learning bit by bit.

endoalpha
08-08-2002, 12:51 AM
Do you have gcc installed? In mandrake try :: urpmi gcc and see whats up. In mandrake 8.x i think the most stable compiler is gcc-2.96.xxx.

ciphrix
08-08-2002, 01:08 AM
I have no idea what that is. I just installed Mandrake from whatever was on the CDs. I didn't add any other programs or anything yet (because I don't know how to!) so if it didn't come with the distro then I guess I don't have it. How would I find out if I have it or not?

ciphrix
08-08-2002, 01:32 AM
Hmm, well it looks like I have it. I typed rpm -q gcc and got this response: gcc-2.96-0.76mdk

I also checked the config.log and this is what it said:

configure:806: checking for c++
configure:838: checking whether the C++ compiler (c++ ) works
configure:854: c++ -o conftest conftest.C 1>&5
c++: installation problem, cannot exec `cpp0': No such file or directory
configure: failed program was:

#line 849 "configure"
#include "confdefs.h"

int main(){return(0);}

I don't know if that helps any. I still don't know what's going on. :confused:

So now what?

endoalpha
08-08-2002, 04:39 AM
try ./configure --help.. read through it. It may say something about setting your compiler to gcc.
Was there a README in the tarball? or INSTALL? what did they say?

ciphrix
08-08-2002, 01:12 PM
I tried ./configure --help but found nothing that looked like it would solve the compiling issue. I opened the README file but it was blank... I found the following in the INSTALL file but I can't make much sense of it:

Compilers and Options
=====================

Some systems require unusual options for compilation or linking that
the `configure' script does not know about. You can give `configure'
initial values for variables by setting them in the environment. Using
a Bourne-compatible shell, you can do that on the command line like
this: CC=c89 CFLAGS=-O2 LIBS=-lposix ./configure

Or on systems that have the `env' program, you can do it like this:
env CPPFLAGS=-I/usr/local/include LDFLAGS=-s ./configure

mingshun
08-08-2002, 05:01 PM
Originally posted by ciphrix

configure:806: checking for c++
configure:838: checking whether the C++ compiler (c++ ) works
configure:854: c++ -o conftest conftest.C 1>&5
c++: installation problem, cannot exec `cpp0': No such file or directory


Try "c++ --version" and look for error messages.

If not, you could have downloaded a corrupted tarball.

ciphrix
08-08-2002, 05:46 PM
When I typed "c++ --version" I got the response: 2.96

I don't think it's a corrupt tarball because I downloaded a different app and that's giving me the same error.

mingshun
08-08-2002, 06:00 PM
Originally posted by ciphrix
When I typed "c++ --version" I got the response: 2.96

I don't think it's a corrupt tarball because I downloaded a different app and that's giving me the same error.

Hmmm, strange.
I got a stupid idea :p

You know how to write a "helloworld C++" program?
If yes, use pico to write it and do "gcc -o hello helloworld.c" to see if it can create executable.

ciphrix
08-08-2002, 06:10 PM
You know how to write a "helloworld C++" program?

No, but if you write it out and explain it to me I'll be more then happy to give it a try! :)

ciphrix
08-09-2002, 01:24 PM
I did "echo $PATH" and found that my path is as follows:

/bin:/usr/bin:/usr/X11R6/bin:/usr/local/bin:/usr/games:/usr/lib/jre-1.3.1_02/bin:/home/ciphrix/bin

my gcc files are located in the following directory:

/usr/lib/gcc-lib/i586-mandrake-linux-gnu/2.96



would that possibly cause the error?

mingshun
08-09-2002, 06:01 PM
Originally posted by ciphrix


No, but if you write it out and explain it to me I'll be more then happy to give it a try! :)

On the xterm (that tv-like icon), type "cat > helloworld.cpp" without quotes and then (without that "code"):


main(){}

CTRL-D


Compile it by "c++ -o helloworld helloworld.cpp".

I'm testing this because your errors says "c++ installation problem". Maybe you should test your gcc too :p

i.e:
cat > helloworld2.c


main(){}

CTRL-D


Compile it by "gcc -o helloworld2 helloworld2.c".

ciphrix
08-09-2002, 06:18 PM
Alright, I did everything you said and after I typed c++ -o helloworld helloworld.cpp I got this:

c++: installation problem, cannot exec `cpp0': No such file or directory

which is the same thing that appeared in the config.log

mingshun
08-09-2002, 11:28 PM
[QUOTE]Originally posted by ciphrix
Alright, I did everything you said and after I typed c++ -o helloworld helloworld.cpp I got this:

c++: installation problem, cannot exec `cpp0': No such file or directory
[/quote[

Wow! This is serious. I think you got a corrupted installation. Where did you see this 'cpp0'? Straight after the command? I wanted to get the confirmation before jummping to conclusions. Honestly, I don't know how to solve this.

Next better player please :p

ciphrix
08-09-2002, 11:56 PM
Alright, I solved the whole compiling error problem. Lemme see if I can explain this...

The directory to my gcc files is as follows: /usr/lib/gcc-lib/i586-mandrake-linux-gnu/

Now, in this directory I had 2 more directories... they were: 2.96 and 3.0.4

When I ran "gcc --version" from the command line I got the response: 2.96 and so I ran "gcc -print-search-dirs" and saw that it was obviously looking to the 2.96 directory for it's files.

The problem was, the 2.96 directory didn't have the cpp0 executable in it which is why I was getting that error. Just out of curiosity I figured I'd poke around in the 3.0.4 directory and see what I could find and sure enough there was a cpp0 file in there so I made a link from the file there to the 2.96 directory.

I went back to the directory containing the extracted tarball and ran ./configure and vwahlah! it ran flawlessly! Needless to say, I was very happy.

Now comes the down side: more errors on make install. :(

I have yet to get a program fully installed but I'm just glad I'm this far haha. This is confusing.

One question I have is, why wasn't the cpp0 file in the 2.96 directory originally?

mingshun
08-10-2002, 12:59 AM
Originally posted by ciphrix

One question I have is, why wasn't the cpp0 file in the 2.96 directory originally?

As I said earlier on, it was probably corrupted. It probably has some more missing binaries too.

endoalpha
08-10-2002, 02:45 AM
You have two compilers installed. gcc-2.96 and gcc-3.0.4. I would say that linking the cpp0 from 3.04 to 2.96 is a BAD thing. Since all of mandrake 8.x is compiled with gcc-2.96, you really should avoid 3.0.4. Besides, 3.0.4 is very buggy. So, as a suggestion, maybe you should uninstall gcc-3.0.4 and reinstall gcc-2.96. Also, I have found that compiling from source in Mandrake is en effort in futility unless you really understand how to ./configure correctly. Go through ./configure --help first. Compiling from a mdk.src.rpm does work rather well though.