LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   howto forcing ld to export external symbol? (https://www.linuxquestions.org/questions/programming-9/howto-forcing-ld-to-export-external-symbol-569826/)

kkk139 07-16-2007 11:26 AM

howto forcing ld to export external symbol?
 
sample:
// shared_library.c file
extern void func();
// func() implemented in other program
// end

howto forcing ld to export 'func'?

thanks in advance!

--
best regards,
alec

ta0kira 07-17-2007 12:10 AM

You must define it to something. In other words, give the function some code! You are using a declaration, which allows the declaring unit to borrow that function from a library at link-time. Chances are the symbol is exported as an undefined symbol (ONLY if that unit references it, though,) as denoted by a "U" when calling nm on the output file. Define it and you will get a "T", which is what I think you want.
ta0kira


All times are GMT -5. The time now is 01:41 PM.