Is this a library that has built successfully before with another build system? Has this application been built successfully before?<div><br></div><div>For instances where the actual implementation is in the .h file, you usually must make sure you #include that header file in a cpp in your own application (the app linking against libraryname). .h files are not compiled on their own: when included in other cpp files, however, their contents are compiled and available to that object file. My hunch is you aren't #include-ing the .h files that contain these implementations.<div>
<br></div><div>Ryan<br><br><div class="gmail_quote">On Tue, Nov 16, 2010 at 1:03 PM, David Doria <span dir="ltr"><<a href="mailto:daviddoria@gmail.com">daviddoria@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I am trying to use ADD_LIBRARY to create a .lib file from a collection<br>
of .cpp and .h files.<br>
<br>
If I do:<br>
ADD_LIBRARY(LibraryName AllOfTheCPPFiles.cpp)<br>
<br>
and then try to link against that library, I get many missing-function<br>
type linker errors. I looked in the .h files and many of them have<br>
actual function definitions:<br>
<br>
(an example):<br>
class UdpTransmitSocket : public UdpSocket{<br>
public:<br>
UdpTransmitSocket( const IpEndpointName& remoteEndpoint )<br>
{ Connect( remoteEndpoint ); }<br>
};<br>
<br>
I tried to tell CMake to compile the .h files into the library as well<br>
by doing this:<br>
<br>
set(CMAKE_CXX_SOURCE_FILE_EXTENSIONS ${CMAKE_CXX_SOURCE_FILE_EXTENSIONS} h)<br>
ADD_LIBRARY(LibraryName AllOfTheCPPFiles.cpp AllOfTheHFiles.h)<br>
<br>
but it didn't seem to change anything. Is there a way this is typically handled?<br>
<br>
Thanks,<br>
<br>
David<br>
_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote></div><br><br clear="all"><br>-- <br>Ryan Pavlik<br>HCI Graduate Student<br>Virtual Reality Applications Center<br>Iowa State University<br><br><a href="mailto:rpavlik@iastate.edu">rpavlik@iastate.edu</a><br>
<a href="http://academic.cleardefinition.com">http://academic.cleardefinition.com</a><br>Internal VRAC/HCI Site: <a href="http://tinyurl.com/rpavlik">http://tinyurl.com/rpavlik</a><br>
</div></div>