Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

help with cc compiler 2

Status
Not open for further replies.

rock31

Programmer
Jul 18, 2004
38
US
Hello,
I have compiled a source C program into a re-locatable binary object file as “ReadGDflds.o”. Now I am linking the object file to library, and compile it to obtain final executive file, name as “ReadGDflds” as in the following example.

cc -DHDFSYS -o ReadGDflds -L/opt/hdf/lib -L/opt/hdfeos/lib/sun5 -lhdfeos -1Gctp -lmfhdf -ldf -ljpeg -lnsl -lz -lm ReadGDflds.o

Then I got a warning message and a fatal error message as below.

cc: Warning: option -1 passed to ld
cc: No input file specified, no output generated.

I am wondering what is happening here. Obviously, I gave an input file “ReadGDflds.o”.
By the way, I can’t understand the meaning of the warning.
Would anyone please help me out?
Thanks a lot
 
At a guess -1Gctp should read -lGctp
 
The usual layout of the command line is
[tt]cc outputfile inputfiles libraries[/tt]

You should specify the libraries after all the input object files.

--
 
Hello, xwb,
You are such a genius. You are right. I spent this whole morning to figure out what was wrong. You found out in a second. On my screen, it is so hard to tell the difference between 1 and l until I noticed your reply on IE. I don’t know how I made this sneaky mistake.
Salem, thank you too.

Rock31
 
Change your font or font size. Courier 1 and l look the same on the lower resolutions. Side issue: if you have a look at some of the early portables (circa 1970) you will find that there is no 1. Typists were taught to use l instead of 1!

Always check that the following are different. It is a real pain when they are not.

1 (one), l (lowercase L), I (capital I), | (vertical bar)
0 (zero) O (uppercase o)

 
Hello, xwb,
Thank you very much. This is really a very good suggestion.
Have a good day
Rock31
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top