| Problems compiling HELLOWORLD ¿??¿ [message #794711] |
Thu, 09 February 2012 11:04  |
guillermo roman Messages: 14 Registered: February 2012 |
Junior Member |
|
|
I have fix one problem with iostream, but still I have two errors in HELLO WORLD ¿?¿?¿
***********
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
***********
When I compile I have this two errors. In iostream I find a warning in c++config.h and it says that that file is not included. This is not true because I include its folder (c:/WinGW/lib/gcc/mingw32/4.6.2/include/c++/mingw32/bits/c++config.h).
On the other hand the console says:
**** 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.
So, it seems there is not error
This has not sense for me!!!
Any idea? please
Thanks in advance
|
|
|
|
|
|
| Re: Problems compiling HELLOWORLD ¿??¿ [message #795233 is a reply to message #794927] |
Fri, 10 February 2012 03: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
|
|
|
| Re: Problems compiling HELLOWORLD ¿??¿ [message #795245 is a reply to message #795233] |
Fri, 10 February 2012 03:40   |
Axel Mueller Messages: 1830 Registered: July 2009 |
Senior Member |
|
|
What you see are errors from the Eclipse indexer used for code analysis. It does not find some includes. This has nothing to do with the compiler!
There is no need to add system includes manually.
1) Create a new Hello World project
2) Select the correct toolchain (MinGW)
Does it work now? If not I need some more info to help you.
Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
|
|
|
|
|
| Re: Problems compiling HELLOWORLD ¿??¿ [message #795440 is a reply to message #795312] |
Fri, 10 February 2012 08:27   |
Axel Mueller Messages: 1830 Registered: July 2009 |
Senior Member |
|
|
guillermo roman wrote on Fri, 10 February 2012 11:17I forgot to tell you something:
That was the same problem I had in the first HelloWorld I did. I fixed some problems adding in ProjectProperties/Path&Symbols the "includes" in both C and C++:
\MinGW\lib\gcc\mingw32\4.6.2\include\c++
\MinGW\lib\gcc\mingw32\4.6.2\include\c++\mingw32\bits
As I said before there is no need to manually add the include paths. Eclipse should find them automatically. So something is wrong in your setup.
1) Select your project and choose project properties from the context menu
2) Goto C/C++ Build->Discovery Options
3) at the bottom of this page enable the option "Show output in a dedicated console..."
3) Clean your project and rebuild it
4) Post the output of the build console here
Before you ask
- search this forum
- see the FAQ http://wiki.eclipse.org/CDT/User/FAQ
- google
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.09701 seconds