Add static library with the Ecos Executable

Hi there,

I have a problem in to add a static library with an application executable for eCos. Actually I have two projects and have made three cmake files for both the project. One is to include the sub folders for the projects and second is for the project to create a static library by using cmake add_library statement and third cmake file is for the other project to build the executable for the eCos where I am link the the static library but I got the following errors;

Linking CXX executable helloDemo.elf CMakeFiles/helloDemo.dir/demo.o: In function `main': CMakeFiles/helloDemo.dir/demo.o(.text+0x19): undefined reference to `Hello::Print()' collect2: ld returned 1 exit status make[2]: *** [Demo/helloDemo.elf] Error 1 make[1]: *** [Demo/CMakeFiles/helloDemo.dir/all] Error 2 make: *** [all] Error 2

I think the eCos =93USEECOS=94 include does not support the add_library statement. Is there any way to create a static libray for the eCos executable or some thing like add_library .

Following are the list files.

1) CMakeList.txt in the root folder which include sub folders for the build.

project (HELLO) add_subdirectory (Hello) add_subdirectory (Demo)

2). CMakeList.txt in the hello project to build a static library. add_library (Hello hello.cxx)

  1. CMakeList.txt in the demo project to build an eCos executable . include(UseEcos) include_directories (${HELLO_SOURCE_DIR}/Hello) link_directories (${HELLO_BINARY_DIR}/Hello) ECOS_ADJUST_DIRECTORY(target_SRCS ${SRC_LIST}) ECOS_ADD_INCLUDE_DIRECTORIES() ECOS_USE_I386_ELF_TOOLS() ECOS_ADD_EXECUTABLE(helloDemo demo.cxx demo_b.cxx) target_link_libraries (helloDemo Hello)

Please provide some advise, it would really be appreciated.

Regards.

Reply to
Me On Line
Loading thread data ...

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.