0

I installed Netbeans and as C++ compiler I installed cygwin. I made a simple project to test out my installation, this is the code:

#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char** argv) {
    cout << "test";
    return 0;
}

This is the error message that it gives: http://pastebin.com/jRRh7MPi

I hope you guys can help me out.

4
  • Nothing wrong with the code, compile quite fine on ideone. ideone.com/MH30Y Commented Aug 9, 2012 at 9:24
  • Cygwin is not a compiler, is it? it's a compatibility layer. Based on that output, you're using gcc as a compiler. Make sure it's properly installed and not missing any libs. Commented Aug 9, 2012 at 9:29
  • Somehow you are building with gcc.exe when you should be building with g++.exe. Check project settings, and that you really created a C++ project and not a C project. Commented Aug 9, 2012 at 9:34
  • 2
    Also note that gcc 3.4.4 is 7 years old. An upgrade might be useful. Commented Aug 9, 2012 at 9:37

1 Answer 1

2

You need to either explicitly link to C++ standard library, or compile using g++ instead of gcc.

Sign up to request clarification or add additional context in comments.

2 Comments

Thanks, that did the job, I chose gcc instead of g++ as compiler
@AlexanderCogneau: if this was the right answer to your question, you should mark this answer as accepted with the green tick. Thanks! :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.