This is the mail archive of the ecos-discuss@sourceware.org mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Building and linking 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 "USEECOS" 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)

3.  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.
===========================
A cigarette shortens your life by 2 min..
A beer shortens your life by 4 min..
A working day shortens your life by 8 hours!!!!..

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]