Hi,
In any project I am developing when ever I try to include iostream I got the bunch of error as shown below. I am using F28335 and developing Non-BIOS program. Can anyone kindly tell me how to solve this problem.
This thread has been locked.
If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.
Hi,
In any project I am developing when ever I try to include iostream I got the bunch of error as shown below. I am using F28335 and developing Non-BIOS program. Can anyone kindly tell me how to solve this problem.
Evidently the trouble occurs only for C++-related headers. The fact that "class" is being considered an identifier instead of a keyword is a big clue. I suspect your application source code has a file name ending with .c, which by default is compiled as C, not C++. Try renaming the source file name to end in .cpp or .C.
Dear Douglas,
Actually, yes my file extension is .c and I have change it to .cpp and the iostream problem was solved. However, I start having another problem with linking although I am using the standard F283335.cmd file with no modifications. I wounder do I need to make any changes in the project properity to go from c to c++. I usually use the standard setting of the projects. Also, is it better to program with c or c++ in general?.Below is the errors that I got thank you very much for your help.
Regards,
The compiler has apparently created new sections, .cio and .sysmem as a result of the C++ code and functionality it required such as dynamic memory allocation, etc.
It is possible the original linker command file did not account for these sections and therefore you will need to modify it to allocate these sections to actual memory segments.
Regarding "is it better to program with c or c++", I'm not stepping into that epic battle of opinion. I'll just state the facts. The examples are developed using C. The compiler will support both C and C++.
Regarding C vs C++, there is a wiki topic that discusses the level of support with the TI compilers and some pros/cons of using it for embedded development:
http://processors.wiki.ti.com/index.php/Overview_of_C%2B%2B_Support_in_TI_Compilers
Thanks
ki
BrandonAzbell ,
I have added the sections and that take care of the warnings. However I still getting the erro "Placement fail for .text". I have tried to double the allocated size. However, I did not work. May you kindly help me with this.
Regards,
Nezar
I did exactly the following:
FLASHA which contain the flash is orginally:
FLASHA : origin = 0x338000, length = 0x007F80
FLASHB is not used and orginally
FLASHB : origin = 0x330000, length = 0x008000
I deleted FLASHB from page one so there is no reference for FLASHB at all in the linker file. I then declared FLASHA as following:
FLASHA : origin = 0x330000, length = 0x00FF80
Regards,
Okay. Very good.
What is the exact error? You mentioned placement error. Usually this comes with additional information indicating the size of .text is X and the available size of the memory segment is Y, etc.
I just mange to solve the error. The problem was in the inclusion statment. I changed
#include "iostream"
to
#include "iostream.h"
I wonder what is the difference between the two files in the include folder.
Regards,
Nezar Abou Qamar said:I have added the sections and that take care of the warnings. However I still getting the erro "Placement fail for .text". I have tried to double the allocated size. However, I did not work.
You need to look at the allocation of all sections. Please generate a map file with the ilnker option --map_file. This should show you what sections are consuming memory in the executable. This may help you adjust the linker command file to make everything fit.
i checked the length of the sections.
I compared the .text section with iostream.h & iostream and list it below:
iostream.h length:00003a07
iostream length:0001c776
Does this different in length make scense.
Thank you ,