Re: How to declare functions in so to be accessable to applications
From: Måns Rullgård (mru_at_kth.se)
Date: 02/25/04
- Next message: L: "Help - a question on Unix/Linux script"
- Previous message: Fletcher Glenn: "Re: How to declare functions in so to be accessable to applications"
- In reply to: Fletcher Glenn: "Re: How to declare functions in so to be accessable to applications"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Wed, 25 Feb 2004 18:10:42 +0100
Fletcher Glenn <fletcher@removethisfoglight.com> writes:
> Micha wrote:
>> Hi there!
>> I finally compiled my code (with CC on a SPARC4/Solaris8) and got my
>> libugs.so
>> I used this command line to compile:
>> CC -KPIC -G $(INCS) ugs.o ugsMain.o ugsWrapper.o -o libugs.so
>> But the application tells my, that it didn't find the entry point
>> "ugsInit", which is a function delcared as extern in ugsWrapper.h and
>> implemented in ugsWrapper.cpp.
>> Do I have to use an other compile command option?
>> Do I have to set a flag or a macro in the code?
>> Is there a special syntax to use?
>> thx, Micha
>
> Your header file that the application uses, must declare the function
> prototype normally, not as an extern. The symbol will then be satisfied
> at ld time when you include your library. When you declare it extern,
> you are just confusing the linker.
Wrong. Both the header and the source should declare the function as
"extern". Since there is C++ involved, I'd start looking for name
mangling issues.
-- Måns Rullgård mru@kth.se
- Next message: L: "Help - a question on Unix/Linux script"
- Previous message: Fletcher Glenn: "Re: How to declare functions in so to be accessable to applications"
- In reply to: Fletcher Glenn: "Re: How to declare functions in so to be accessable to applications"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|