[bt-devel] How to configure BT with CMake in Windows?

Greg Hellings greg.hellings at gmail.com
Tue Nov 3 15:07:28 MST 2009


On Tue, Nov 3, 2009 at 4:00 PM, Eeli Kaikkonen
<eekaikko at mail.student.oulu.fi> wrote:
> On Tue, 3 Nov 2009, Eeli Kaikkonen wrote:
>> Found Sword library: D:/BT/sword/lib/vcppmake/vc8/Debug/libsword.lib
>> Found Sword library dir: D:/BT/sword/lib/vcppmake/vc8/Debug
>> Found Sword include dir: D:/BT/sword/include
>> Checking for required Sword version 1.6.0...
>> CMake Error at cmake/FindSword.cmake:99 (MESSAGE):
>>   Installed Sword version is NOT ok! Check program said: Exit code
>> 0xc0000135
>
> The installer installs libsword.dll, so it's built as dynamic library.
> Why then cmake finds libsword.lib which is statically linkable library?
> libsword.dll exists, but if I change the cmake value to point to that,
> it doesn't help:

One of the mysteries of the way Windows makes its dynamically linked
libraries (might be consistent with other systems, not sure) is that
the DLL is created as an "executable" and any of the symbols that it
exports are placed into the .lib.  The .lib is linked into the target
executable, and that library stub with those methods knows to look for
the DLL file to execute it in the proper way.  Without the .lib file,
the linker has no idea where to link the unresolved externals in the
executable so that they can call the necessary code in the DLL.  It
took me a long time to find that, since I was just used to seeing .a
and .so on Linux.

--Greg

>
> CMake Error at cmake/FindSword.cmake:89 (MESSAGE):
>  Sword version check program could NOT be compiled: Change Dir:
>  D:/BT/appbuild/CMakeFiles/CMakeTmp
>
>  Run Build Command:C:\PROGRA~1\MICROS~1.0\Common7\IDE\VCExpress.exe
>  CMAKE_TRY_COMPILE.sln /build Debug /project cmTryCompileExec
>
>  Microsoft (R) Visual C++ Express Edition Version 9.0.30729.1.
>  Copyright (C) Microsoft Corp 2007.  All rights reserved.
>
>  ------ Build started: Project: cmTryCompileExec, Configuration: Debug
> Win32
>  ------
>  Compiling...
>
>  Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 15.00.30729.01
> for
>  80x86
>  Copyright (C) Microsoft Corporation.  All rights reserved.
>
>  cl /Od /I "D:\BT\sword\include" /D "WIN32" /D "_WINDOWS" /D "_DEBUG"
> /D
>  "SWUSINGDLL" /D "CMAKE_INTDIR=\"Debug\"" /D "_MBCS" /FD /EHsc /RTC1
> /MDd
>  /Fo"cmTryCompileExec.dir\Debug\\"
>  /Fd"D:/BT/appbuild/CMakeFiles/CMakeTmp/Debug/cmTryCompileExec.pdb" /W3
> /c
>  /Zi /TP /Zm1000
>
>     "..\..\..\bibletime-svn\cmake\sword_version_compare.cpp"
>
>  sword_version_compare.cpp
>
>  Compiling manifest to resources...
>
>  Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
>  Copyright (C) Microsoft Corporation.  All rights reserved.
>
>  Linking...
>
>  D:\BT\sword\lib\vcppmake\vc8\Debug\libsword.dll : fatal error LNK1107:
>  invalid or corrupt file: cannot read at 0x2B0
>
>
>  Yours,
>        Eeli Kaikkonen (Mr.), Oulu, Finland
>        e-mail: eekaikko at mailx.studentx.oulux.fix (with no x)
>
> _______________________________________________
> bt-devel mailing list
> bt-devel at crosswire.org
> http://www.crosswire.org/mailman/listinfo/bt-devel
>



More information about the bt-devel mailing list