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++
12600 Discussions

C2H. does not recognize functions.

Altera_Forum
Honored Contributor II
1,021 Views

Hi 

 

Every time I rightclick and selects the accelerated with ..... menu item,  

I get this error message: 

 

selection is not recognized as a function 

 

the text you have selected "(text)" is not a function. only functions can be accelerated. 

 

I have tried to select the function below in any possible way I can think of but without success. 

 

int this_is_a_function (int a) 

return a*2; 

 

BTW: I still uses NIOSII 7.2SP2.
0 Kudos
3 Replies
Altera_Forum
Honored Contributor II
307 Views

Try putting the function on the same line as the return type: 

 

int this_is_a_function(int a) 

return a*2; 

 

The C2H compiler runs the GCC preprocessor on the C file and then it takes it from there so it probably wasn't expecting the return type to be on a separate line. If that fixes it and you want to keep this style I suggest putting a '\' after the 'int' so that it'll be treated as a single line.
0 Kudos
Altera_Forum
Honored Contributor II
307 Views

Hi. I am having this issue now!! Still unable to solve it? Any ideas? did you manage to do solve it?

0 Kudos
Altera_Forum
Honored Contributor II
307 Views

Do you have some# define directive around this function? 

Sometime C2H might not recognize the function if it's in a# ifdef directive and the variable define condition variable is in another file. 

Also check out that whether or not Eclipse outline can see your function. Although it's not related to C2H but if you see it in the file outline, it means that the function is properly defined.
0 Kudos
Reply