New to C/gcc compiler - compile error.


 
Thread Tools Search this Thread
Top Forums Programming New to C/gcc compiler - compile error.
# 1  
Old 12-13-2007
New to C/gcc compiler - compile error.

I am new to comiling c/c++ programs with gcc compilier
unix - AIX version 5.3
gcc compiler version - 4.0.0

My makefile.
# makefile 1.0 08/20/98


#CC = cc
CC = gcc
ESQL = esql
CFLAGS = -Wall
DBSLIB=
DBSLIB=-L${INFORMIXDIR}/lib/esql -L${INFORMIXDIR}/lib `esql -libs`

ALL = hds_near
SOURCELOC =

SOURCES = near.C geo_cus_node.C

OBJECTS = $(SOURCES:.C=.o)

#INCLUDES=-I/usr/lpp/xlC/include -I/usr/include -I$(INFORMIXDIR)/incl/esql -I$(I
NFORMIXDIR)/incl -I/hds/esriapps/infolib -I/usr/lpp/xlC/lib

mylist: $(OBJECT) hds_near

INCLUDES=-I/opt/freeware/include -I/usr/include -I$(INFORMIXDIR)/incl/esql -I$(I
NFORMIXDIR)/incl -I/hds/esriapps/infolib -I/opt/freeware/lib


hds_near: near.o geo_cus_node.o near.h functions.h
$(CC) -b $(INCLUDES) -o hds_near near.o geo_cus_node.o /hds/lib/
shrsysmon.o dbgeo.a /hds/esriapps/infolib/infolib-ibm.a $(DBSLIB) $(INFORMIXDIR
)/lib/netstub.a

# $(CC) -b loadmap:map $(INCLUDES) -o hds_near near.o geo_cus_node.o /hds/lib/shrsysmon.o dbgeo.a /hds/esriapps/infolib/infolib-ibm.a $(DBSLIB) $(INFORMIXDIR)/lib/netstub.a

near.o: near.C near.h dbgeo.a infolib.h functions.h
$(CC) -g $(INCLUDES) -c $(SOURCELOC)near.C

geo_cus_node.o: geo_cus_node.C near.h infolib.h functions.h
$(CC) -g $(DBSLIB) -c $(SOURCELOC)geo_cus_node.C


On commnad line when I type
make -f mymakefile hds_near
I get following error message

gcc -b -I/opt/freeware/include -I/usr/include -I/usr/informix/incl/esql -I/usr/informix/incl -I/hds/esriapps/infolib -I/opt/freeware/lib -o hds_near near.o geo_cus_node.o /hds/lib/shrsysmon.o dbgeo.a /hds/esriapps/infolib/infolib-ibm.a -L/usr/informix/lib/esql -L/usr/informix/lib `esql -libs` /usr/informix/lib/netstub.a
gcc: couldn't run '-I/opt/freeware/include-gcc-4.0.0': No such file or directory
make: 1254-004 The error code from the last command is 1.

Looking at the error message it looks like gcc compiler was not installed properly. I talked to unix admin and he installed the gcc twice and it's the same error message.

Any suggestion on what am I missing?
# 2  
Old 12-13-2007
Move your new INCLUDE directly below the old commented out include.
# 3  
Old 12-13-2007
I tried and still the same error message
# 4  
Old 12-13-2007
Try this from the same directory that "gcc" lives in....

Code:
$ pwd
/opt/TWWfsw/bin
$ ./gcc -v
Reading specs from /opt/TWWfsw/gcc343/lib/gcc/powerpc-ibm-aix5.1.0.0/3.4.3/specs
Configured with: /opt/build/gcc-3.4.3/configure --enable-nls --with-included-gettext --enable-shared --enable-threads --prefix=/opt/TWWfsw/gcc343 --with-local-prefix=/opt/TWWfsw/gcc343
Thread model: aix
gcc version 3.4.3 (TWW)

