Forum Discussion
Altera_Forum
Honored Contributor
16 years agoC2H Compilation Error - Explicit Inclusion
I am currently attempting to performing C2H hardware acceleration of a computationally intensive processing algorithm, specifically Dynamic Time Warping or DTW, commonly used in speech and image processing.
I have selected the function I wish to accelerate in the Nios II IDE, but am faced with the following error when I try to build the project: c:/altera/91/nios2eds/components/altera_avalon_c_hardware_accelerator/c_code_block.pm 6055 called (c_code_block::user_message) where 'c2h:147: c2h error: could not find function malloc -- implementations of all subroutines called by accelerator_dtwserver_dtw_calcvectorcost_mxn_c2h must be in the same .c file or# included explicitly. at file: , line: 147' occurred on c:/altera/91/nios2eds/components/altera_avalon_c_hardware_accelerator/c_code_block.pm 6111 Why I am getting the error that the compiler can't find malloc? I have included reference to the <stdlib.h> header file and this is sufficient for the compiler to build normally (when C2H is not used). Any ideas on how I can go about resolving this error would be very much appreciated. Weird aye!11 Replies
- Altera_Forum
Honored Contributor
It could be just a namespace collision with some other library used by your Quartus II project. For example if I wrote two custom components both with their own module called "MyWidget" Quartus II will flag this since you have two implementations of the same module. That is what I suspect is happening in your case, C2H is generating a module that happens to have the same name as something else used elsewhere in your hardware design.