Forum Discussion
Altera_Forum
Honored Contributor
20 years agoReboot when running program with two .c files
I wrote a very simple test program that runs just fine: int main(int argc, char *argv)
{
unsigned char *p = (unsigned char *) malloc(2048*sizeof(unsigned char));
printf("Allocation via ma...
Altera_Forum
Honored Contributor
20 years ago --- Quote Start --- originally posted by squreshi@May 31 2006, 01:37 PM never mind - i figured out the problem. it was indeed a linker problem, or rather a build problem. i fired up eclipse and created a project in the ide, using one of the busybox makefiles as a template. my test program, consisting of two .c files, then ran correctly.
thanks again,
-sq
<div align='right'><{post_snapback}> (index.php?act=findpost&pid=15708)
--- quote end ---
--- Quote End --- If you work on Linux and install the binary toolchain, http://nioswiki.jot.com/wikihome/operating...binarytoolchain (http://nioswiki.jot.com/wikihome/operatingsystems/binarytoolchain) Then it is easy to compile the test program without even a Makefile. http://nioswiki.jot.com/wikihome/operating...ms/compilehello (http://nioswiki.jot.com/wikihome/operatingsystems/compilehello) Just, nios2-linux-uclibc-gcc test_malloc.c foo.c -o test_malloc -elf2flt