Re: Interpreting "undefined symbols"
Re: Interpreting "undefined symbols"
- Subject: Re: Interpreting "undefined symbols"
- From: Greg Guerin <email@hidden>
- Date: Sun, 16 Dec 2007 16:52:48 -0700
Adam wrote:
>Is this the same for C++, because I did a search for it, and there
>was nothing...
Yes it's the same for C++. I just tried it on a C++ project, and _main was
listed. It was a no-brainer, though, since my main() is in main.cp, which
compiles to main.o.
You might want to describe how you searched for main, or even post the
command-line. Here's the one I used as the first try at finding main:
nm *.o | grep main
Since it found a _main symbol of type 'T', I am sure that a _main function
is defined in one of my .o files. If you don't see any output from grep,
then you probably DON'T have _main defined, which would be consistent with
the linker error you get. If you DO have a symbol called main defined,
i.e. grep produces some output, please copy and paste its entire output
into an email and post it to the list.
I ran the above command-line in this sub-dir of my project folder:
build/MYPROJECT.build/Debug/MYTARGET.build/Objects-normal/i386
The "MYPROJECT" and "MYTARGET" are specific to my project and target, but
everything else is literal. This is for the Debug build configuration.
For the Release config, replace "Debug" in the above pathname with
"Release".
>int main(int argc, char *argv[])
>{
> ...
If you're going to post code, post the entire file with the #includes that
come before main(). It provides essential context for understanding your
code.
>[...]-o "/Users/atg/Desktop/Projects/Xcode Projects/Release/
>Tetris_020.app/Contents/MacOS/Tetris_020"[...]
>
>So I looked at the place it specified, and there was nothing in the
>"MacOS" folder.
You're looking in the wrong place. That;s the output of the linker. I
suggested that you look at the linker inputs, i.e. the .o files. Since the
linker is failing, there isn't any output, so of course there's nothing
there.
Please reread what I originally wrote. I didn't suggest looking in the -o
output location, but in the build folder of your project (see example
pathname above). I also suggested finding the -filelist option, not the -o
option.
-- GG
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden