Unknown Error `ld'

This is a discussion on Unknown Error `ld' within the C++ Programming forums, part of the General Programming Boards category; This pile of codes here has no errors in it when being compiled. However, when I tried to build it, ...

  1. #1
    Registered User
    Join Date
    Sep 2008
    Posts
    17

    Unknown Error `ld'

    This pile of codes here has no errors in it when being compiled. However, when I tried to build it, it says:

    Code:
    -------------- Build: Debug in Funtion2 ---------------
    
    Linking console executable: bin\Debug\Funtion2.exe
    collect2: cannot find `ld'
    Process terminated with status 1 (0 minutes, 0 seconds)
    0 errors, 0 warnings
    Here are my codes:

    Code:
    #include <iostream>
    #include <string>
    
    using namespace std;
    
    void Test( string language, string hugeNumber);
    
    int main()
    {
        string favourite = "C++";
        string favourite2 = "Java";
    
        Test( favourite, favourite2);
    
        return 0;
    }
    
    void Test ( string language, string hugeNumber)
    {
        cout<< "I like "<< language<< hugeNumber;
    }
    Please someone help me out. Thanks in advance.

    EDIT: I tried the following, but it still couldn't not work:

    Code:
    #include <iostream>
    #include <string>
    
    using namespace std;
    
    void Test(std::string language, std::string hugeNumber);
    
    int main()
    {
        std::string favourite = "C++";
        std::string favourite2 = "Java";
    
        Test(favourite,favourite2);
    
        return 0;
    }
    
    void Test ( std::string language, std::string hugeNumber)
    {
        std::cout<< "I like "<< language<< hugeNumber;
    }

  2. #2
    Registered User
    Join Date
    Jan 2005
    Posts
    7,319
    There is a problem with your compiler/IDE setup, not the code. It looks like it can't find the linker tool.

  3. #3
    Registered User
    Join Date
    Sep 2008
    Posts
    17
    Quote Originally Posted by Daved View Post
    There is a problem with your compiler/IDE setup, not the code. It looks like it can't find the linker tool.
    OMG, so what shall I do? Im currently use CodeBlock's IDE and the compiler which comes with it. Please recommand me to do something or give me some direction >.<

    I compiled some codes before, so why is there linkers problem?

  4. #4
    Registered User
    Join Date
    Jan 2005
    Posts
    7,319
    I honestly have no idea, and I'm not familiar with Code::Blocks. If you've gotten other code to work, try creating a new project and adding your code to that new project. Perhaps there's a bad setting in the current one.

    Maybe others here are familiar with a common problem with Code::Blocks that could cause the error.

  5. #5
    Registered User
    Join Date
    Sep 2008
    Posts
    17
    Quote Originally Posted by Daved View Post
    I honestly have no idea, and I'm not familiar with Code::Blocks. If you've gotten other code to work, try creating a new project and adding your code to that new project. Perhaps there's a bad setting in the current one.

    Maybe others here are familiar with a common problem with Code::Blocks that could cause the error.
    Actually, not just Codeblocks, I tried it before with Dev-C++. It also give me the same error.

    There was once, where I tried to compile a code in Dev-C++, it failed. It doesnt give any error. It just says something like "ld". However, when i compile it in Codeblock, it works. So I really need help T.T

  6. #6
    Registered User C_ntua's Avatar
    Join Date
    Jun 2008
    Posts
    1,853
    From other forums, they said that you might have might have not sed LD to the path. Don't know what exactly you should add. But in any case, you can always reinstall DevC++ or Codeblocks, IF that is not a big deal (like you have a lot of custom settings)

  7. #7
    Registered User
    Join Date
    Sep 2008
    Posts
    17
    Oh my fishing god! My compiler worked after I had reinstalled it! THANKS ALL! Im all hype right now I love you guys ^^

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Errors including <windows.h>
    By jw232 in forum Windows Programming
    Replies: 4
    Last Post: 07-29-2008, 01:29 PM
  2. Replies: 1
    Last Post: 09-10-2005, 06:02 AM
  3. Please Help - Problem with Compilers
    By toonlover in forum C++ Programming
    Replies: 5
    Last Post: 07-23-2005, 10:03 AM
  4. gggrrr, unknown problem with <fstream>
    By axlton in forum C++ Programming
    Replies: 5
    Last Post: 07-25-2003, 11:18 PM
  5. UNICODE and GET_STATE
    By Registered in forum C++ Programming
    Replies: 1
    Last Post: 07-15-2002, 03:23 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21