I am working with CUnit and learning test driven development.
Please can someone help me out with the compilation part.
my command in terminal is:
gcc -main.c -o main
this is obviously not correct as i get the following output :
FOR EVERY FUNCTION
main.c:(.text+0x1ee): undefined reference to CU_initialize_registry'
main.c:(.text+0x1f7): undefined reference to
CU_get_error'
main.c:(.text+0x210): undefined reference to CU_add_suite'
main.c:(.text+0x22a): undefined reference to
CU_add_test'
main.c:(.text+0x240): undefined reference to CU_add_test'
main.c:(.text+0x256): undefined reference to
CU_add_test'
main.c:(.text+0x260): undefined reference to CU_set_output_filename'
main.c:(.text+0x265): undefined reference to
CU_automated_run_tests'
main.c:(.text+0x26a): undefined reference to CU_cleanup_registry'
main.c:(.text+0x26f): undefined reference to
CU_get_error'
collect2: ld returned 1 exit status
I need to know how to link the libcunit.a with the gcc .
I have tried gcc -o main main.c -L/usr/local/lib -Wl,-Bstatic -lcunit -Wl,-Bdynamic
It does comile and when i run ./main it sort of uses 100% cpu (continously) and there are no results !!!!
I have to exit the process using ctrl + c .