# 5  
Old 12-13-2007
[frat:/usr/bin]which gcc
/usr/bin/gcc
[frat:/usr/bin]./gcc -v
Using built-in specs.
Target: powerpc-ibm-aix5.3.0.0
Configured with: ../configure --with-as=/usr/bin/as --with-ld=/usr/bin/ld --disable-nls --enable-languages=c,c++ --prefix=/opt/freeware --enable-threads --enable-version-specific-runtime-libs --host=powerpc-ibm-aix5.3.0.0
Thread model: aix
gcc version 4.0.0
[frat:/usr/bin]
# 6  
Old 12-13-2007
Why is it in /usr/bin/gcc?

Code:
$ gcc -print-search-dirs
install: /opt/TWWfsw/gcc343/lib/gcc/powerpc-ibm-aix5.1.0.0/3.4.3/
programs: =/opt/TWWfsw/gcc343/libexec/gcc/powerpc-ibm-aix5.1.0.0/3.4.3/:/opt/TWWfsw/gcc343/libexec/gcc/powerpc-ibm-aix5.1.0.0/3.4.3/:/opt/TWWfsw/gcc343/libexec/gcc/powerpc-ibm-aix5.1.0.0/:/opt/TWWfsw/gcc343/lib/gcc/powerpc-ibm-aix5.1.0.0/3.4.3/:/opt/TWWfsw/gcc343/lib/gcc/powerpc-ibm-aix5.1.0.0/:/usr/libexec/gcc/powerpc-ibm-aix5.1.0.0/3.4.3/:/usr/libexec/gcc/powerpc-ibm-aix5.1.0.0/:/usr/lib/gcc/powerpc-ibm-aix5.1.0.0/3.4.3/:/usr/lib/gcc/powerpc-ibm-aix5.1.0.0/:/opt/TWWfsw/gcc343/lib/gcc/powerpc-ibm-aix5.1.0.0/3.4.3/../../../../powerpc-ibm-aix5.1.0.0/bin/powerpc-ibm-aix5.1.0.0/3.4.3/:/opt/TWWfsw/gcc343/lib/gcc/powerpc-ibm-aix5.1.0.0/3.4.3/../../../../powerpc-ibm-aix5.1.0.0/bin/
libraries: =/opt/TWWfsw/gcc343/lib/gcc/powerpc-ibm-aix5.1.0.0/3.4.3/:/usr/lib/gcc/powerpc-ibm-aix5.1.0.0/3.4.3/:/opt/TWWfsw/gcc343/lib/gcc/powerpc-ibm-aix5.1.0.0/3.4.3/../../../../powerpc-ibm-aix5.1.0.0/lib/powerpc-ibm-aix5.1.0.0/3.4.3/:/opt/TWWfsw/gcc343/lib/gcc/powerpc-ibm-aix5.1.0.0/3.4.3/../../../../powerpc-ibm-aix5.1.0.0/lib/:/opt/TWWfsw/gcc343/lib/gcc/powerpc-ibm-aix5.1.0.0/3.4.3/../../../powerpc-ibm-aix5.1.0.0/3.4.3/:/opt/TWWfsw/gcc343/lib/gcc/powerpc-ibm-aix5.1.0.0/3.4.3/../../../:/lib/powerpc-ibm-aix5.1.0.0/3.4.3/:/lib/:/usr/lib/powerpc-ibm-aix5.1.0.0/3.4.3/:/usr/lib/

# 7  
Old 12-13-2007
I don't know why it's installed in /usr/bin/gcc. All our executables are in /usr/bin

But here's the output from command? am I missing any files?

[frat:/usr/bin]gcc -print-search-dirs
install: /opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/
programs: =/opt/freeware/libexec/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/:/opt/freeware/libexec/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/:/opt/freeware/libexec/gcc/powerpc-ibm-aix5.3.0.0/:/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/:/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/:/usr/libexec/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/:/usr/libexec/gcc/powerpc-ibm-aix5.3.0.0/:/usr/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/:/usr/lib/gcc/powerpc-ibm-aix5.3.0.0/:/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/../../../../powerpc-ibm-aix5.3.0.0/bin/powerpc-ibm-aix5.3.0.0/4.0.0/:/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/../../../../powerpc-ibm-aix5.3.0.0/bin/
libraries: =/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/:/usr/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/:/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/../../../../powerpc-ibm-aix5.3.0.0/lib/powerpc-ibm-aix5.3.0.0/4.0.0/:/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/../../../../powerpc-ibm-aix5.3.0.0/lib/:/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/../../../powerpc-ibm-aix5.3.0.0/4.0.0/:/opt/freeware/lib/gcc/powerpc-ibm-aix5.3.0.0/4.0.0/../../../:/lib/powerpc-ibm-aix5.3.0.0/4.0.0/:/lib/:/usr/lib/powerpc-ibm-aix5.3.0.0/4.0.0/:/usr/lib/
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Gcc g++ on cygwin - configure: error: *** A compiler with support for C++11 language features is req

