[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference turris::decc

Title:DECC
Notice:General DEC C discussions
Moderator:TLE::D_SMITHNTE
Created:Fri Nov 13 1992
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2212
Total number of notes:11045

2146.0. "Shared or Non-shared code ?" by VAXRIO::WK_ESPOZEL () Wed Apr 09 1997 12:47

    What is the difference beteween the two compilation/linking statements
    bellow:
    
    1) cc lu62adm.c -o lu62adm -call_shared -lsnatprm -lc_r
    
       generates lu62adm that works:
    -rwxrwxr-x   1 root     system    155648 Apr  9 12:25 lu62adm 
    
    
    2) cc -c -o lu62adm.o lu62adm.c 
       ld lu62adm.o -o lu62adm  -call_shared -lsnatprm -lc_r
    
      generates a lu62adm that DONT works:
    
    -rwxrwxr-x   1 root     system     32768 Apr  9 12:37 lu62adm     
    
    with the follwing error when trying to run it:
    26915:./lu62admxx: /sbin/loader: Error: unresolvable symbol in
    /usr/shlib/libpthreads.so: __Argv
    26915:./lu62admxx: /sbin/loader: Fatal Error: this executable has
    unresolvable symbols
    
    
    Is it correct to say that the first one gererates a code without shared
    libraries???? And the second one with shared libraries?
    
    Thanks in advance , Heraldo
T.RTitleUserPersonal
Name
DateLines
2146.1QUARRY::nethCraig NethWed Apr 09 1997 13:297
I just answered the note you posted on this in the DIGITAL UNIX conference.

The difference is that in the second case, you aren't linking with the
c startup routines contained in crt0.o.   That's where the _Argv symbol is
defined.   If you use cc -v in your first case you'll see that cc is adding
that for you.