Results 1 to 6 of 6
  1. #1
    The linker cannot find the libraries (do they exist?)

    Member Since
    Nov 01, 2009
    Posts
    16
    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;
    }

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

    Member Since
    May 02, 2009
    Posts
    480
    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.

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

    Member Since
    Nov 01, 2009
    Posts
    16
    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.

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

    Member Since
    Nov 01, 2009
    Posts
    16
    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.

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

    Member Since
    May 02, 2009
    Posts
    480
    Specs:
    MBP 2.33 4GB: MacPro 8 Core 2.8, 16GB: MacMini 2.26 4GB: MacMin 2.53 4GB: iPhone3GS 32GB
    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.

    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.

    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

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

    Member Since
    Nov 01, 2009
    Posts
    16
    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!

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Spotlight can't find files I know exist
    By davegross38 in forum OS X - Operating System
    Replies: 2
    Last Post: 12-12-2012, 07:29 AM
  2. Linker Command Failed Error, Please Help
    By Loon3y in forum iOS Development
    Replies: 2
    Last Post: 09-26-2012, 07:28 PM
  3. Linker Error Building OpenCV
    By Timo116 in forum OS X - Development and Darwin
    Replies: 0
    Last Post: 07-26-2012, 01:39 PM
  4. "linker input file unsed because linking not done",ABINIT
    By min4 in forum Running Windows (or anything else) on your Mac
    Replies: 0
    Last Post: 10-07-2008, 05:54 AM
  5. Installing the GNU Linker in Leopard
    By RDG in forum OS X - Development and Darwin
    Replies: 1
    Last Post: 08-01-2008, 01:37 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •