<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
<title></title>
</head>
<body bgcolor="#ffffff" text="#000000">
Pierre Malarme schrieb:
<blockquote cite="mid:6262BC18-3987-4064-AAEA-9C2D67908827@ulb.ac.be"
type="cite">
<div>hi,</div>
<div>i've taken your advice on the __declspec stuff and test it on a
hello world project. i do have a .lib now but with a warning </div>
<div>"</div>
<div><font size="1">hello.cxx</font></div>
<div>
<p>..\..\CMakeExample\Hello\hello.cxx(5) : warning C4273:
'Hello::Print' : inconsistent dll linkage</p>
<p>h:\workspace\cmakeexample\cmakeexample\hello\hello.h(18) : see
previous definition of 'Print'</p>
<p><font size="2">is that normal? <br>
</font></p>
</div>
</blockquote>
This means that you still have something wrong with your __declspec
definitions or the way that you include the library into other projects.<br>
<br>
SPCK_BASE_EXPORT must be __declspec(dllexport) when you build the
shared library itself<br>
SPCK_BASE_EXPORT must be __declspec(dllimport) when you import headers
from that library into other projects.<br>
<br>
This is handled correctly the way Martin has posted it.<br>
<br>
For this to work, Base_EXPORTS must be set only when you build the
shared library, and in must *not* be set in all other projects that
link against the library. So have a look at where you define
Base_EXPORTS, e.g. by adding ADD_DEFINITIONS(-DBase_Exports) in your
CMakeLists.txt or by #define Base_EXPORTS inside a header file. CMake
usually adds this automatically for DLL targets, so it should be right
when you build the DLL. Take care that it is not set in any projects
that use the library and that you don't define it in any header file of
the library.<br>
<br>
Hope this helps...<br>
<br>
Stefan<br>
<br>
</body>
</html>