LinuxQuestions.org
Welcome to the most active Linux Forum on the web.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-16-2007, 11:26 AM   #1
kkk139
LQ Newbie
 
Registered: Jul 2007
Posts: 1

Rep: Reputation: 0
Red face 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
 
Old 07-17-2007, 12:10 AM   #2
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: FreeBSD 9.1, Kubuntu 12.10
Posts: 3,078

Rep: Reputation: Disabled
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
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
DISCUSSION: Kernel Compilation and Avoiding ‘Unresolved Symbol’ HOWTO vikram_cvk LinuxAnswers Discussion 6 01-06-2020 02:27 PM
External HD HOWTO? Kikazaru Linux - Hardware 6 10-26-2006 08:31 PM
export symbol from module to kernel dogalmity Programming 0 06-05-2006 04:38 PM
Forcing extern declaration symbol generation in shared library ta0kira Programming 6 03-26-2006 03:49 PM
error: unresolved external symbol purefan Programming 3 03-26-2005 07:27 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 05:48 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration