undefined reference

Programming, for all ages and all languages.
Post Reply
User avatar
axiomfinity
Posts: 2
Joined: Sat Jun 11, 2011 4:23 pm
Location: Sacramento, CA
Contact:

undefined reference

Post by axiomfinity »

I run the make script to compile and link the kernel and i am getting an undefined reference
from ld.

gcc -Wall -g -v -c -static -o avocado.o kernel.c -lstdc++ -L/usr/lib -I/usr/lib -ltommath
ld -T link.ld -o avocadoos start.o avocado.o
User avatar
piranha
Member
Member
Posts: 1391
Joined: Thu Dec 21, 2006 7:42 pm
Location: Unknown. Momentum is pretty certain, however.
Contact:

Re: undefined reference

Post by piranha »

Um. Thats possibly the most useless description of a problem I've come across, besides "It doesn't work". I'm not even going to look at the commands. Perhaps providing code, and the error message would be a good plan?

Oh, and linking to libraries? Bad plan...

EDIT: Actually, you're linking to those libraries (or trying to) in the gcc command that doesn't do any linking...

-JL
SeaOS: Adding VT-x, networking, and ARM support
dbittman on IRC, @danielbittman on twitter
https://dbittman.github.io
User avatar
Brynet-Inc
Member
Member
Posts: 2426
Joined: Tue Oct 17, 2006 9:29 pm
Libera.chat IRC: brynet
Location: Canada
Contact:

Re: undefined reference

Post by Brynet-Inc »

EDIT: Removed 2015: Imageshack replaced all links with spam.
Image
Twitter: @canadianbryan. Award by smcerm, I stole it. Original was larger.
Post Reply