Forum Discussion
Altera_Forum
Honored Contributor
21 years agoC++ Application
I was hoping someone out there is using Standard C++ on the Nios II. I can compile, link, and add to the filesystem the following code: # include <stdio.h> // hello_nios.cpp int main(int argc...
Altera_Forum
Honored Contributor
21 years agoHi wentao,
Thanks for the reply. I've tried your suggestions and it has not fixed the problem. The executable still just sits as if waiting for input. I plan on writing my app from scratch, so as yet I don't need any special library files. However, I need to be able to write and compile Standard C++ code. All documentation I've seen says this is in fact possible. See below for code and Makefile. I'm using the default Rules.mak.// hello_nios.cpp# include <iostream>
int main (int argc, char * argv) {
std::cout << "Hello NIOS" << std::endl;
return 0;
} Makefile: include Rules.mak
CFLAGS += -IC:/altera/kits/nios2/bin/nios2-gnutools/include/c++/3.4.1 -IC:/altera/kits/nios2/bin/nios2-gnutools/include/c++/3.4.1/nios2-elf
LDFLAGS += -mctors-in-init
LDLIBS := -lsupc++ $(LDLIBS)
all: hello_nios.exe Thanks in advance, Ryan