Menu

Linking error

Neo
2002-11-08
2012-09-26
  • Neo

    Neo - 2002-11-08

    Installed MinGW 2.0.3 today. The folder is D:\MinGW and my Dev-C++ folder is D:\Dev-C++.
    I copied:
        MinGW\lib\*.* to Dev-C++\lib
        MinGW\include\*.* to \Dev-C++\Include
        MinGW\bin\*.* to Dev-C++\bin
        MinGW\mingw32\bin\*.* to Dev-C++\bin
        MinGW\lib\gcc-lib\mingw32\3.2\*.* to Dev-C++\lib\gcc-lib\mingw32\3.2
       
    and deleted:
        Dev-C++\mingw32\*.*

    The result is that I could not build the following simple application:

    #include <iostream.h>
    #include <conio.h>

    int main(int argc, char *argv[])
    {
        cout << "Does this work?" << endl;
        _getch();

        return 0;
    }

    It compiles succesfully but got linking errors:

    [Linker error] undefined reference to `cout'
    [Linker error] undefined reference to `ostream::operator<<(char const*)'
    [Linker error] undefined reference to `endl(ostream&)'

    BTW, I'm using Dev-C++ 4.9.6.5.

    Need help...

     
    • Nobody/Anonymous

      Looks like its not getting the standard library, it is the sort of error you will see if you compile a C++ program with gcc rather than g++.  Assuming you did not name it something.c, which can cause that, is Dev now looking in the right place for your libraries?

      Wayne

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.