



Compiling C++ code with or1k-elf-g++
by dadas on Mar 7, 2015 |
dadas
Posts: 4 Joined: Oct 26, 2014 Last seen: Feb 11, 2025 |
||
Hi all,
I am new on openrisc. Maybe this is an easy thing but i dont know..
I have installed gnu toolchain on linux mint 17..And now I am trying to compile my c++ codes but i cant..
When I add a basic c++ header like iostrem it gives me an error like "undefined reference to `_open_r'
collect2: error: ld returned 1 exit status" This makes me mad. If I delete the header from the code it runs an produces the elf file successfuly.. I think I have already compiled c++ libraries, because I can see them in opt/or1k-elf/bin.. libstdc++ files exist!! So what is the matter?? Why I cant compile??
Here is my sample code: If I make the header row comment, the code is compiled..but now it is not.
#include
//using namespace std;
class Rectangle {
int width, height;
public:
void set_values (int,int);
int area() {return width*height;}
};
void Rectangle::set_values (int x, int y) {
width = x;
height = y;
}
int main () {
Rectangle rect;
rect.set_values(3, 4);
//cout
|



