All of lore.kernel.org
 help / color / mirror / Atom feed
From: "sakib mondal" <sakib@hotmail.com>
To: linux-kernel@vger.kernel.org
Subject: Problem of undefined reference
Date: Fri, 10 Jan 2003 12:52:27 +0000	[thread overview]
Message-ID: <F1550VnkB4ltFlmmlQ00000384c@hotmail.com> (raw)

Hi,

Wish you all a happy new year.

I appologize in case you are getting multiple copies of this message.

I am facing the problem of "undefined reference" for my task of using 
extended functionality of linux kernel (2.4.18) as detailed below. I shall 
appreciate any suggestion to solve the problem.


I would like to incorporate new functions into linux kernel. Therefore I 
created a file f.c with function "void foo()". Source f.c uses header file 
f.h. The header file "f.h" has declaration "extern void foo(void);". I 
included f.o in the obj-y in the Makefile in the corresponding directory. I 
could build the new kernel without any error or warning.

Now, I intended to use the extended functionality of the kernel from my 
program. I wrote g.c which calls foo(); I have included header f.h in g.c. 
However when I build g, I get the error:

"g.o(.text+ox35): undefined reference to `foo`".

I am unable to understand why "foo" is not resolved as the resident kernel 
ius built with object f.o. To diagonose the problem further I did the 
follwing things which could neither solve my problem.

i) Used "EXPORT_SYMBOL(foo);" in f.c and had f.o included in export-objs in 
the Makefile.  ==> I still get the problem of undefined reference

ii) Defined library libf.a based on f.o and included the library for 
building g. ==> The kernel is agin built ok. I could see (using nm) that the 
symbol foo in defined with type T. However, when building g, I am getting 
lot of undefined references to kernel variables and routines that are used 
in foo.

I shall appreciate any suggestion or alternative for solving the problem.

TIA.

Sakib






_________________________________________________________________
MSN 8 with e-mail virus protection service: 2 months FREE* 
http://join.msn.com/?page=features/virus


             reply	other threads:[~2003-01-10 12:44 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-10 12:52 sakib mondal [this message]
2003-01-10 13:39 ` Problem of undefined reference Richard B. Johnson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=F1550VnkB4ltFlmmlQ00000384c@hotmail.com \
    --to=sakib@hotmail.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.