You are not logged in.
Pages: 1
Topic closed
Hi all,
can anybody tell me, what i'm doing wrong here?
i have installed eclipse-cdt with pacman and in my second try i downloaded it from eclipse.org.
I always get the same problems ..
I created a new Hello World c++ project, but i couldn't compile it successfully.
**** Build of configuration Debug for project test2 ****
make all
Building file: ../src/test2.cpp
Invoking: GCC C++ Compiler
g++ -O0 -g3 -Wall -c -fmessage-length=0 -MMD -MP -MF"src/test2.d" -MT"src/test2.d" -o"src/test2.o" "../src/test2.cpp"
../src/test2.cpp:9:20: warning: iostream: No such file or directory
../src/test2.cpp: In function 'int main()':
../src/test2.cpp:13: error: 'cout' was not declared in this scope
../src/test2.cpp:13: error: 'endl' was not declared in this scope
make: *** [src/test2.o] Error 1
Looks like the compiler don't find the includes and librarys. By default the include search paths for the compiler are
/usr/inlude
/usr/local/include
Then I added to the include path
/usr/include/c++/4.3.3
and to the librarys paths
/usr/lib
/usr/local/lib
then i got this result
**** Build of configuration Debug for project test ****
make all
Building file: ../src/test.cpp
Invoking: GCC C++ Compiler
g++ -I/usr/include -I/usr/include/c++/4.3.3 -I/usr/local/include -O0 -g3 -Wall -MMD -MP -MF"src/test.d" -MT"src/test.d" -o"src/test.o" "../src/test.cpp"
In file included from /usr/include/c++/4.3.3/iosfwd:46,
from /usr/include/c++/4.3.3/ios:44,
from /usr/include/c++/4.3.3/ostream:45,
from /usr/include/c++/4.3.3/iostream:45,
from ../src/test.cpp:9:
/usr/include/c++/4.3.3/bits/stringfwd.h:46: error: expected constructor, destructor, or type conversion before '(' token
/usr/include/c++/4.3.3/bits/stringfwd.h:55: error: expected type-specifier before 'allocator'
/usr/include/c++/4.3.3/bits/stringfwd.h:55: error: expected '>' before 'allocator'
/usr/include/c++/4.3.3/bits/stringfwd.h:60: error: template argument 3 is invalid
/usr/include/c++/4.3.3/bits/stringfwd.h:60: error: invalid type in declaration before ';' token
/usr/include/c++/4.3.3/bits/stringfwd.h:68: error: '_GLIBCXX_END_NAMESPACE' does not name a type
In file included from /usr/include/c++/4.3.3/cwchar:49,
from /usr/include/c++/4.3.3/bits/postypes.h:47,
from /usr/include/c++/4.3.3/iosfwd:47,
from /usr/include/c++/4.3.3/ios:44,
from /usr/include/c++/4.3.3/ostream:45,
from /usr/include/c++/4.3.3/iostream:45,
from ../src/test.cpp:9:
/usr/include/c++/4.3.3/cstddef:57: error: '::size_t' has not been declared
In file included from /usr/include/c++/4.3.3/bits/postypes.h:47,
from /usr/include/c++/4.3.3/iosfwd:47,
from /usr/include/c++/4.3.3/ios:44,
from /usr/include/c++/4.3.3/ostream:45,
from /usr/include/c++/4.3.3/iostream:45,
from ../src/test.cpp:9:
/usr/include/c++/4.3.3/cwchar:61: error: expected constructor, destructor, or type conversion before 'extern'
In file included from /usr/include/c++/4.3.3/ios:45,
from /usr/include/c++/4.3.3/ostream:45,
from /usr/include/c++/4.3.3/iostream:45,
from ../src/test.cpp:9:
/usr/include/c++/4.3.3/exception:40: error: expected declaration before end of line
make: *** [src/test.o] Error 1
by the way, if i take a other short c++ project and do the "make all" on console ... it works ..
any help?
Thanks
Offline
I use a build command 'make' for my C project, a 'dirty' quick fix (I maintain the Makefile myself).
Offline
if i disable the automatic build command and setup 'make' it's still the same result.
any other suggestion?
thx
Offline
I have the same problem here. This week I tried to install eclipse from pacman, and I also tried downloading the cdt version from eclipse.org, to my girlfriend's computer and I have the same problem you have. When I compile within eclipse, g++ can't find standard libraries. Invoking g++ from the shell, works as it should.
The strange thing is that in my main computer eclipse is able to compile perfectly.
By striving to do the impossible, man has always achieved what is possible. Those who have cautiously done no more than they believed possible have never taken a single step forward - Mikhail Bakunin
Offline
simply having Eclipse and CDT doesn't mean you have g++.
I had exactly the same problem.
Then I installed g++ and restarted Eclipse. The problem went away.
Offline
yaxi - welcome to the boards, please read the Forum Etiquette, particularly the necro-bumping entry:
https://wiki.archlinux.org/index.php/Fo … Bumping.27
Closing
Offline
Pages: 1
Topic closed