Discussion:
New to C++/Netbeans: "Unable to resolve Identifier" + "Cannot find include file"
Borginator
2010-06-08 16:58:12 UTC
Permalink
Firstly I have used Netbeans for Java projects.
I am currently running Netbeans 6.8 under Windows 7 32bit
I have used cygwin (following the instructions here on the Netbeans website) to install my C++ compiler and put the path for the bin directory on my machines Paths...

Now when I have the following code:

Code:

#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;

/*
*
*/
int main(int nNumberifArgs, char* pszArgz) {
int celsius;
cout << "Enter the temperature in Celsius:";
cin >> celsius;
int factor;
factor=212-32;
int fahrenheit;
fahrenheit= factor *celsius/100 +32;
cout << "Fahrenheit value is:";
cout << fahrenheit << endl;
system("PAUSE");
return 0;




The #include statements have the following error:

"Cannot find include file <NAME>" (where NAME is the name of the required include file)

and the cout/cin statements have the error "Unable to resolve identifier cout/cin "

The program will run and opens in an external terminal and works properly returning the following:


cygwin warning:
MS-DOS style path detected: C:\Program Files\NetBeans 6.8\dlight2\bin\nativeex
ecution\dorun.sh
Preferred POSIX equivalent is: /cygdrive/c/Program Files/NetBeans 6.8/dlight2/
bin/nativeexecution/dorun.sh
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
Consult the user's guide for more details about POSIX paths:
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Enter the temperature in Celsius:12
Fahrenheit value is:53
sh: PAUSE: command not found
Press [Enter] to close the terminal ...

Can someone please tell me how to fix the first two errors and enlighten me on the error of the terminal?

Many thanks in advance,
Simon
Paulo Rogério Panhoto
2010-06-09 02:42:11 UTC
Permalink
Hi,

The first two messages appear because your compiler's setting might be
different from your compiler's setting. You should go to *Tools*->*options*,
click *C++* and then *Code Assistance*.

Select *C++ compiler* and add the paths to the cygwin include directories.

Unfortunately I can't help with the third warning because I only use
Netbeans on Linux. My guess is that It might be related to the way you've
set up your project location.

Regards,

Paulo.
Post by Borginator
Firstly I have used Netbeans for Java projects.
I am currently running Netbeans 6.8 under Windows 7 32bit
I have used cygwin (following the instructions here on the Netbeans
website) to install my C++ compiler and put the path for the bin directory
on my machines Paths...
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
/*
*
*/
int main(int nNumberifArgs, char* pszArgz) {
int celsius;
cout << "Enter the temperature in Celsius:";
cin >> celsius;
int factor;
factor=212-32;
int fahrenheit;
fahrenheit= factor *celsius/100 +32;
cout << "Fahrenheit value is:";
cout << fahrenheit << endl;
system("PAUSE");
return 0;
"Cannot find include file <NAME>" (where NAME is the name of the required include file)
and the cout/cin statements have the error "Unable to resolve identifier cout/cin "
The program will run and opens in an external terminal and works properly
MS-DOS style path detected: C:\Program Files\NetBeans
6.8\dlight2\bin\nativeex
ecution\dorun.sh
Preferred POSIX equivalent is: /cygdrive/c/Program Files/NetBeans 6.8/dlight2/
bin/nativeexecution/dorun.sh
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Enter the temperature in Celsius:12
Fahrenheit value is:53
sh: PAUSE: command not found
Press [Enter] to close the terminal ...
Can someone please tell me how to fix the first two errors and enlighten me
on the error of the terminal?
Many thanks in advance,
Simon
ABC7
2010-06-14 13:43:32 UTC
Permalink
Post by Borginator
Firstly I have used Netbeans for Java projects.
I am currently running Netbeans 6.8 under Windows 7 32bit
I have used cygwin (following the instructions here on the Netbeans website) to install my C++ compiler and put the path for the bin directory on my machines Paths...
#include <cstdio>
#include <cstdlib>
#include <iostream>
using namespace std;
/*
*
*/
int main(int nNumberifArgs, char* pszArgz) {
int celsius;
cout << "Enter the temperature in Celsius:";
cin >> celsius;
int factor;
factor=212-32;
int fahrenheit;
fahrenheit= factor *celsius/100 +32;
cout << "Fahrenheit value is:";
cout << fahrenheit << endl;
system("PAUSE");
return 0;
"Cannot find include file <NAME>" (where NAME is the name of the required include file)
and the cout/cin statements have the error "Unable to resolve identifier cout/cin "
MS-DOS style path detected: C:\Program Files\NetBeans 6.8\dlight2\bin\nativeex
ecution\dorun.sh
Preferred POSIX equivalent is: /cygdrive/c/Program Files/NetBeans 6.8/dlight2/
bin/nativeexecution/dorun.sh
CYGWIN environment variable option "nodosfilewarning" turns off this warning.
http://cygwin.com/cygwin-ug-net/using.html#using-pathnames
Enter the temperature in Celsius:12
Fahrenheit value is:53
sh: PAUSE: command not found
Press [Enter] to close the terminal ...
Can someone please tell me how to fix the first two errors and enlighten me on the error of the terminal?
Many thanks in advance,
Simon
Hi

If you use MinGW then those terminal errors will be solved. cygwin use posix style of notation which is not used in MS windows. MinGW used native windows api and does not create any problems.

Thanks.

Loading...