New To Mac-Forums?

Welcome to our community! Join the discussion today by registering your FREE account. If you have any problems with the registration process, please contact us!

Get your questions answered by community gurus Advice and insight from world-class Apple enthusiasts Exclusive access to members-only contests, giveaways and deals

Join today!

 
Start a Discussion
 

Mac-Forums Brief

Subscribe to Mac-Forums Brief to receive special offers from Mac-Forums partners and sponsors

Join the conversation RSS
OS X - Development and Darwin Discussion and questions about development for Mac OS X.

The linker cannot find the libraries (do they exist?)


Post Reply New Thread Subscribe

 
Thread Tools
pietrom

 
Member Since: Nov 01, 2009
Posts: 16
pietrom is on a distinguished road

pietrom is offline
I am a new Mac OS user, and I have problems building my programs. At the beginning the compiler was not found. I set the paths in ".profile", and that problem has been solved. Now the linker gives me errors such as:

error: iostream: No such file or directory

If I do not include *any* file (in a simple test program), I get:

ld: library not found for -lcrt1.10.6.o
collect2: ld returned 1 exit status

I suppose I did not install everything needed, but when I installed MacOS X 10.6 with XCode I just followed what indicated...

Thank you for any help,

Pietro

MacBook Pro 17" (2009)
MacOS X 10.6
gcc 4.2

Source code:

Code:
#include <iostream>
int main()
{
    std::cout << "Hello world!" << std::endl;
    return 0;
}
QUOTE Thanks
wmprice1240

 
Member Since: May 02, 2009
Posts: 480
wmprice1240 has a spectacular aura about
Mac Specs: MBP 2.33 4GB: MacPro 8 Core 2.8, 16GB: MacMini 2.26 4GB: MacMin 2.53 4GB: iPhone3GS 32GB

wmprice1240 is offline
Hi, welcome to the forums.

What type of project did you setup in XCode for the code you listed above? For C++ projects you should have chosen Command Line Tool->C++ std c++. It looks like you may not have created the correct project which in turn would prevent XCode from linking against the correct libraries.
QUOTE Thanks
pietrom

 
Member Since: Nov 01, 2009
Posts: 16
pietrom is on a distinguished road

pietrom is offline
In Xcode I have not been able to find: Command Line Tool->C++ std c++.
When I create a new project, all I can choose from is a generic empty project. Then looking at the project info I could see no such options...

I think the problem might not be Xcode, because I also have similar troubles working from the command line or from other IDEs (CodeBlocks). But I might be wrong.
QUOTE Thanks
pietrom

 
Member Since: Nov 01, 2009
Posts: 16
pietrom is on a distinguished road

pietrom is offline
Can anyone let me know how to link to my object code to the libraries? Do I have to specify the libraries' paths on a .config file or similar?
If you can tell me where I can find a good online tutorial to develop on MacOS X, it will be useful.
Thank you for your help.
QUOTE Thanks
wmprice1240

 
Member Since: May 02, 2009
Posts: 480
wmprice1240 has a spectacular aura about
Mac Specs: MBP 2.33 4GB: MacPro 8 Core 2.8, 16GB: MacMini 2.26 4GB: MacMin 2.53 4GB: iPhone3GS 32GB

wmprice1240 is offline
Quote:
In Xcode I have not been able to find: Command Line Tool->C++ std c++.
This is ultimately the problem. From the sound of it, you do not have XCode installed correctly. The Command line project templates come with the IDE by default. I would recommend uninstalling and reinstalling the IDE.

Quote:
Can anyone let me know how to link to my object code to the libraries?
This is what XCode does for you and should not require any action on your part. Again, I would recommend getting your environment up and running correctly before you do anything else.

Quote:
If you can tell me where I can find a good online tutorial to develop on MacOS X, it will be useful.
This is a good place to start:

Cocoa Dev Central
QUOTE Thanks
pietrom

 
Member Since: Nov 01, 2009
Posts: 16
pietrom is on a distinguished road

pietrom is offline
I solved the problem just reinstalling Xcode. Now I can compile from the command line, from the GUI, ... I can even use QtCreator.
Thank you wmprice1240!
QUOTE Thanks

Post Reply New Thread Subscribe


« Use Framework... Declared in... | OpenGL compatibility & Snow Leopard »
Thread Tools

Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off
Forum Jump

Similar Threads
Thread
Thread Starter
Forum
Replies
Last Post
Found touch... How find owner? ogacon iPod Hardware and Accessories 33 08-12-2009 09:15 PM
Sharing iPhoto Libraries - Connection Issue loshman55 Internet, Networking, and Wireless 8 06-11-2008 08:21 AM
My video file can not find. christ30mac Movies and Video 2 06-08-2008 05:35 AM
Find Doesn't See Jpeg Titles soulfilet OS X - Operating System 0 05-31-2008 03:11 PM
What to use for a FIND command? bdmsb OS X - Operating System 23 03-24-2008 03:42 PM

All times are GMT -4. The time now is 11:26 PM.

Powered by vBulletin
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
X

Welcome to Mac-Forums.com

Create your username to jump into the discussion!

New members like you have made this community the ultimate source for your Mac since 2003!


(4 digit year)

Already a member?