[bt-devel] Last Windows Huzzah for tonight

Greg Hellings greg.hellings at gmail.com
Wed Feb 25 03:59:08 MST 2009


Sorry to cross-post this, but there is information that's probably
important to both the library and to Bibletime.  Attached are files (a
patch, a replacement file and a narrative) related to my building of
SWORD, Bibletime and associated things in Visual Studio.  Drudging
through the details of Build.txt might be a bit boring if you're not
following along, but there are some really nuanced things that I had
to work out which might benefit going back into the library source (a
few headers from SWORD had to either be modified or moved) and
Bibletime's source (there are a large number of files which need
editing and changing, not least of which is the source code itself).
So please, scour the build logic carefully, let me know if you know a
better way to do these things or if you need more information on how
or why I made edits to individual files or settings.  I have the
system down to just 7 unresoved external linker errors as follows:

2>cswordbackend.obj : error LNK2019: unresolved external symbol "void
__cdecl rewinddir(struct DIR *)" (?rewinddir@@YAXPAUDIR@@@Z)
referenced in function "public: bool __thiscall
CSwordBackend::moduleConfig(class QString const &,class
sword::SWConfig &)"
(?moduleConfig at CSwordBackend@@QAE_NABVQString@@AAVSWConfig at sword@@@Z)
2>cswordmoduleinfo.obj : error LNK2019: unresolved external symbol
"public: static class lucene::document::Field * __cdecl
lucene::document::Field::UnStored(char const *,char const *,bool)"
(?UnStored at Field@document at lucene@@SAPAV123 at PBD0_N@Z) referenced in
function "public: virtual void __thiscall
CSwordModuleInfo::buildIndex(void)"
(?buildIndex at CSwordModuleInfo@@UAEXXZ)
2>cswordmoduleinfo.obj : error LNK2019: unresolved external symbol
"public: static class lucene::document::Field * __cdecl
lucene::document::Field::UnIndexed(char const *,char const *)"
(?UnIndexed at Field@document at lucene@@SAPAV123 at PBD0@Z) referenced in
function "public: virtual void __thiscall
CSwordModuleInfo::buildIndex(void)"
(?buildIndex at CSwordModuleInfo@@UAEXXZ)
2>cswordmoduleinfo.obj : error LNK2019: unresolved external symbol
"public: __thiscall
lucene::analysis::standard::StandardAnalyzer::StandardAnalyzer(char
const * *)" (??0StandardAnalyzer at standard@analysis at lucene@@QAE at PAPBD@Z)
referenced in function "public: virtual void __thiscall
CSwordModuleInfo::buildIndex(void)"
(?buildIndex at CSwordModuleInfo@@UAEXXZ)
2>cswordmoduleinfo.obj : error LNK2019: unresolved external symbol
"public: char const * __thiscall lucene::document::Document::get(char
const *)const " (?get at Document@document at lucene@@QBEPBDPBD at Z)
referenced in function "public: virtual bool __thiscall
CSwordModuleInfo::searchIndexed(class QString const &,class
sword::ListKey &)"
(?searchIndexed at CSwordModuleInfo@@UAE_NABVQString@@AAVListKey at sword@@@Z)
2>cswordmoduleinfo.obj : error LNK2019: unresolved external symbol
"public: static class lucene::search::Query * __cdecl
lucene::queryParser::QueryParser::parse(char const *,char const
*,class lucene::analysis::Analyzer *)"
(?parse at QueryParser@queryParser at lucene@@SAPAVQuery at search@3 at PBD0PAVAnalyzer@analysis at 3@@Z)
referenced in function "public: virtual bool __thiscall
CSwordModuleInfo::searchIndexed(class QString const &,class
sword::ListKey &)"
(?searchIndexed at CSwordModuleInfo@@UAE_NABVQString@@AAVListKey at sword@@@Z)

As you can see, I'm very close - advice on tracking down these few
would be nice.  But I'm retiring for the night (morning).  Have a
blessed Ash Wednesday and Lent, everyone.

--Greg
-------------- next part --------------
Install VS 2008
Download and unpack the Qt4 source into a directory
Launch the VS 2008 Command Line from your Start Menu -> Visual Studio 2008 -> Visual Studio Tools -> Visual Studio 2008 Command Line
	-switch to the directory with the unpacked Qt4 source
	-run the command "configure" (this might take about a half hour or so)
	-run the command "nmake"  (this will probably take several hours)
Set an environment variable called QTDIR and set its value equal to the root of your Qt4 folder.
Add the Qt4 subdirectory bin\ to your Path
Create a directory on your Desktop called build
Download and unpack cURL into Desktop\build
Download and unpack sword-1.5.11 source into Desktop\build
	-open sword-1.5.11/lib/vcppmake/vc8/libsword.vcproj
	-Right click on "Solution 'libsword' (1 project)" -> Add -> Existing Project
	-Navigate to the Desktop\build\curl-<version>\lib\curllib.vcproj and open it
	-Right click on the libsword project entry in Solution Explorer -> Project Dependencies
	-Click the box so that libsword depends on curllib and select OK
	-Right click on curllib -> Properties then navigate to Configuration Properties -> C/C++ -> Preprocessor
	-Edit Preprocessor Definitions: remove _USRDLL and add CURL_STATICLIB
	-Select the Release configuration and repeat editing the Preprocessor Definitions
	-Select OK
	-Right click libsword -> Properties then navigate to Configuration Properties -> C/C++ -> General
	-Edit Additional Include Directories and add an entry for Desktop\build\curl-<version>\include
	-Under Configuration Properties -> C/C++ -> Preprocessor add CURLAVAILABLE and CURL_STATICLIB and SWMAKINGDLL to Preprocessor Definitions
	-Do the previous 2 steps again for the configuration Release with ICU and select OK when finished
	-Select File -> Save all
	-Select Build -> Batch Build -> set curllib to build both Release and Debug versions and choose Build
	-Right click libsword -> Properties and choose Linker -> General
	-In Additional Library Directories add an entry for Desktop\build\curl-<version>\lib\Debug
	-Under Release with ICU add an entry for Desktop\build\curl-<version>\lib\Release
	-Selec All Configurations from the drop down menus
	-Go to Configuration Properties -> Linker -> Input, under Additional Dependencies add curllib.lib, ws2_32.lib, winmm.lib and wldap32.lib and select OK when finished
	-Under libsword -> Sword Source Files right click -> Add -> Existing item and naviage to Desktop\build\sword-1.5.11\src\modules\filters\teihtmlhref.cpp
	-Repeat the above step for src\mgr\installmgr.cpp and src\mgr\curlftpt.cpp and src\modules\filters\osishtmlhref.cpp
	-Edit the file osishtmlhref.h and add the macro SWDLLEXPORT on line 17 between the words "class" and "MyUserData"
	-Right click libsword and select build.
	-Copy src\utilfuns\win32\dirent.h to include\
