From mboxrd@z Thu Jan 1 00:00:00 1970 Message-ID: <96835371209106.tru64-unix-managers.marc@archive.invalid> From: Charles Vachon Date: Thu, 07 Sep 2000 19:09:40 +0000 To: tru64-unix-managers Subject: basic ld linker question X-MARC-Message: https://marc.info/?l=tru64-unix-managers&m=96835371209106 Hello Tru64 admins, Trying to compile a C program on Tru64 4.0F. Let's say I have a .c program like this: /* * A very basic C program: basic.c */ #include int main( int argc, char *argv[] ) { int i; printf( "program %s has %d arguments:\n", argv[0],argc-1 ); for ( i=3D1; i < argc; i++ ) printf( "argv %d: %s\n", i, argv[i] ); return(0); } /* * end of basic C program */ I can successfully compile and link with "cc -o basic basic.c". What stumps me is when I create an object file with "cc -c basic.c", which produces a basic.o file, and then I try to link using "ld -call_shared -o basic -lc basic.o", I do get a "Unresolved: printf" from ld. Further, if I chmod u+x the resulting (executable) object file named basic and I try to execute it, I do get messages like the following 10893:./basic: /sbin/loader: Error: Unresolved symbol in /usr/shlib/libc.so: __ldr_data 10893:./basic: /sbin/loader: Error: Unresolved symbol in /usr/shlib/libc.so: __Argc 10893:./basic: /sbin/loader: Error: Unresolved symbol in /usr/shlib/libc.so: __Argv 10893:./basic: /sbin/loader: Fatal Error: this executable has unresolvable symbols Can anyone shed light on this? I know this is certainly a very basic issue, but I'm not all too familiar with the numerous options to ld and cc commands. Thanks in advance. -- =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D Charles Vachon tel: (418) 627-6355 x2760 email: cvachon2@mrn.gouv.qc.ca Administrateur de syst=E8me FRCQ/Minist=E8re des Ressources Naturelles du Qu=E9bec =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D