c++ - unresolved inclusion with any include files -
i'm getting error running hello world program using eclipse. have installed mingw , cygwin, know need 1 have other editor uses 1 not other. have checked paths , symbols under gcc c++ compiler, links directories contain include files. however, still getting unresolved inclusion error on include files. i'm using windows 7. code:
#include <iostream> #include <strings> using namespace std; int main() { string yourname; cout << "enter name: "; cin >> yourname; cout << "hello " << yourname << endl; return 0; } this detailed error
description resource path location type symbol 'cin' not resolved test.c /hello_world/src line 17 semantic error symbol 'cout' not resolved test.c /hello_world/src line 16 semantic error symbol 'cout' not resolved test.c /hello_world/src line 18 semantic error symbol 'endl' not resolved test.c /hello_world/src line 18 semantic error type 'namespace' not resolved test.c /hello_world/src line 10 semantic error type 'string' not resolved test.c /hello_world/src line 14 semantic error any help? thanks
most likely, have selected create c project, in case eclipse sets tool chain use c compiler only.
since using c++, should create c++ project , create source files .cpp extension.
you try convert existing c project c++ project adjusting settings in project properties, easier create new project , copy files on (especially since seem starting, , not have big code base).
as can see in following picture, simplec has been created c-project - there, source code shows errors (even though have renamed .cpp).
the simplecpp project created c++ project - there, source code not show errors.

Comments
Post a Comment