Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
c++ code not getting compiled for arm platform
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
nightrapper
n00b
n00b


Joined: 26 Dec 2013
Posts: 1
Location: Hyderabad

PostPosted: Thu Dec 26, 2013 9:00 am    Post subject: c++ code not getting compiled for arm platform Reply with quote

Hi,

I'm using eldk tool for fdi-3250 board.I need to compile cpp code on board. For this i written a small cpp code and procedure as follows...

#include

using namespace std;
int main()
{
cout<<"Hello World!\n";
return 0;
}

compiled as follows:arm-linux-g++ 1.cpp -o pp

its giving following errors:
1.cpp:2:20: error: iostream: No such file or directory
1.cpp: In function 'int main()':
1.cpp:7: error: 'cout' was not declared in this scope

Please can someone provide me solution for it.
Back to top
View user's profile Send private message
paulj
Guru
Guru


Joined: 30 Sep 2004
Posts: 338
Location: Wales, UK

PostPosted: Fri Dec 27, 2013 9:49 am    Post subject: Reply with quote

Sorry if my comments are going to offend you, but you haven't tried very hard have you?

The problem is not the board you are using, but your c++ code.

I am not going to give you the answer, but I will give you some hints: have a closer look at your program, and confirm the syntax of the #include directive. Which include file is required to utilise the cout function? If you fix that line, you should be able to compile without any problems.
Back to top
View user's profile Send private message
franzf
Advocate
Advocate


Joined: 29 Mar 2005
Posts: 3839
Location: Irgendwo im Nirgendwo

PostPosted: Fri Dec 27, 2013 1:27 pm    Post subject: Reply with quote

paulj wrote:
Sorry if my comments are going to offend you, but you haven't tried very hard have you?

The problem is not the board you are using, but your c++ code.

I am not going to give you the answer, but I will give you some hints: have a closer look at your program, and confirm the syntax of the #include directive. Which include file is required to utilise the cout function? If you fix that line, you should be able to compile without any problems.

Read the compiler output and you will see that the issue you point at is a simple C&P-error:
Code:
1.cpp:2:20: error: iostream: No such file or directory

So you can be sure he correctly included iostream - but the compiler somehow does not search the correct include directories (if c++-headers are installed at all - qlist gcc | grep iostream)
_________________
"der mac dennoch wesen geil"
Wolfram von Eschenbach, Parzival (Buch 1, Z. 7).
Ein frühes Statement gegen Windows.

My overlay
Back to top
View user's profile Send private message
paulj
Guru
Guru


Joined: 30 Sep 2004
Posts: 338
Location: Wales, UK

PostPosted: Fri Dec 27, 2013 5:13 pm    Post subject: Reply with quote

franzf wrote:

Read the compiler output and you will see that the issue you point at is a simple C&P-error:
Code:
1.cpp:2:20: error: iostream: No such file or directory

So you can be sure he correctly included iostream - but the compiler somehow does not search the correct include directories (if c++-headers are installed at all - qlist gcc | grep iostream)


Thanks Franzf - that'll teach me to read the post more carefully! nightrapper - based on Franzf's comments, If you have a positive response from "qlist gcc | grep iostream", have a look at setting include paths for your compiler. I take it you have gentoo installed on the board?
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum