LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Newbie (https://www.linuxquestions.org/questions/linux-newbie-8/)
-   -   Newbie having problems compiling a C program (https://www.linuxquestions.org/questions/linux-newbie-8/newbie-having-problems-compiling-a-c-program-593981/)

NRC 10-23-2007 02:08 PM

Newbie having problems compiling a C program
 
Hi- this is my first post. I'd be greateful for any help others can offer.

I've been trying to compile a C program on my Mac (running OS X) but without much success. A colleague had referred me to a similar previous thread and I've tried a few of the suggestions there, bar those for which links were seemingly no longer live, but am still having problems. This is what happens when I try to compile the program as per the instruction manual:


command line: sh ./configure
checking build system type... i386-apple-darwin8.9.1
checking host system type... i386-apple-darwin8.9.1
checking target system type... i386-apple-darwin8.9.1
checking for a BSD-compatible install... /usr/bin/install -c
checking whether build environment is sane... yes
checking for gawk... no
checking for mawk... no
checking for nawk... no
checking for awk... awk
checking whether make sets ${MAKE}... no
checking for gcc... no
checking for cc... no
checking for cc... no
checking for cl... no
configure: error: no acceptable C compiler found in $PATH


I then tried downloading gcc-4.2.2 but when I type "find / -name gcc" I eventually got the following:

/Users/mycomputer/Desktop/gcc-4.2.2/gcc
/Users/mycomputer/Desktop/gcc-4.2.2/gcc/testsuite/ada/acats/tests/gcc
/usr/local/i386-mingw32-3.4.5/i386-mingw32/bin/gcc
/usr/local/i386-mingw32-3.4.5/lib/gcc
/usr/local/i386-mingw32-3.4.5/libexec/gcc

When I typed "echo $PATH" I got the following:

/bin:/sbin:/usr/bin:/usr/sbin

However, my desired program still won't compile properly.

Sorry about this, but any more suggestions?

emoore 10-23-2007 02:39 PM

Was GCC installed using the OSX package manager? If not I'm wondering how you expect the ./configure script to find it since its not on the path? I don't use OSX but a quick google found http://www.tech-recipes.com/mac_syst...n_tips726.html which talks about how to install GCC under OSX at /usr/bin/gcc (i.e. on the path).

NRC 10-24-2007 09:30 AM

Thanks a million, that seems to have worked!


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