cc compiler options


 
Thread Tools Search this Thread
Operating Systems HP-UX cc compiler options
# 1  
Old 05-17-2006
cc compiler options

hi ,

I am compiling a C program with ccopts and cflags .
i am getting error message
main ( Not referenced yet ! probably due -u option )

can you please adice , how to get rid of this error.

Many thanks
Narendra babu C
# 2  
Old 05-17-2006
It means that main() does not exist in the source code file(s) you are compiling.

Two choices:
1. create an object to link later on: add the -c option to CCOPTS
2. edit the file and add a valid main()
# 3  
Old 05-19-2006
cc options

Thanks a lot Jim for your answer.
The file is having only functions and these functions are accessed in other c functions

I cannot have main in this .

Thanks and regards
Narendra babu C
# 4  
Old 05-19-2006
need to create library?

I think you want to create a library of functions.
Try this and see

cc +Z -I Include_directory -c filename.c

This will give a .o file.

Use ld now

ld -b filename.o -o shr_fil_name.so

This creates a shared library. Use the -l option in cc to include this library while compiling the actual C programs. I hope that helps.

Last edited by ranj@chn; 05-19-2006 at 04:43 AM.. Reason: typo error for the cc option
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Ubuntu

Kernel boot options removed by fault, no boot options

Hello Everyone, First of all, I highly appreciate all Linux forum members and whole Linux community. http://forums.linuxmint.com/images/smilies/icon_wink.gif. I wish you the best for all of you ! I will try to be short and concise: I am using Linux Mint 10 for 2 months on 2 ws, and all went... (3 Replies)
Discussion started by: cdt
3 Replies

2. Programming

Gfortran compiler options.

I am a INTEL fortran user recently migrated to linux and installed gfortran on my system. I run numerical models as part of my research. my question is on optimization of the fortran code. I used the - vectorize option to compile for reducing the run time considerably and was happy. But... (1 Reply)
Discussion started by: schamarthi1
1 Replies

3. AIX

xlc compiler options versus gcc

Hi all, I would like to compile a program and get current errors and warnings report to me as « gcc -Wall ». Does someone can give me these options to get an equivalent ? Or the ommon option used to put them in a CFLAGS in a Makefile. Something like : xlc -O2 -Wall my_prog.c -o... (5 Replies)
Discussion started by: domiq44
5 Replies

4. UNIX for Dummies Questions & Answers

cc compiler and gcc compiler

hi, can we install gcc compiler in unix based OS(sun solar,IBM AIX,HP,etc) and also can we install sun cc compiler in AIX environment and vice versa. and more ..is linux support cc compiler regards Ajay (3 Replies)
Discussion started by: ajaysahoo
3 Replies

5. Programming

How Can a Machine Reads a Compiler Since A Compiler is Written in Text! Not Binaries?

To make a programming language you need a compiler, so what was the first programming language and how was is created if you need the compiler first? The compiler itself is considered as a high language comparing to the machine! since the compiler is not created in 1's and 0's... Eventhough i... (12 Replies)
Discussion started by: f.ben.isaac
12 Replies

6. UNIX for Dummies Questions & Answers

xl C/C++ compiler to GCC compiler

Hi, we are converting from IBM-AIX(xl c/c++ compiler) to Linux(GCC complier). As a part of this i need to change the CFLAGS. The xl c/c++ complier CFLAGS is CFLAGS := $(CDEBUG) $(PROJECT_INCLUDE_DIRS) $(COBJECT_MODE) -qcpluscmt -qmakedep -qcheck=all \ -qalign=bit_packed $(LINT_FLAGS)... (0 Replies)
Discussion started by: pbattu1
0 Replies

7. Programming

c compiler

i'm using linux to compile my c program right now. are there any free c compiler with all the standard header file, such as <stdio.h>, <unistd.h>..., i can download and use? can Microsoft Visual C++ compile C code? thanks. (1 Reply)
Discussion started by: bb00y
1 Replies

8. Programming

C compiler

I have just installed C compiler, the installation was successful but when I try to excute a gcc file I received the error message "types.c: In function `main': > types.c:4: warning: return type of `main' is not `int' > ld: fatal: file values-Xa.o: open failed: No such file or directory >... (5 Replies)
Discussion started by: hassan2
5 Replies
Login or Register to Ask a Question