Hi, Apologies if I posted it in a wrong section as it is related to gcc on cygwin. Please move it to appropriate section. I'm trying to compile and build libsigc++-2.10.2 on cygwin with gcc 8.3.0. when I run ./configure, I get this: I couldn't fully understand what does... (13 Replies)
Discussion started by: prvnrk
13 Replies

2. UNIX for Dummies Questions & Answers

Compiling gcc to compile make to compile yaboot

I have just installed OpenBSD on a 333MHz PPC iMac G3. It has a 6GB HDD that has been partitioned as 1GB MacOS 8.5.1, 3GB MacOS X 10.3.9, 2GB OpenBSD 4.8. I now need to install a bootloader so that my computer can recognize the OpenBSD partition at startup. I have been trying to install... (0 Replies)
Discussion started by: t04st3r
0 Replies

3. UNIX for Dummies Questions & Answers

GCC compiler Ld fatal error

Hi all I'm trying to install sudo. When I first ran the sudo configure script it errored saying that I didn't have a C compiler. I have since installed the GCC 3.4.6 package for sol8 from sun freeware. Doing that resolved the no C complier found error. I was then getting an error saying... (1 Reply)
Discussion started by: Donkey25
1 Replies

4. Ubuntu

./configure command Error while trying to install GCC compiler on unix machine

Hi, I need to install the GCC compiler on a my Linus machine. First step is to run the ./configure command and here we need to specify ./configure --target="target machine name (CPU type-Manufacturer-OS) or other way would be just give the command ./configure and it guesses the target name... (11 Replies)
Discussion started by: viji19812001
11 Replies

5. HP-UX

gcc error..compiler cannot create executables

Hi I have locally compiled and installed gcc-4.1.2 in directory /usr/local/pkg/gcc/4.1.2/bin/gcc I want to compile beecrypt using this new compiler , So i have done setenv CC usr/local/pkg/gcc/4.1.2/bin/gcc ( Note this configuration is running properly with older version of... (1 Reply)
Discussion started by: vasanthan
1 Replies

6. AIX

RS/6000 gcc compile large file error

hi, everybody£º i have a question, pls help me¡£ OS : RS/6000 AIX 4.3.3 cPU : Powerpc,POWER3 compiler : gcc 3.2.3 source file £º 8M OS kernel : 32 bit (selecting at installing operating system, the hardware support 64 bit) when i compiling the large source file (8 M), i... (3 Replies)
Discussion started by: q30
3 Replies

7. Programming

Error in compile C by gcc

Hi all, I compile my c program and get following result hrnpfc01.c:1387: stray '\' in program hrnpfc01.c:1387: parse error before `,' hrnpfc01.c:1388: stray '\' in program hrnpfc01.c:1388: parse error before `,' hrnpfc01.c:1396: stray '\' in program hrnpfc01.c:1396: parse error before... (4 Replies)
Discussion started by: zico
4 Replies

8. Programming

How to compile using gcc...

I need to know how to make a binary with gcc. I know how to create an obj file, but I'm not quite sure what to do about the linking part. I've gotten this far "gcc -c somefile.c somefile.o" then I'm left with an object file, but I don't see any linking command line options. Does anyone know how... (4 Replies)
Discussion started by: lilprogrammer
4 Replies

9. UNIX for Dummies Questions & Answers

can't even compile my compiler!!!

I have two systems, both running solaris 2.5.1. the first is a test server and the other is the production box. On the test server I just compiled and installed php4, apache 1.3.17, and MySQL 3.23.32. when I tried to do it on the production box, nothing will compile and I get the following error... (4 Replies)
Discussion started by: hotani
4 Replies
Login or Register to Ask a Question