View previous topic :: View next topic |
Author |
Message |
nightrapper n00b
Joined: 26 Dec 2013 Posts: 1 Location: Hyderabad
|
Posted: Thu Dec 26, 2013 9:00 am Post subject: c++ code not getting compiled for arm platform |
|
|
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 |
|
|
paulj Guru
Joined: 30 Sep 2004 Posts: 513 Location: Wales, UK
|
Posted: Fri Dec 27, 2013 9:49 am Post subject: |
|
|
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 |
|
|
franzf Advocate
Joined: 29 Mar 2005 Posts: 4565
|
Posted: Fri Dec 27, 2013 1:27 pm Post subject: |
|
|
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) |
|
Back to top |
|
|
paulj Guru
Joined: 30 Sep 2004 Posts: 513 Location: Wales, UK
|
Posted: Fri Dec 27, 2013 5:13 pm Post subject: |
|
|
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 |
|
|
|