"main (Not referenced yet! Probably due to -u option)" ... error message - HP UX

This is a discussion on "main (Not referenced yet! Probably due to -u option)" ... error message - HP UX ; Hi All, While compiling my C program, I get the following error message: "main (Not referenced yet! Probably due to -u option)" any inputs or pointers as to how to resolve this will be helpful.... OS is HP UX 11i. ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: "main (Not referenced yet! Probably due to -u option)" ... error message

  1. "main (Not referenced yet! Probably due to -u option)" ... error message

    Hi All,

    While compiling my C program, I get the following error message:

    "main (Not referenced yet! Probably due to -u option)"

    any inputs or pointers as to how to resolve this will be helpful....

    OS is HP UX 11i.


    Regards,
    Farooq.


  2. Re: "main (Not referenced yet! Probably due to -u option)" ...error message

    "Farooq" writes:

    > While compiling my C program, I get the following error message:
    > "main (Not referenced yet! Probably due to -u option)"


    Unlikely. You probably get that message while *linking* your program.

    > any inputs or pointers as to how to resolve this will be helpful....


    What is the failing command line?
    If you are linking an executable with 'ld', don't. Use appropriate
    compiler driver (e.g. 'cc', 'gcc', 'aCC' or 'g++') instead.

    Cheers,
    --
    In order to understand recursion you must first understand recursion.
    Remove /-nsp/ for email.

  3. Re: "main (Not referenced yet! Probably due to -u option)" ... error message

    : While compiling my C program, I get the following error message:
    : "main (Not referenced yet! Probably due to -u option)"
    : any inputs or pointers as to how to resolve this will be helpful....

    As a follow up to what Paul said, you are attempting to link a proggram
    without a main. If you are only compiling, you need to add -c.
    If creating a shared lib, you need to add a -b.

    If you are just trying to use -V, you must supply a source file.

+ Reply to Thread