HI, everyone!
CCS5.3 & 6678 & WINXP
I tried to create a dll in CCS, I followed the following steps and I wonder if the file created is a dll?
1. created an empty ccs project , set the output type as "Others..." since I want a dll.(there are executable and static library).
2. created a .c file with the code :
#include <stdio.h>
__declspec(dllexport) int start();
int start()
{
printf("Hello World\n");
return 0;
}
3. I set the dynamic linking support options and changed the default output file name from .out to .dll
4. built the project and the dll was generated:
**** Build of configuration Debug for project dyna ****
"F:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
'Building file: ../hello.c'
'Invoking: C6000 Compiler'
"F:/ti/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6600 --abi=eabi -g --include_path="F:/ti/ccsv5/tools/compiler/c6000_7.4.1/include" --display_error_number --diag_warning=225 --diag_wrap=off --preproc_with_compile --preproc_dependency="hello.pp" "../hello.c"
'Finished building: ../hello.c'
' '
'Building target: dyna.dll'
'Invoking: C6000 Linker'
"F:/ti/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6600 --abi=eabi -g --display_error_number --diag_warning=225 --diag_wrap=off -z -m"dyna.map" -i"F:/ti/ccsv5/tools/compiler/c6000_7.4.1/lib" -i"F:/ti/ccsv5/tools/compiler/c6000_7.4.1/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --rom_model --dynamic=lib -o "dyna.dll" "./hello.obj" -l"libc.a"
<Linking>
warning #10290-D: when creating dynamic libraries, option -c is not allowed
warning #10247-D: creating output section ".cio" without a SECTIONS specification
warning #10247-D: creating output section ".const" without a SECTIONS specification
warning #10247-D: creating output section ".const:.string" without a SECTIONS specification
warning #10247-D: creating output section ".far" without a SECTIONS specification
warning #10247-D: creating output section ".fardata" without a SECTIONS specification
warning #10247-D: creating output section ".sysmem" without a SECTIONS specification
warning #10247-D: creating output section ".text" without a SECTIONS specification
warning #10247-D: creating output section ".plt" without a SECTIONS specification
'Finished building target: dyna.dll'
' '
**** Build Finished ****
Q1: Now I wonder if this file truly a DLL?
Q2: if Q1 is no. Then what is the correct way to generate a dll?
Also, I want to call the start function in other ccs project, so I :
1.added import and export symbols
2:rebult the project
3. add the dll in another ccs project " test" which is simple like:
int main(void) {
start();
return 0;
}
4. added the dynamic lib path and import symbol to the test project
4. built test
**** Build of configuration Debug for project test ****
"F:\\ti\\ccsv5\\utils\\bin\\gmake" -k all
'Building target: test.out'
'Invoking: C6000 Linker'
"F:/ti/ccsv5/tools/compiler/c6000_7.4.1/bin/cl6x" -mv6600 --abi=eabi -g --display_error_number --diag_warning=225 --diag_wrap=off -z -m"test.map" -i"F:/ti/ccsv5/tools/compiler/c6000_7.4.1/lib" -i"F:/ti/ccsv5/tools/compiler/c6000_7.4.1/include" --reread_libs --warn_sections --display_error_number --diag_wrap=off --rom_model --rpath="F:/myworkspace_v5_3/test" --import=start -o "test.out" "./main.obj" -l"libc.a"
<Linking>
warning: Option --import is not valid without --dynamic or --sysv or --rom (ignored)
warning: Option --rpath is not valid without --dynamic or --sysv or --rom (ignored)
warning #10210-D: creating ".stack" section with default size of 0x400; use the -stack option to change the default size
undefined first referenced
symbol in file
--------- ----------------
start ./main.obj
error #10234-D: unresolved symbols remain
error #10010: errors encountered during linking; "test.out" not built
>> Compilation failure
gmake: *** [test.out] Error 1
gmake: Target `all' not remade because of errors.
**** Build Finished ****
Q3: Is this the right way to call functions from in a dll?
Q4: if Q3 is no . Then how to call up a dll?
Thank you,
yrj