On Friday 13 September 2013, SF Markus Elfring wrote:
...
> I have got still two open issues (on my side?).
> 
> 1. The target name can be resolved inside the build system. But how should
> I determine generated file names when I want to refer to them from
> external sources like installation directories?

Sorry, I don't really understand your question. What generated file names, and 
what external sources ?

> 2. I stumble on the following situation with the tools "CMake 2.8.11.2" and
> "GCC 4.7.2 20130108" on my openSUSE system.
> 
> ...
> make -f examples++/CMakeFiles/client_cpp.dir/build.make
> examples++/CMakeFiles/client_cpp.dir/build
> make[2]: Entering directory `/home/elfring/Projekte/libsocket/Bau'
> Linking CXX executable client
> cd /home/elfring/Projekte/libsocket/Bau/examples++ && /usr/bin/cmake -E
> cmake_link_script CMakeFiles/client_cpp.dir/link.txt --verbose=1
> /usr/bin/c++   -O2 -g -DNDEBUG    CMakeFiles/client_cpp.dir/client.cpp.o 
> -o client -rdynamic ../libsocket_cpp.a ../libisocket.a ../libusocket.a
> ../libsocket_cpp.a(inetclientstream.cpp.o): In function
> `libsocket::inet_stream::connect(char const*, char const*, int, int)':
> /home/elfring/Projekte/libsocket/lokal/C++/inetclientstream.cpp:101:
> undefined reference to `create_inet_stream_socket(char const*, char
> const*, char, int)' collect2: error: ld returned 1 exit status
> make[2]: *** [examples++/client] Error 1
> make[2]: Leaving directory `/home/elfring/Projekte/libsocket/Bau'
> ...
> 
> I find that strange because the library file which contains the "missed
> function" is usable for the C program examples as the software generation
> and a corresponding small test run acknowledges.

Probably one of two reasons:
You are using static libs, here the order of the libraries is significant. The 
library containing the function create_inet_stream_socket() must be listed 
after the file/library calling this function.

Or, since you are it seems mixing C and C++, you have a problem with symbol 
naming. Do you have the 
#ifdef __cplusplus
extern "C" {
#endif
in your C header files ?
Otherwise the C++ files see your C functions as C++ functions and expect C++ 
name mangled symbols.

Alex
--

Powered by www.kitware.com

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

Kitware offers various services to support the CMake community. For more 
information on each offering, please visit:

CMake Support: http://cmake.org/cmake/help/support.html
CMake Consulting: http://cmake.org/cmake/help/consulting.html
CMake Training Courses: http://cmake.org/cmake/help/training.html

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

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

Reply via email to