Go Back  Mac-Forums.com  > Software > OS X - Darwin and Development > The linker cannot find the libraries (do they exist?)

Reply
 
LinkBack Thread Tools
Old 11-01-2009, 08:32 PM   #1 (permalink)
pietrom

 
Member Since: Nov 01, 2009
Posts: 4
pietrom is on a distinguished road
The linker cannot find the libraries (do they exist?)

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;
}
pietrom is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Stumble this post
Reply With Quote
Old 11-01-2009, 09:54 PM   #2 (permalink)
wmprice1240
Banned
 
Member Since: May 03, 2009
Posts: 481
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
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.
wmprice1240 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Stumble this post
Reply With Quote
Old 11-02-2009, 08:10 PM   #3 (permalink)
pietrom

 
Member Since: Nov 01, 2009
Posts: 4
pietrom is on a distinguished road
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.
pietrom is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Stumble this post
Reply With Quote
Old 11-05-2009, 07:28 PM   #4 (permalink)
pietrom

 
Member Since: Nov 01, 2009
Posts: 4
pietrom is on a distinguished road
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.
pietrom is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Stumble this post
Reply With Quote
Old 11-05-2009, 07:38 PM   #5 (permalink)
wmprice1240
Banned
 
Member Since: May 03, 2009
Posts: 481
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
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
wmprice1240 is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Stumble this post
Reply With Quote
Old 11-07-2009, 10:04 PM   #6 (permalink)
pietrom

 
Member Since: Nov 01, 2009
Posts: 4
pietrom is on a distinguished road
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!
pietrom is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!Stumble this post
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

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 On

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 10:15 PM
Sharing iPhoto Libraries - Connection Issue loshman55 Airport, Networking and Wireless Technology 8 06-11-2008 09:21 AM
My video file can not find. christ30mac Movies and Video 2 06-08-2008 06:35 AM
Find Doesn't See Jpeg Titles soulfilet OS X - Operating System 0 05-31-2008 04:11 PM
What to use for a FIND command? bdmsb OS X - Operating System 23 03-24-2008 04:42 PM

 
 
 
     
Home Calendar Get New
     

Copyright ©2001-2009 Mac-Forums.com. All Rights Reserved. A division of iNET Interactive.

Other iNET Interactive Sites: Web Hosting Talk | Swish Talk | Hosting Catalog.com| Dev Papers| Deleted Domains| Hot Scripts

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