| 
      
      
      From: BB <be...@by...> - 2005-07-11 07:43:37
      
     | 
| I want to compile and link a program as a shared library, but am running into problems. As soon as I add the "LINKAGE SECTION" and place "USING.." on the "PROCEDURE DIVISION" line of my Cobol program, it crashes during the link stage. Here is how I compiled it... # First we compile the program $PROG to produce the .o file htcobol -c -g -C -D -F -P -I $COBCPY $PROG.cbl # -c Compile to a statically linked object module. # -g Generate Compiler debugging output # -C Make all Cobol calls dynamic # -D Include Source Debugging Lines # -F Input Source is in standard Fixed Column format # -P Generate Output Listing file # -I Define include (copybooks) search path(s). Here is how I linked it... # Next we create the Dynamically Loadable Shared Library "scn.so.0.0" gcc -shared -Wl,-soname,lib$PROG.so.0.0 -o lib$PROG.so.0.0 $PROG.o Here is the output produced by "gcc". --------------------------------------- The program compiled successfully! Linking glcosch.o... /usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../crt1.o: In function `_start': /usr/lib/gcc-lib/i386-redhat-linux/3.2/../../../crt1.o(.text+0x18): undefined reference to `main' collect2: ld returned 1 exit status ---------------------------------------- Jim Morcombe (Still using Ben's computer, and wishing the 24 hour warranty on his own PC really meant something less than a week! Why did he ever trade in his trusty old Windows 98 PC? What was wrong with his Windows 95 PC? At least his old ancient Linux box and even more ancient ancient SCO boxes still work faithfully.) |