Forum Discussion

Altera_Forum's avatar
Altera_Forum
Icon for Honored Contributor rankHonored Contributor
15 years ago

C2H 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