Undefined Error
-
- Posts: 7
- Joined: Sun Nov 02, 2014 12:58 am
Undefined Error
Hi guys I'm on GDT now..
while linking..linker says.. undefined reference to gdtLoad even though it is defined in my GDT.s
I've looked whether i've missed any object files..but I haven't missed none..
Help me
Thanks in advance
while linking..linker says.. undefined reference to gdtLoad even though it is defined in my GDT.s
I've looked whether i've missed any object files..but I haven't missed none..
Help me
Thanks in advance
Re: Undefined Error
Did you declare it as global in the asm code?
Did you declare it as extern "C" in the C++ code?
Did you link all the object files together?
Did you declare it as extern "C" in the C++ code?
Did you link all the object files together?
Re: Undefined Error
You need to compile your assembly and C files in object files, then link them. Also, you need to have an "extern" in your C code.
"If you don't fail at least 90 percent of the time, you're not aiming high enough."
- Alan Kay
- Alan Kay
-
- Posts: 7
- Joined: Sun Nov 02, 2014 12:58 am
Re: Undefined Error
Yes..I've declared extern in my C code and Global in Assembly code..but still i've this on my head..
look at the transparent terminal
look at the transparent terminal
-
- Member
- Posts: 283
- Joined: Mon Jan 03, 2011 6:58 pm
Re: Undefined Error
What does your build.sh contain?
- Monk
- Monk
-
- Posts: 7
- Joined: Sun Nov 02, 2014 12:58 am
Re: Undefined Error
that automates the source compiling and linking
-
- Member
- Posts: 283
- Joined: Mon Jan 03, 2011 6:58 pm
Re: Undefined Error
Sorry that I was not more clear. Post the contents of your build.sh here in code tags, or to a site like pastebin.net so that we can see what commands you are actually executing.chinnambhrt wrote:that automates the source compiling and linking
Even better would be a console log with all those commands and their results visible.
- Monk
Re: Undefined Error
From the image that you provided I conclude that you're compiling C++ code. Are you sure that in your C++ code the function is declared as extern "C"? extern "C" is not the same as extern. Also, does your C/C++ compiler expect identifiers to be prefixed or suffixed by an underscore character inside object files/libraries? If it does, you need to adjust your asm code appropriately.chinnambhrt wrote:Yes..I've declared extern in my C code and Global in Assembly code..but still i've this on my head..
look at the transparent terminal
Re: Undefined Error
IMHO: there's problem with filenames, they are all upper-case. I think that it leads compiler to a wrong idea that code in files is in C++, not C.
Man, it's not DOS, size^W character case matters here.
Man, it's not DOS, size^W character case matters here.
Re: Undefined Error
Surely the messages show that if it were C++ it wouldn't compile?alexfru wrote:From the image that you provided I conclude that you're compiling C++ code. Are you sure that in your C++ code the function is declared as extern "C"? extern "C" is not the same as extern. Also, does your C/C++ compiler expect identifiers to be prefixed or suffixed by an underscore character inside object files/libraries? If it does, you need to adjust your asm code appropriately.chinnambhrt wrote:Yes..I've declared extern in my C code and Global in Assembly code..but still i've this on my head..
look at the transparent terminal
Without seeing the source files or the build commands it's anybody's guess what the OP is doing wrong. (And I very much doubt that, as suggested elsewhere, the case of the filename has any bearing on it). Not a lot of point in guessing when a little more information would provide the answer.
-
- Member
- Posts: 5590
- Joined: Mon Mar 25, 2013 7:01 pm
Re: Undefined Error
It does.iansjack wrote:(And I very much doubt that, as suggested elsewhere, the case of the filename has any bearing on it).
Re: Undefined Error
Your right. I was completely mistaken. The output shows that the C++ compiler is being used.Octocontrabass wrote:It does.iansjack wrote:(And I very much doubt that, as suggested elsewhere, the case of the filename has any bearing on it).