Nios® V/II Embedded Design Suite (EDS)
Support for Embedded Development Tools, Processors (SoCs and Nios® V/II processor), Embedded Development Suites (EDSs), Boot and Configuration, Operating Systems, C and C++
12590 Discussions

How to compile a uClinux C++ file in Nios IDE?

Altera_Forum
Honored Contributor II
1,256 Views

I'm having troubles compiling a very simple C++ program for uClinux in Nios IDE. It is a problem with multiple definitions of _start (by crt0, libc.a, etc). I saw other topics reporting that too, but I got no success solving that. 

 

Can anyone post a step-by-step (or any help) to set up the environment for C++ uClinux project in nios IDE?  

Someone has a makefile (and rules.mak) to build similar projects? (and a makefile for linux OS). 

 

Thnks a lot in advance!
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
319 Views

Hi francisinhori 

 

Actualy,it don't support c++.but you can test simple c++ prog. 

Here you have to change the rule.mk (CC := $(CROSS)g++) 

and you have to add some line in simple make file given for helo example. 

Sure, it will run. 

 

 

-slsnios
0 Kudos
Altera_Forum
Honored Contributor II
319 Views

 

--- Quote Start ---  

originally posted by slsnios@Sep 19 2006, 10:10 AM 

hi francisinhori 

 

actualy,it don't support c++.but you can test simple c++ prog. 

here you have to change the  rule.mk (cc          := $(cross)g++) 

and you have to add some  line in simple make file given for helo example. 

sure, it will run. 

 

 

-slsnios 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=18346) 

--- quote end ---  

 

--- Quote End ---  

 

 

I&#39;ve already tried this (CC:= $(CROSS)g++), but it didn&#39;t work. Has someone tried to compile with nios2-uClinux-g++ in linux OS? I got the binary nios 2 toolchain from nios wiki, but it says that c++ compiler is not installed, and the CrossGcc tutorial is only for newlib (instead of uclinux lib).
0 Kudos
Altera_Forum
Honored Contributor II
319 Views

 

--- Quote Start ---  

originally posted by francosinhori+sep 21 2006, 07:13 pm--><div class='quotetop'>quote (francosinhori @ sep 21 2006, 07:13 pm)</div> 

--- quote start ---  

<!--quotebegin-slsnios@Sep 19 2006, 10:10 AM 

hi francisinhori 

 

actualy,it don&#39;t support c++.but you can test simple c++ prog. 

here you have to change the  rule.mk (cc          := $(cross)g++) 

and you have to add some  line in simple make file given for helo example. 

sure, it will run. 

 

 

-slsnios 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=18346) 

--- quote end ---  

 

--- Quote End ---  

 

 

I&#39;ve already tried this (CC:= $(CROSS)g++), but it didn&#39;t work. Has someone tried to compile with nios2-uClinux-g++ in linux OS? I got the binary nios 2 toolchain from nios wiki, but it says that c++ compiler is not installed, and the CrossGcc tutorial is only for newlib (instead of uclinux lib). 

<div align='right'><{post_snapback}> (index.php?act=findpost&pid=18387)</div> 

[/b] 

--- Quote End ---  

 

 

 

hi 

u have to change Rules.mak 

1-> 

CC := $(CROSS)g++ 

2-> 

 

%.o : %.cpp Makefile 

$(CC) $(CFLAGS) $(WARNING_FLAGS) -c -o $@ $<  

 

write above two line in place of folowing lines:  

 

%.o : %.c Makefile 

$(CC) $(CFLAGS) $(WARNING_FLAGS) -c -o $@ $< 

 

%.o : %.cpp Makefile 

$(CC) $(CFLAGS) $(WARNING_FLAGS) -o $@ $<
0 Kudos
Reply