|
|
|
|
Re: Problems compiling HELLOWORLD ¿??¿ [message #795233 is a reply to message #794927] |
Fri, 10 February 2012 08:23 |
guillermo roman Messages: 14 Registered: February 2012 |
Junior Member |
|
|
ok, tahnk you. I didn't post it because is the example of eclipse, but here is it
CODE:
//============================================================================
// Name : HelloWorld.cpp
// Author :
// Version :
// Copyright : Your copyright notice
// Description : Hello World in C++, Ansi-style
//============================================================================
#include <iostream>
using namespace std;
int main() {
cout << "!!!Hello World!!!" << endl; // prints !!!Hello World!!!
return 0;
}
PROBLEMS
***********
Description Resource Path Location Type
Symbol 'cout' could not be resolved HelloWorld.cpp /HelloWorld/src line 13 Semantic Error
Description Resource Path Location Type
Symbol 'endl' could not be resolved HelloWorld.cpp /HelloWorld/src line 13 Semantic Error
***********
Compiler information:
**** Internal Builder is used for build ****
g++ -IC:\MinGW\lib\gcc\mingw32\4.6.2\include\c++ -IC:\MinGW\lib\gcc\mingw32\4.6.2\include\c++\mingw32\bits -O0 -g3 -Wall -c -fmessage-length=0 -o src\HelloWorld.o ..\src\HelloWorld.cpp
g++ -LC:\MinGW\lib -LC:\MinGW\msys\1.0\lib -LC:\MinGW\lib\gcc\mingw32 -o HelloWorld.exe src\HelloWorld.o
Build complete for project HelloWorld
Time consumed: 295 ms.
1. So you are right, I get an .exe that it works, but I still have the errors?
2. I didn't include the symbols by my own, they were included when headers were added in ProjectProperties/Path&Symbols in both (C and C++ and also in Asembly). (It would be crazy to include all symbol by hand for every project?)
3. I include same libraries in Settings for GCC C compiler, GCC C++ compiler and MinGW C++ Linker
So, having include "iostream" I edite it. There are three includes in "iostream":
#include <bits/c++config.h>
#include <ostream>
#include <istream>
And I can see a warning/error in #include <bits/c++config.h>. This .h have been included in \MinGW\lib\gcc\mingw32\4.6.2\include\c++\mingw32\bits (look compiler info). I try to open it, form the right window of eclipse "Outline", and eclipse says that "Not include files were found that matched that name". But this is not true, in the tree of ProjectExplorer I can find it and open it, so is included, so eclipse would have to find it. ¿?
I don't understand what is wrong?
I am learning C++ and eclipse CDT right now, but this is the most difficult HELLO WORLD compilation I have seen ever!!
Thank you again
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.05919 seconds