Download and unpack clucene-core to Desktop\build
	-In VC right click on Solution 'libsword' (2 projects) -> Add -> Existing Project and navigate to clucene-core-<version>\win32\CLucene.vcproj and open it
	-Select Build -> Batch Build and choose CLucene Debug and Release versions, then click Build
Open CMake and point its source AND binary directories to your CLucene directory and click "Configure."  After it is doing Configuring, click "Configure" again and select OK to the dialog that pops up.
	-Copy the file clucene-core-<version>\src\CLucene\clucene-config.h to clucene-core-<version>\build\lib\CLucene\clucene-config.h (you need to make this folder)
Download the Boost library headers and simply unpack them to Desktop\build - don't bother building or installing anything, all you need are headers
Pull the latest bibletime sources into Desktop\build into a directory titled bibletime-svn
	-Open Cmake and tell it the source is in the recently pulled SVN folder
	-Tell it to build in a parallel folder with -build or something like that
	-Click Configure and select Visual Studio 9 2008
	-Tell it to create the build directory, if it asks
	-When it complains about the Boost folders, click "Cancel" and check "Show Advanced Values."
	-For the first entry, Boost_INCLUDE_DIR, manually point it to Desktop\build\boost_<version>\
	-For CLUCENE_INCLUDE_DIR manually select Desktop\build\clucene-core-<version>\src
	-For CLUCENE_LIBRARY_DEBUG manually select Desktop\build\clucene-core-<version>\build\lib\clucene-coreUDMT.lib
	-For CLUCENE_LIBRARY_DIR select Desktop\build\clucene-core-<version>\build\lib
	-For CLUCENE_LIBRARY_RELEASE select Desktop\build\clucene-core-<version>\build\lib\clucene-coreUMT.lib
	-Click configure again and just select OK through all the error messages
	-Replace bibletime-svn\cmake\FindSword.cmake with the attached file and click "Configure" again
	-Once again, click "OK" through all the error messages
	-Now, manually edit the variables SWORD_INCLUDE_DIR to point to Desktop\build\sword-1.5.11\include
	-And finally edit SWORD_LIBRARY to point to Desktop\build\sword-1.5.11\lib\vcppmake\vc8\ICUDebug\libsword.lib
	-Click Configure again and select OK when CMake complains that it can't locate QTDBUS
	-Select the OK button next to the Configure button when it is available
	-Now go back to VS 2008 and right click on Solution 'libsword' (3 projects) -> Add -> Existing Project
	-Navigate to build\bibletime-build\bibletime.vcproj and open it
	-Right-click bibletime and select Set as StartUp Project
	-Right-click bibletime -> Properties; Configuration Properties -> C/C++ -> General, set Warning Level to Level 1
	-Edit the Additional Include Directories order and move the two bibletime entries to the top of the list, click Apply
	-Configuration Properties -> C/C++ -> Code Generation, select the Runtime Library as Multi-threaded Debug and hit Apply
	-Configuration Properties -> C/C++ -> Command Line, delete -Wall -O0 -g -fexceptions and hit Apply
	-Configuration Properties -> C/C++ -> General, edit Additional Include Directories and change the reference to sword-1.5.11\include\sword and just delete the final sword from it, click Apply.
	-Configuration Properties -> C/C++ -> Preprocessor, add SWUSINGDLL to the Preprocessor Definitions and hit Apply
	-Click OK to get out of the Properties Dialog
	-Right click Bibletime and select Project Dependencies, select CLucene and libsword and click OK
	-Edit src\backend\cswordmodulesearch.h and delete the line that reads #include <pthread.h>
	-Edit main.cpp and comment out lines 333 and 336
	-Edit src\frontend\cinfodisplay.cpp and change lines 239, 241, 249, 257, 259 references to variable 'i' to be for variable 'dummy'
	-Perform a search & replace on the current project for strcasecmp and replace it with stricmp and save the files that it modifies
	-Remove the file bibletime_dbus_adaptor.cpp from the project
	-Right click Bibletime and click Build
-------------- next part --------------
A non-text attachment was scrubbed...
Name: cswordmoduleinfo.patch
Type: application/octet-stream
Size: 3713 bytes
Desc: not available
URL: <http://www.crosswire.org/pipermail/bt-devel/attachments/20090225/05e417ba/attachment-0002.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: FindSword.cmake
Type: application/octet-stream
Size: 1449 bytes
Desc: not available
URL: <http://www.crosswire.org/pipermail/bt-devel/attachments/20090225/05e417ba/attachment-0003.obj>


More information about the bt-devel mailing list