[CMake] Creating a dynamic library with a static library hidden inside

Michael Leong michael at voltage.com
Wed Jun 17 12:50:42 EDT 2009


[snip]



> >

> > When I try to link dynlib.dll into the executable, it complains about

> > a whole load of unresolved external symbols. I recognize them; they're

> > openssl symbols, and the problem goes away and links and runs just

> > fine if I add libeay32.lib and ssleay32.lib as dependencies of the

> > executable.

>

> Please post the output you get, in particular its interesting wether the undefined symbols are missing in code thats part of the executable or part of the library.

>

> Also I suggest to run nmake VERBOSE=1 (if you're using nmake generator) to see the actual compiler calls that cmake uses to compile the library and the executable and check wether the ssl-libs are really put into the library or not.



Using Visual Studio 2005 as the generator on Windows. Output below:



1>------ Rebuild All started: Project: testproject, Configuration: Debug Win32 ------

1>Deleting intermediate and output files for project 'testproject', configuration 'Debug|Win32'

1>Compiling...

// This is my source file that uses the dynamic library

1>lrfcbelowlimit.c

1>Linking...

// vibe.lib is the corresponding export library for dynlib.dll

1>vibe.lib(encodeschema.obj) : error LNK2001: unresolved external symbol _ASN1_OCTET_STRING_it

1>vibe.lib(recipinfo.obj) : error LNK2001: unresolved external symbol _ASN1_INTEGER_it

1>vibe.lib(appidencode.obj) : error LNK2001: unresolved external symbol _ASN1_GENERALIZEDTIME_it

1>vibe.lib(encodeid.obj) : error LNK2001: unresolved external symbol _ASN1_UTF8STRING_it

1>vibe.lib(icparams.obj) : error LNK2001: unresolved external symbol _ASN1_item_d2i

... and so forth ... more OpenSSL symbols ...

1>C:\Toolkit\testproject2\testproject\Debug\testproject.exe : fatal error LNK1120: 65 unresolved externals

1>Build log was saved at "file://c:\Toolkit\testproject2\testproject\testproject\Debug\BuildLog.htm"

1>testproject - 252 error(s), 1 warning(s)

========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========



Thanks again.

-Michael
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.cmake.org/pipermail/cmake/attachments/20090617/b87c46ac/attachment.htm>


More information about the CMake mailing list