<div dir="ltr">Hello,<br><br>The problem is that you are not exporting any symbols in your library.<br><br>On Windows even with shared libraries you have a .lib file that describes all the exported symbols.<br><br>Andy<br>
<br><div class="gmail_quote">On Tue, Oct 7, 2008 at 9:05 AM, Andrea Borsic <span dir="ltr"><<a href="mailto:Andrea.Borsic@dartmouth.edu">Andrea.Borsic@dartmouth.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Dear All,<br>
<br>
I am a recent user of CMake, and I cannot figure out how to tell CMake that a TARGET_LINK_LIBRARY is shared. I am working under Windows Xp with MS VisualStudio 2008, and the following is my CMakeLists file:<br>
<br>
PROJECT(Triangle)<br>
<br>
ADD_LIBRARY(triangle_lib SHARED triangle.c)<br>
<br>
ADD_EXECUTABLE(tricall tricall.c)<br>
<br>
TARGET_LINK_LIBRARIES(tricall triangle_lib)<br>
<br>
With the first target I am building a shared library 'triangle_lib.dll' and with the second target I'd like to build an executable 'tricall' that links to such library.<br>
<br>
Linking fails, as VS 2008 is looking for the static library 'triangle_lib.lib'. I have been searching the forums, and came across an example: TARGET_LINK_LIBRARIES(tricall SHARED triangle_lib), but then the linker looks for SHARED.lib, so 'SHARED' in not interpreted as a keyword but as the name of a library.<br>
<br>
Does anybody know how I should specify that I am linking against a shared library ?<br>
<br>
Thanks in advance for your advice,<br>
<br>
Best Regards,<br>
<br>
Andrea<br>
_______________________________________________<br>
CMake mailing list<br>
<a href="mailto:CMake@cmake.org" target="_blank">CMake@cmake.org</a><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>Lets bike the world together<br><a href="http://legoandy.com">http://legoandy.com</a><br>
</div>