ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I m trying to compile the linux kernel 2.6.14.6 with board support for the MIPS EncoreM3 board (AU1500 chip).
I have an irq.c function in the arch/mips/au1000/encm3/ directory and in another file, board_setup.c, in the same directory i make the following assignment:
Quote:
board_init_irq=encm3_board_init_irq;
I get this error when I try to compile
Quote:
arch/mips/au1000/encm3/lib.a(board_setup.o)(.init.text+0x4c): In function `board_setup':
: undefined reference to `encm3_board_init_irq'
arch/mips/au1000/encm3/lib.a(board_setup.o)(.init.text+0x50): In function `board_setup':
: undefined reference to `encm3_board_init_irq'
make[1]: *** [.tmp_vmlinux1] Error 1
make[1]: Leaving directory `/home/ashlesha/KNP-Linux/linux'
make: *** [build] Error 2
encm3_board_init_irq is defined in the irq.c file in the arch/mips/au1000/encm3/ directory and how do i knw if the compiler knows where the program is?
i think the board_setup.c file is being compiled before the irq.c file which is why the compiler cant find the encm3_board_irq_init function..
the issue boils down to the linker being unable to resolve that particular dependancy.
When the linker starts putting your object files together, its going to look up any undefined symbols, and symbols which are duplicately defined or redefined, and attempt to resolve those issues. If it can't find a symbol, that means you're not linking the definition of that symbol into the final product.
What you might want to do is expose some API to an upper layer routine which will have both of these libraries linked into it, and have THAT make the assignment. That's, at least, one way of solving this issue quickly.
Thanks for your responses -- I did not receive notification of the same so could not respond earlier.
I do include a header irq.h in the board_setup.c file.
Quote:
What you might want to do is expose some API to an upper layer routine which will have both of these libraries linked into it, and have THAT make the assignment. That's, at least, one way of solving this issue quickly.
When you say it has "both libraries linked into it", do you mean
a) a routine which has all the # include files from board_setup.c as well as irq.c?
OR
b) a routine which calls functions from both these files?
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.