2009/5/15 Hendrik Sattler <[email protected]>

> Zitat von ankit jain <[email protected]>:
>
>> Linker error for many objects files that have created
>>
>
> So either the object file that contains the symbol is not part of your link
> command or you have a coding error.
> Since you release neither an example nor further information, you will
> probably not get any other answer.
>
> HS
>
Eg:

main
...Ident.c
....folder1
.......f11.c
.......f12.c
...folder2
......f21.c
......f22.c

Now if this Ident.c is there in each folder1 and folder2 then it works
well.. but since it is outside folder1 and fodler2 so while linking neither
f11 f12 f21 f22 will be able to link Ident.c

iam making library main as:
...CMakeLists of main folder.

foreach(fname ${folder1_srcs})
list(APPEND main_srcs folder1/${fname})
endforeach(fname)

foreach(fname ${folder2_srcs})
list(APPEND main_srcs folder2/${fname})
endforeach(fname)

list(APPEND main_srcs Ident.c)
add_library(main SHARED ${main_srcs})


CMakelist of folder1...

set(folder1_srcs f11.c f12.c)
set(folder1_srcs ${folder1_srcs} PARENT_SCOPE)

CMakelist of folder2...

set(folder2_srcs f21.c f22.c)
set(folder2_srcs ${folder2_srcs} PARENT_SCOPE)

Now all files iam getting from folder1 and folder2 and objects of all files
including Ident.c is created... But while linking f11.obj f12.obj f21.obj
f22.obj all show error undefined symbol:
char *v1

where Ident .c contains..

char v1[]="Hello";


I this example give you idea what iam trying to do...

Ankit
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the CMake FAQ at: 
http://www.cmake.org/Wiki/CMake_FAQ

Follow this link to subscribe/unsubscribe:
http://www.cmake.org/mailman/listinfo/cmake

Reply via email to