Unsatisfied Symbols: main

Ask a Question related to UNIX Programming, Design and Development.

  1. #1

    Default Unsatisfied Symbols: main

    Line of code to compile:

    cc -Ae -D_HPUX_SOURCE -Wl,-adefault -Wl,+s -y
    -o /apps/primary/wsi/src/bin/wsi_mgr -L/opt/oracle_8.05/precomp/lib/
    -L/opt/oracle_8.05/lib/ -I/opt/oracle_8.05/precomp/public


    Error does not mention if main is (code) or (data).

    On HP-UX 10.2

    Help please..
    thumor Guest

  2. Similar Questions and Discussions

    1. are there symbols in ID?
      I have to reuse a shape many times in my document and I would like to have the option of changing just one of the copies and have the rest update...
    2. Symbols
      I am interested in creating some personal palettes of symbols. I know how to make a symbol in an open document, however, I have not been able to any...
    3. Symbols (newbie)
      Hi. When i convert something to symbol, it going in library. And when later drag this from lybrary and change its look, symbol in library also...
    4. Symbols......
      When you save a symbol to the library, where the *((**& do they go? Apparently mine found "symbol heaven" because I sure can't find them!! :) --...
    5. Inserting symbols
      Is there some way to insert a library symbol to the exact location on the canvas where it was when it was created? Thinking some kind of key you...
  3. #2

    Default Re: Unsatisfied Symbols: main

    [email]ttejas@yahoo.com[/email] (thumor) wrote:
    > Line of code to compile:
    >
    > cc -Ae -D_HPUX_SOURCE -Wl,-adefault -Wl,+s -y
    > -o /apps/primary/wsi/src/bin/wsi_mgr -L/opt/oracle_
    8.05/precomp/lib/
    > -L/opt/oracle_8.05/lib/ -I/opt/oracle_8.05/precomp/public
    >
    >
    > Error does not mention if main is (code) or (data).
    What error?

    RFM
    --
    To reply, translate domain from l33+ 2p33|< to alpha.
    4=a 0=o 3=e +=t
    Fritz M Guest

  4. #3

    Default Re: Unsatisfied Symbols: main

    [email]Lew.Pitcher@td.com[/email] (Lew Pitcher) wrote in message news:<3f1c020b.8550982@news21.on.aibn.com>...
    > On 21 Jul 2003 07:33:53 -0700, [email]ttejas@yahoo.com[/email] (thumor) wrote:
    >
    > >Line of code to compile:
    > >
    > > cc -Ae -D_HPUX_SOURCE -Wl,-adefault -Wl,+s -y
    > > -o /apps/primary/wsi/src/bin/wsi_mgr -L/opt/oracle_8.05/precomp/lib/
    > > -L/opt/oracle_8.05/lib/ -I/opt/oracle_8.05/precomp/public
    > >
    > >
    > >Error does not mention if main is (code) or (data).
    > >
    > >On HP-UX 10.2
    >
    > While I would need the actual error message to be sure, I believe that your
    > problem is that you are trying to link a program that does not have the required
    > main() function defined.
    Guys,
    The error is in the sunject line. But, I found the problem: I missed
    specifying the program name itself. I added that at end, and it
    worked.

    Following line worked (see the wsi_mgr.c at end) :

    cc -Ae -D_HPUX_SOURCE -Wl,-adefault -Wl,+s -y
    -o /apps/primary/wsi/src/bin/wsi_mgr
    -L/opt/oracle_8.05/precomp/lib/
    -L/opt/oracle_8.05/lib/ -I/opt/oracle_8.05/precomp/public
    wsi_mgr.c


    But now I am getting the following when it tries to link everything
    into
    an executable.


    cc -Ae -v -Wl,-adefault -Wl,+s +O2
    -o /apps/primary/wsi/src/bin/wsi_mgr
    -L/opt/oracle_8.05/precomp/lib/
    -L/opt/oracle_8.05/lib/ -I/opt/oracle_8.05/precomp/public
    -I/opt/oracle_8.05/precomp/public
    /apps/primary/wsi/src/obj/wsi_lib.a
    /apps/primary/wsi/src/obj/std_lib.a
    wsi_mgr.c -o /apps/primary/wsi/src/obj/wsi_mgr.o

    cc: CCOPTS is not set.
    /opt/langtools/lbin/cpp.ansi wsi_mgr.c /var/tmp/ctmAAAa05355 -$
    -D__hp9000s800 -D__hppa -D__hpux -D__unix -e
    -I/opt/oracle_8.05/precomp/public -I/opt/oracle_8.05/precomp/public
    -D_PA_RISC1_0 -D_HPUX_SOURCE -D__STDC_EXT__

    cc: Entering Preprocessor.
    /opt/ansic/lbin/ccom /var/tmp/ctmAAAa05355 wsi_mgr.o
    -Oq02,al,ag,cn,Lm,sz,Ic,vo,lc,Mf,Po,es,rs,sp,in,vc, Pi,fa,pe,Rr,Fl,pv,pa,nf,cp,l
    x,st,ap,Pg,ug,Lu,dp,Fs,bp,wp! -Ae

    /usr/ccs/bin/ld /opt/langtools/lib/crt0.o -u main -adefault +s
    -o /apps/primary/wsi/src/bin/wsi_mgr
    -L/opt/oracle_8.05/precomp/lib/
    -L/opt/oracle_8.05/lib/
    /apps/primary/wsi/src/obj/wsi_lib.a
    /apps/primary/wsi/src/obj/std_lib.a
    wsi_mgr.o
    -o /apps/primary/wsi/src/obj/wsi_mgr.o -lc

    cc: Entering Link editor.
    /usr/ccs/bin/ld: Unsatisfied symbols:
    scale_main (code)
    Log_Message (code)
    t_scale_main (code)
    *** Error exit code 1

    Stop.


    The way I have setup the Makefile is that it first compiles my
    wsi_mgr.pc
    file into a wsi_mgr.c, then compile the .c into a .o and finally link
    all libraries with the .o into an executable wsi_mgr (no extension).

    The wsi_mgr.pc looks like this:

    <BOF>

    /* Includes */
    #include <stdio.h>
    #include <stdarg.h>
    #include <varargs.h>
    #include <stdlib.h>
    #include <errno.h>
    #include <signal.h>
    #include <string.h>
    #include <memory.h>
    #include <stdlib.h>
    #include <sys/types.h>
    #include <sys/stat.h>
    #include <sys/socket.h>
    #include <sys/stdsyms.h>
    #include <dirent.h>
    #include <time.h>
    #include "../inc/wsi_mgr.h"
    #include "../inc/constants.h"
    #include "../inc/scale.h"

    /* Global Variables */
    #ifndef DEBUG
    #define DEBUG
    #ifdef EXTERN
    extern int Debug_level;
    #else
    int Debug_level;
    #endif
    #endif

    void main (argc, argv)
    int argc;
    char *argv[];
    {
    char *st;
    int cc;


    init_global_vars();

    if (argc >= 2) /* first argument is
    debug level */
    Debug_level = atoi(argv[1]);
    else
    Debug_level = 0;

    sprintf(Log_Msg,"Debug Level=%d",Debug_level);
    Log_Message(Main_Log, "main", INFORM, Log_Msg);

    /* Trap System Signals
    */
    signal( SIGKILL, Terminate ); /* Signal Kill
    */

    /* Run the Scale Main
    */
    /* THAT process is
    going to run infinitely */
    if (atoi(getenv("TEST"))==0)
    {
    Log_Message(Main_Log, "main", INFORM, "Started
    Production version");
    cc=scale_main();
    }
    else
    {
    Log_Message(Main_Log, "main", INFORM, "Started Test
    version");
    t_scale_main();
    };

    /* Terminate normally
    */
    if (cc==0)
    Log_Message(Main_Log, "main", FATAL, "WSI Process Ending
    Normally...");
    else
    Log_Message(Main_Log, "main", FATAL, "WSI Process Ended
    Abnormally...");

    } /* End of Main */
    /* here follow the functions init_global_vars(), and Terminate() */

    <EOF>


    The functions scale_main(), t_scale_main(), and Log_Message()are
    defined
    in wsi_mgr.a and std_lib.a libraries.

    Please help.
    Thanks so far.
    thumor Guest

  5. #4

    Default Re: Unsatisfied Symbols: main

    * [email]ttejas@yahoo.com[/email] (thumor)
    | The functions scale_main(), t_scale_main(), and Log_Message()are
    | defined in wsi_mgr.a and std_lib.a libraries.

    You need to read a decent handbook on compiling on Unix. The short
    answer is: put the libraries in the correct order _after_ all
    object/source files on your compilation commandline.

    R'
    Ralf Fassel Guest

  6. #5

    Default Re: Unsatisfied Symbols: main



    thumor wrote:
    >
    > [email]Lew.Pitcher@td.com[/email] (Lew Pitcher) wrote in message news:<3f1c020b.8550982@news21.on.aibn.com>...
    > > On 21 Jul 2003 07:33:53 -0700, [email]ttejas@yahoo.com[/email] (thumor) wrote:
    > >
    > > >Line of code to compile:
    > > >
    > > > cc -Ae -D_HPUX_SOURCE -Wl,-adefault -Wl,+s -y
    > > > -o /apps/primary/wsi/src/bin/wsi_mgr -L/opt/oracle_8.05/precomp/lib/
    > > > -L/opt/oracle_8.05/lib/ -I/opt/oracle_8.05/precomp/public
    > > >
    > > >
    > > >Error does not mention if main is (code) or (data).
    > > >
    > > >On HP-UX 10.2
    > >
    > > While I would need the actual error message to be sure, I believe that your
    > > problem is that you are trying to link a program that does not have the required
    > > main() function defined.
    >
    > Guys,
    > The error is in the sunject line. But, I found the problem: I missed
    > specifying the program name itself. I added that at end, and it
    > worked.
    >
    > Following line worked (see the wsi_mgr.c at end) :
    >
    > cc -Ae -D_HPUX_SOURCE -Wl,-adefault -Wl,+s -y
    > -o /apps/primary/wsi/src/bin/wsi_mgr
    > -L/opt/oracle_8.05/precomp/lib/
    > -L/opt/oracle_8.05/lib/ -I/opt/oracle_8.05/precomp/public
    > wsi_mgr.c
    >
    > But now I am getting the following when it tries to link everything
    > into
    > an executable.
    >
    > cc -Ae -v -Wl,-adefault -Wl,+s +O2
    > -o /apps/primary/wsi/src/bin/wsi_mgr
    > -L/opt/oracle_8.05/precomp/lib/
    > -L/opt/oracle_8.05/lib/ -I/opt/oracle_8.05/precomp/public
    > -I/opt/oracle_8.05/precomp/public
    > /apps/primary/wsi/src/obj/wsi_lib.a
    > /apps/primary/wsi/src/obj/std_lib.a
    > wsi_mgr.c -o /apps/primary/wsi/src/obj/wsi_mgr.o
    >
    > cc: CCOPTS is not set.
    > /opt/langtools/lbin/cpp.ansi wsi_mgr.c /var/tmp/ctmAAAa05355 -$
    > -D__hp9000s800 -D__hppa -D__hpux -D__unix -e
    > -I/opt/oracle_8.05/precomp/public -I/opt/oracle_8.05/precomp/public
    > -D_PA_RISC1_0 -D_HPUX_SOURCE -D__STDC_EXT__
    >
    > cc: Entering Preprocessor.
    > /opt/ansic/lbin/ccom /var/tmp/ctmAAAa05355 wsi_mgr.o
    > -Oq02,al,ag,cn,Lm,sz,Ic,vo,lc,Mf,Po,es,rs,sp,in,vc, Pi,fa,pe,Rr,Fl,pv,pa,nf,cp,l
    > x,st,ap,Pg,ug,Lu,dp,Fs,bp,wp! -Ae
    >
    > /usr/ccs/bin/ld /opt/langtools/lib/crt0.o -u main -adefault +s
    > -o /apps/primary/wsi/src/bin/wsi_mgr
    > -L/opt/oracle_8.05/precomp/lib/
    > -L/opt/oracle_8.05/lib/
    > /apps/primary/wsi/src/obj/wsi_lib.a
    > /apps/primary/wsi/src/obj/std_lib.a
    > wsi_mgr.o
    > -o /apps/primary/wsi/src/obj/wsi_mgr.o -lc
    >
    I do not understand the above command. Why are there two -o options?

    Regardless, the order is incorrect. On many platforms, the load is not
    circular until all externals are satisfied, so if code in wsi_mgr.o
    refers to functions in the wsi_lib.a, you have to place the library
    reference after the .o:

    ld -o /apps/primary/wsi/src/bin/wsi_mgr
    wsi_mgr.o
    /apps/primary/wsi/src/obj/wsi_lib.a
    /apps/primary/wsi/src/obj/std_lib.a
    ...

    If you named your libraries "libwsi.a" and "libstd.a", you could use cc
    like this:
    cc -o /apps/primary/wsi/src/bin/wsi_mgr ....
    wsi_mgr.o -L/apps/primary/wsi/src/obj -lwsi -lstd ...

    > cc: Entering Link editor.
    > /usr/ccs/bin/ld: Unsatisfied symbols:
    > scale_main (code)
    > Log_Message (code)
    > t_scale_main (code)
    > *** Error exit code 1
    >
    > Stop.
    >
    > The way I have setup the Makefile is that it first compiles my
    > wsi_mgr.pc
    > file into a wsi_mgr.c, then compile the .c into a .o and finally link
    > all libraries with the .o into an executable wsi_mgr (no extension).
    >
    > The wsi_mgr.pc looks like this:
    >
    > <BOF>
    >
    > /* Includes */
    > #include <stdio.h>
    > #include <stdarg.h>
    > #include <varargs.h>
    > #include <stdlib.h>
    > #include <errno.h>
    > #include <signal.h>
    > #include <string.h>
    > #include <memory.h>
    > #include <stdlib.h>
    > #include <sys/types.h>
    > #include <sys/stat.h>
    > #include <sys/socket.h>
    > #include <sys/stdsyms.h>
    > #include <dirent.h>
    > #include <time.h>
    > #include "../inc/wsi_mgr.h"
    > #include "../inc/constants.h"
    > #include "../inc/scale.h"
    >
    > /* Global Variables */
    > #ifndef DEBUG
    > #define DEBUG
    > #ifdef EXTERN
    > extern int Debug_level;
    > #else
    > int Debug_level;
    > #endif
    > #endif
    >
    > void main (argc, argv)
    > int argc;
    > char *argv[];
    > {
    > char *st;
    > int cc;
    >
    > init_global_vars();
    >
    > if (argc >= 2) /* first argument is
    > debug level */
    > Debug_level = atoi(argv[1]);
    > else
    > Debug_level = 0;
    >
    > sprintf(Log_Msg,"Debug Level=%d",Debug_level);
    > Log_Message(Main_Log, "main", INFORM, Log_Msg);
    >
    > /* Trap System Signals
    > */
    > signal( SIGKILL, Terminate ); /* Signal Kill
    > */
    >
    > /* Run the Scale Main
    > */
    > /* THAT process is
    > going to run infinitely */
    > if (atoi(getenv("TEST"))==0)
    > {
    > Log_Message(Main_Log, "main", INFORM, "Started
    > Production version");
    > cc=scale_main();
    > }
    > else
    > {
    > Log_Message(Main_Log, "main", INFORM, "Started Test
    > version");
    > t_scale_main();
    > };
    >
    > /* Terminate normally
    > */
    > if (cc==0)
    > Log_Message(Main_Log, "main", FATAL, "WSI Process Ending
    > Normally...");
    > else
    > Log_Message(Main_Log, "main", FATAL, "WSI Process Ended
    > Abnormally...");
    >
    > } /* End of Main */
    > /* here follow the functions init_global_vars(), and Terminate() */
    >
    > <EOF>
    >
    > The functions scale_main(), t_scale_main(), and Log_Message()are
    > defined
    > in wsi_mgr.a and std_lib.a libraries.
    >
    > Please help.
    > Thanks so far.
    --
    Fred L. Kleinschmidt
    Associate Technical Fellow
    Boeing Common User Interface Services
    Fred L. Kleinschmidt Guest

  7. #6

    Default Re: Unsatisfied Symbols: main

    Ralf Fassel <ralfixx@gmx.de> wrote in message news:<ygaoezm8yap.fsf@jupiter.akutech-local.de>...
    > * [email]ttejas@yahoo.com[/email] (thumor)
    > | The functions scale_main(), t_scale_main(), and Log_Message()are
    > | defined in wsi_mgr.a and std_lib.a libraries.
    >
    > You need to read a decent handbook on compiling on Unix. The short
    > answer is: put the libraries in the correct order _after_ all
    > object/source files on your compilation commandline.
    >
    > R'
    cc -Ae -c wsi_mgr.c -o /apps/primary/wsi/src/obj/wsi_mgr.o
    cc -Ae -o /apps/primary/wsi/src/bin/wsi_mgr \
    /apps/primary/wsi/src/obj/wsi_mgr.o \
    -I/opt/oracle_8.05/precomp/public \
    -I/opt/oracle_8.05/lib \
    /apps/primary/wsi/src/obj/wsi_lib.a
    /apps/primary/wsi/src/obj/std_lib.a
    /usr/ccs/bin/ld: Unsatisfied symbols:
    sqlcxt (code)
    *** Error exit code 1

    Stop.

    Does that look better? But now I see a different problem here.
    The (Oracle Library code) sqlcxt was found in $ORACLE_HOME/lib/libclient.a
    using nm -f; which is already in the Include Path!!.

    (As you might have guessed; ORACLE_HOME=/opt/oracle_8.05).

    Lines in the Makefile that trigger this are:



    $(EXE) : $(OBJC) $(SRC)/wsi_mgr.pc
    @echo Executable $(@F) :: Source $?
    $(CC) $(CFLAGS) -c $(@F).c -o $(OBJC)
    $(CC) $(CFLAGS) -o $(EXE) $(OBJC) \
    -I$(ORACLE_HOME)/precomp/public -I$(ORACLE_HOME)/lib \
    $(WSI_LIB) $(STD_LIB)
    rm -f *.c
    rm -f $(OBJC)
    @echo "Done!!"

    $(OBJC) : $(SRC)/wsi_mgr.pc $(C_INCLUDES)
    @echo Target $(@F) :: Source $?
    $(PROC) $(PROCFLAGS) iname=$? oname=$(WSI_C)

    ...where EXE=wsi_mgr; CFLAGS=-Ae, WSI_LIB=../obj/wsi_lib.a; and
    STD_LIB = ../obj/std_lib.a


    Any help will help.
    Thanks.
    thumor Guest

  8. #7

    Default Re: Unsatisfied Symbols: main

    * [email]ppluzhnikov@earthlink.net[/email] (Paul Pluzhnikov)
    | > > You need to read a decent handbook on compiling on Unix.
    |
    | You *still* need that book!
    | Ralf, any suggestions on what that book is?

    I have an ancient booklist from the last millenium, unfortunately I
    can't find any updated version on the net (any pointers anyone?).

    I'd start with one of those in section `Programming' (haven't checked
    whether they contain an answer to the OP's specific problem, but I
    would guess so).

    Booklist Excerpt:

    .. Introduction
    *************************

    Archive-name: books/unix
    Last-modified: June 4, 1994
    Version: 4.1

    ------------------------------------------------------------
    [misc.books.technical] A Concise Guide to UNIX Books
    ------------------------------------------------------------
    --<snip-snip>--
    H. Programming
    ******************

    1. Title: The Unix Programming Environment
    Authors: Brian Kernighan and Rob Pike
    Publisher: Prentice-Hall
    Edition: 1984
    ISBN: 0-13-937681-X
    Comment: A true classic on Unix programming ...


    2. Title: Advanced Programming in The Unix Environment
    Author: Richard Stevens
    Publisher: Addison-Wesley
    Edition: 1992
    ISBN: 0-201-56317-7
    Comment: **** Highly Recommended ****
    A going-to-be classic on how programs work under Unix ...
    The source codes and errata list are obtainable by anonymous ftp
    from ftp.uu.net (in /published/books).


    HTH
    R'
    Ralf Fassel Guest

  9. #8

    Default Re: Unsatisfied Symbols: main

    [email]ppluzhnikov@earthlink.net[/email] (Paul Pluzhnikov) wrote in message news:<e5693d93.0307221608.340baebf@posting.google. com>...
    > [email]ttejas@yahoo.com[/email] (thumor) wrote in message news:<5d7d3bea.0307221100.66aa97b9@posting.google. com>...
    > > Ralf Fassel <ralfixx@gmx.de> wrote in message news:<ygaoezm8yap.fsf@jupiter.akutech-local.de>...
    >
    > > > You need to read a decent handbook on compiling on Unix.
    >
    > You *still* need that book!
    > Ralf, any suggestions on what that book is?
    >
    > > The (Oracle Library code) sqlcxt was found in $ORACLE_HOME/lib/libclient.a
    > > using nm -f; which is already in the Include Path!!.
    >
    > Include path has absolutely nothing to do with linking, and your
    > -I/opt... flags are bogus (and silently ignored).
    >
    > To fix your immediate problem, append
    >
    > -L$(ORACLE_HOME)/lib -lclient
    >
    > to your link line.
    >
    > Then study [url]http://www.iecc.com/linker[/url] to better understand the linking process.
    >
    > Cheers,
    Thanks all of you for the advise which was well taken.

    The actual problem was not using unorganized -L or -l;
    it was bad usage: meaning not including the proper Oracle Library.

    Found the answer in dbforms.com that sqlcxt was defined in -lclnsh.
    that solved the problem.

    Ralf: I will still read the suggested books for better understanding of
    linking.

    Thanks all.
    thumor Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139