Eclipse / CDT-Install under Suse 10.1 [message #174506] |
Sun, 06 August 2006 18:16  |
Eclipse User |
|
|
|
Originally posted by: smartysmart34.web.de
Hi @ all,
I am trying to use Eclipse 3.1.1 with CDT 3.0.2 under Suse Linux 10.1. I
copied a small helloworld-Sourcefile and tried to run nit. For testing
purpose I added some lines so it looks like:
#include <stdio>
using namespace std;
int main ()
{
return 0;
cout << "Hallo";
}
When trying to build, I have following messages:
Severity Description Resource In Folder Location Creation Time Id
2 *** [main.o] Fehler 1 HalloWelt 7. August 2006 00:10:36 1214
2 *** [main.o] Fehler 1 HalloWelt 7. August 2006 00:10:36 1214
2 error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘namespace’
main.c HalloWelt line 3 7. August 2006 00:10:36 1211
2 error: (Each undeclared identifier is reported only once main.c HalloWelt
line 8 7. August 2006 00:10:36 1213
2 error: ‘cout’ undeclared (first use in this function) main.c HalloWelt
line 8 7. August 2006 00:10:36 1212
1 C/C++ Indexer Problem: Preprocessor Inclusion not found: stdio in
file: /mnt/remote/SoltauDebian_Public/data/martin_public/Entwicklu ng/Eclipse_HelloWorld/main.c
on line: 1. main.c HalloWelt line 1 7. August 2006 00:10:35 1209
So the includes and namespace do not work. But gcc installation should be OK
as I was repeatedly able to ./configer, make and make install.
Any hints? /usr/includes is included in the PATH-Variable. "echo $PATH"
shows:
/usr/include:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/us r/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/l ib/mit/sbin:/usr/lib/qt3/bin
So currently I do not have any clue and would appreciate any hint.
Kind regards,
Martin Soltau
|
|
|
Re: Eclipse / CDT-Install under Suse 10.1 [message #174672 is a reply to message #174506] |
Wed, 09 August 2006 12:42  |
Eclipse User |
|
|
|
Looks like you're using c++ in a c source file. The extension ".c" will
be taken to mean "this is a c source file", and the c compiler won't
like your syntax.
If you want to use C++, then change the filename to main.cpp (and make
sure the Eclipse project type is C++). Your #include should be
#include <iostream>
not <stdio>. In C++ you'd use either <stdio.h> or <cstdio>, but neither
one will give you 'cout' et al.
Finally, your return statement should be the last statement in the body
of main(){}, not the first.
Martin Soltau wrote:
> Hi @ all,
>
> I am trying to use Eclipse 3.1.1 with CDT 3.0.2 under Suse Linux 10.1. I
> copied a small helloworld-Sourcefile and tried to run nit. For testing
> purpose I added some lines so it looks like:
>
> #include <stdio>
>
> using namespace std;
>
> int main ()
> {
> return 0;
> cout << "Hallo";
> }
>
> When trying to build, I have following messages:
> Severity Description Resource In Folder Location Creation Time Id
> 2 *** [main.o] Fehler 1 HalloWelt 7. August 2006 00:10:36 1214
> 2 *** [main.o] Fehler 1 HalloWelt 7. August 2006 00:10:36 1214
> 2 error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘namespace’
> main.c HalloWelt line 3 7. August 2006 00:10:36 1211
> 2 error: (Each undeclared identifier is reported only once main.c HalloWelt
> line 8 7. August 2006 00:10:36 1213
> 2 error: ‘cout’ undeclared (first use in this function) main.c HalloWelt
> line 8 7. August 2006 00:10:36 1212
> 1 C/C++ Indexer Problem: Preprocessor Inclusion not found: stdio in
> file: /mnt/remote/SoltauDebian_Public/data/martin_public/Entwicklu ng/Eclipse_HelloWorld/main.c
> on line: 1. main.c HalloWelt line 1 7. August 2006 00:10:35 1209
>
> So the includes and namespace do not work. But gcc installation should be OK
> as I was repeatedly able to ./configer, make and make install.
>
> Any hints? /usr/includes is included in the PATH-Variable. "echo $PATH"
> shows:
> /usr/include:/usr/local/bin:/usr/bin:/usr/X11R6/bin:/bin:/us r/games:/opt/gnome/bin:/opt/kde3/bin:/usr/lib/mit/bin:/usr/l ib/mit/sbin:/usr/lib/qt3/bin
>
> So currently I do not have any clue and would appreciate any hint.
>
> Kind regards,
> Martin Soltau
|
|
|
Powered by
FUDForum. Page generated in 0.06299 seconds