Hi everyone,
I try to build a dynamically linkable library using the C6000 CGT (from CCS v5).
For example, I created the simplest source file:
/* hello.c */
#include <stdio.h>
__declspec(dllexport) int hello(int a, int b);
int hello(int a, int b)
{
int result = b - a;
printf("Hello World, %d\n", result);
return result;
}
After this, I tried to build the file using gmake utility with --dynamic=lib option set. But I observed the following error message:
undefined first referenced
symbol in file
--------- ----------------
printf hello.obj
error: unresolved symbols remain
error: errors encountered during linking; "hello.dll" not built
But as I think, the printf function should be linked dynamically.
Linked libc.a (with --library=libc.a option set) the file is built successfully but the output binary file contains printf and many other function from libc.a. So, the size of the output file is large.
But it seems like the output file's size should be reduced using dynamic linking of libraries. What is wrong in my approach?
Regards,
Nikolay