831059l@aucs.UUCP (STEVEN LUCIEN LANGLOIS) (03/22/88)
I am just starting to experiment with C++ so please bare with me. I typed in a small program to print out "Hello world", compiled and ran it and everything worked fine. I wanted to look at the c source file C++ produced so I ran it with the -Fc option and redirected output to a file. I thought that this would give me a c file that I could compile and then run using cc. When I tried to compile the C++ output file with the command cc file.c -llibC, the loader complained saying that it could not open file libC. I tried many variations of the above, all ending in failure. Could someone please tell me what I am doing wrong. Thanx in advance. Steven Langlois Acadia Univ. Wolfville NS Canada B0P1X0 UUCP:{uunet|watmath|utai|garfield}dalcs!aucs!831059L
mitt@hpclroy.HP.COM (Roy Mittendorff) (03/24/88)
Use -lC, not -llibC. Roy.
bmelli@ccvaxa.UUCP (03/26/88)
From the 'ld' man page: -lx This option is an abbreviation for the library name `libx.a', where x is a string. So try -lC Bruno Melli bmelli@claudius.Gould.COM ihnp4!uiucdcs!ccvaxa!bmelli
jss@hector.UUCP (Jerry Schwarz) (03/27/88)
In article <991@aucs.UUCP> 831059l@aucs.UUCP (STEVEN LUCIEN LANGLOIS) writes: > >When I tried to compile the C++ output file with the command >cc file.c -llibC, the loader complained saying that it could not open >file libC. I tried many variations of the above, all ending in failure. >Could someone please tell me what I am doing wrong. > A local guru could tell you how to get the library searched. But this would not yield a correct link phase. C++ linking must included a "static initializer resolution" phase. Thus it must be done with a CC command, not with a "cc" command. You can do "cc file.c" and then "CC file.o" if you want to. Jerry Schwarz