# "Project1:0: Undefined symbols:"

## Recommended Posts

storage    175
I'm trying to compile my application with Xcode, but I'm getting these two compiler errors:
Project1:0: Undefined symbols:
Project1:0: warning prebinding disabled because of undefined symbols
I have no idea at all how to locate where this occurs, since it doesn't even tell me what file it is in. Does anyone have any idea what these weird errors are? Thanks in advance! Edit: Changed the title to a more relevant one [Edited by - storage on October 23, 2005 10:16:13 AM]

##### Share on other sites
SiCrane    11839
I believe those are linker errors, so there won't necessarily be a file associated with the errors. Go to your linker properties, check the OTHER_LDFLAGS and see if the -prebind flag is there. If it is, try removing it. If it isn't check your environment variables and see if LD_PREBIND is defined, if it is, try removing it and relaunching XCode.

##### Share on other sites
storage    175
Thanks!

That took care of the prebinding warning, but the other error is still here.
Project1:0: Undefined symbols:

LD_PREBIND isn't defined.

Thanks again :)

##### Share on other sites
storage    175
I really, really hate to bump this, but I can't do any programming :(.

I have tried everything I could think of, including starting a new project, rebooting, starting a new project of another type etc.

Nothing is helping.

Thanks again, and sorry for bumping.

##### Share on other sites
Guest Anonymous Poster
First of all, if you get link errors, then don't just take out those things like the second poster suggested. I would undo what he told you to do, put back in the binding stuff. There is something wrong with your code...try posting it so we can help better.

##### Share on other sites
mnansgar    421
Is it a Win32 application? Have you included all of the necessary library files (eg winmm.lib, etc.)? Take a look at line 0 of your code due to the weird Project1:0.

##### Share on other sites
storage    175
It's not a win32 application, it's called an "SDL OpenGL Application" project in Xcode, and I haven't changed any of the linked frameworks/libraries.

Posting the code would take up too much space, and I can't post parts of it, since I don't have any clue at all where the error occurs.

Edit: I think I have semi-located the error:
#ifndef _FILE_H_#define _FILE_H_#include <iostream>#include <fstream>namespace io{		class file		{			public:				/* various member functions */			private:				const char *filename;				unsigned long filesize;				std::fstream handle; // <- this line, removing it removes the "undefined symbol" error		};}#endif

But I need the std::fstream for the file opening, reading, writing etc in the class itself.

##### Share on other sites
storage    175
I currently feel really stupid.

The error appeared as "Project1:0: Undefined symbols:", because there is some weirdness with linebreaks and the build log. So I copied the error, and pasted it in a text editor, and then I saw where the undefined symbols where.

Thanks everyone, and sorry for the posts.

##### Share on other sites
SiCrane    11839
Quote:
 Original post by Anonymous PosterFirst of all, if you get link errors, then don't just take out those things like the second poster suggested. I would undo what he told you to do, put back in the binding stuff. There is something wrong with your code...try posting it so we can help better.

That shows ignorance of what the prebind linker flag does. Prebind is a speed optimization for loading executables in OS X 10.2+ similar to rebasing on Windows machines, but less forgiving. Disabling prebinding has no effect on program correctness. You can get prebind linker errors just from using dynamic libraries linked on a pre-10.2 machine; prebind linker errors don't necessarily indicate there's anything wrong with his code.