I asked a question on this list several months ago about how to build a
Python binding to Sword on Windows, and am finally getting around to
trying to do it. One of the BPBible developers said that he "used a
modified project file based on the Visual Studio project for C# in the
bindings/swig/vstudio directory to build with." Since this seems to be
the most official way to do it, I am trying it now.
I'm not very familiar with C++ or Visual Studio projects, so I'm
struggling somewhat to figure out how to do this. I made a copy of the
file "libsword_csharpsword.vcproj" in the above-mentioned directory, and
named it "libsword_pythonsword.vcproj". Then I made several changes to
it to try to make it build a Python binding instead of a C# one.
When I try to build the project, I get the following output (the error
message doesn't seem very descriptive to me):
1>------ Rebuild All started: Project: libsword_pythonsword,
Configuration: Release Win32 ------
1>..\..\..\include\swbuf.h(362): error : Syntax error in input(3).
1>C:\Program
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(103,5):
error MSB3073: The command "swig -python -c++ -nodefaultctor -DNDEBUG
-DWIN32 -D_LIB -DREGEX_MALLOC -DSWUSINGDLL -module Sword -o Sword.cxx
-I.. -I../../../include ../sword.i
1>C:\Program
Files\MSBuild\Microsoft.Cpp\v4.0\Microsoft.CppCommon.targets(103,5):
error MSB3073: :VCEnd" exited with code 1.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========
I have attached the project file that I have been trying to use. If you
compare it to the C# project using a diff tool, you can see the changes
I have made. Are there some that I still need to make but am missing?
Also, if anyone else has made Python bindings to Sword on Windows this
way, I think it would be very helpful to see the VS project file that
they used.
Thank you.
-- Timothy
P.S. I am using Visual Studio 2010 Express Edition to try to make Python
3.3 bindings to Sword 1.7.2 using SWIG 3.0.0 on a Windows 8.1 PC. In
order to use the project file in VS2010, it must be converted from the
old format to the VS2010 format.
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8.00"
Name="libsword_pythonsword"
ProjectGUID="{0BD1471F-07D9-441C-9210-40A52770F2A1}"
RootNamespace="libsword"
AssemblyReferenceSearchPaths=""..\..\..\lib\vcppmake\vc8\Release""
>
<Platforms>
<Platform
Name="Win32"
/>
</Platforms>
<ToolFiles>
</ToolFiles>
<Configurations>
<Configuration
Name="Release|Win32"
OutputDirectory=".\Release"
IntermediateDirectory=".\Release"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=" swig -python -c++ -nodefaultctor -DNDEBUG -DWIN32 -D_LIB -DREGEX_MALLOC -DSWUSINGDLL -module Sword -o Sword.cxx -I.. -I../../../include ../sword.i "
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../../../apps/windoze/CBuilder5/InstallMgr/curl,../../../include,../../../src/utilfuns/win32,../../../apps/windoze/CBuilder5/InstallMgr/curl/include"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;REGEX_MALLOC;SWUSINGDLL"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Release/libsword.pch"
AssemblerListingLocation=".\Release/"
ObjectFile=".\Release/"
ProgramDataBaseFileName=".\Release/"
SuppressStartupBanner="true"
CompileAs="0"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug with ICU|Win32"
OutputDirectory=".\ICUDebug"
IntermediateDirectory=".\ICUDebug"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=" swig -python -c++ -nodefaultctor -module Sword -o Sword.cxx -I.. -I../../../include ../sword.i"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
AdditionalOptions="/D _CRT_SECURE_NO_DEPRECATE"
Optimization="0"
AdditionalIncludeDirectories="../../../../icu-sword/source/common,../../../../icu-sword/source/i18n,../../../include,../../../src/utilfuns/win32"
PreprocessorDefinitions="NDEBUG;WIN32;_LIB;REGEX_MALLOC;SWMAKINGDLL"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\ICUDebug/libsword.pch"
AssemblerListingLocation=".\ICUDebug/"
ObjectFile=".\ICUDebug/"
ProgramDataBaseFileName=".\ICUDebug/"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="0"
DisableSpecificWarnings="4996"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libsword.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Debug|Win32"
OutputDirectory=".\Debug"
IntermediateDirectory=".\Debug"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=" swig -python -c++ -nodefaultctor -module Sword -o Sword.cxx -I.. -I../../../include ../sword.i"
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories="../../../include,../../../src/utilfuns/win32"
PreprocessorDefinitions="_DEBUG;WIN32;_LIB;REGEX_MALLOC;SWMAKINGDLL"
BasicRuntimeChecks="3"
RuntimeLibrary="3"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\Debug/libsword.pch"
AssemblerListingLocation=".\Debug/"
ObjectFile=".\Debug/"
ProgramDataBaseFileName=".\Debug/"
BrowseInformation="1"
SuppressStartupBanner="true"
DebugInformationFormat="4"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libsword.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
<Configuration
Name="Release with ICU|Win32"
OutputDirectory=".\ICURelease"
IntermediateDirectory=".\ICURelease"
ConfigurationType="2"
InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops"
UseOfMFC="0"
ATLMinimizesCRunTimeLibraryUsage="false"
CharacterSet="2"
>
<Tool
Name="VCPreBuildEventTool"
CommandLine=" swig -python -c++ -nodefaultctor -DNDEBUG -DWIN32 -D_LIB -DREGEX_MALLOC -DSWUSINGDLL -module Sword -o Sword.cxx -I.. -I../../../include ../sword.i "
/>
<Tool
Name="VCCustomBuildTool"
/>
<Tool
Name="VCXMLDataGeneratorTool"
/>
<Tool
Name="VCWebServiceProxyGeneratorTool"
/>
<Tool
Name="VCMIDLTool"
/>
<Tool
Name="VCCLCompilerTool"
Optimization="2"
InlineFunctionExpansion="1"
AdditionalIncludeDirectories="../../../../icu-sword/include,../../../include,../../../src/utilfuns/win32,../../../apps/windoze/CBuilder5/InstallMgr/curl/include"
PreprocessorDefinitions="NDEBUG;_ICU_;WIN32;_LIB;REGEX_MALLOC"
StringPooling="true"
RuntimeLibrary="2"
EnableFunctionLevelLinking="true"
UsePrecompiledHeader="0"
PrecompiledHeaderFile=".\ICURelease/libsword.pch"
AssemblerListingLocation=".\ICURelease/"
ObjectFile=".\ICURelease/"
ProgramDataBaseFileName=".\ICURelease/"
SuppressStartupBanner="true"
CompileAs="0"
/>
<Tool
Name="VCManagedResourceCompilerTool"
/>
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG"
Culture="1033"
/>
<Tool
Name="VCPreLinkEventTool"
/>
<Tool
Name="VCLinkerTool"
AdditionalDependencies="libsword.lib"
/>
<Tool
Name="VCALinkTool"
/>
<Tool
Name="VCManifestTool"
/>
<Tool
Name="VCXDCMakeTool"
/>
<Tool
Name="VCBscMakeTool"
/>
<Tool
Name="VCFxCopTool"
/>
<Tool
Name="VCAppVerifierTool"
/>
<Tool
Name="VCWebDeploymentTool"
/>
<Tool
Name="VCPostBuildEventTool"
/>
</Configuration>
</Configurations>
<References>
<ProjectReference
ReferencedProjectIdentifier="{97449E5E-F880-4D22-933A-0D2FC32034D4}"
RelativePathToProject="..\..\..\lib\vcppmake\libsword.vcproj"
/>
</References>
<Files>
<Filter
Name="Sword Source Files"
>
<File
RelativePath=".\Sword.cxx"
>
</File>
</Filter>
<Filter
Name="Sword Header Files"
>
<File
RelativePath="..\..\..\include\apocrypha.h"
>
</File>
<File
RelativePath="..\..\..\include\canon.h"
>
</File>
<File
RelativePath="..\..\..\include\cdsourcemgr.h"
>
</File>
<File
RelativePath="..\..\..\include\cipherfil.h"
>
</File>
<File
RelativePath="..\..\..\include\defs.h"
>
</File>
<File
RelativePath="..\..\..\include\echomod.h"
>
</File>
<File
RelativePath="..\..\..\include\encfiltmgr.h"
>
</File>
<File
RelativePath="..\..\..\include\entriesblk.h"
>
</File>
<File
RelativePath="..\..\..\include\femain.h"
>
</File>
<File
RelativePath="..\..\..\include\filemgr.h"
>
</File>
<File
RelativePath="..\..\..\include\flatapi.h"
>
</File>
<File
RelativePath="..\..\..\include\ftpparse.h"
>
</File>
<File
RelativePath="..\..\..\include\gbffootnotes.h"
>
</File>
<File
RelativePath="..\..\..\include\gbfheadings.h"
>
</File>
<File
RelativePath="..\..\..\include\gbfhtml.h"
>
</File>
<File
RelativePath="..\..\..\include\gbfhtmlhref.h"
>
</File>
<File
RelativePath="..\..\..\include\gbfmorph.h"
>
</File>
<File
RelativePath="..\..\..\include\gbfosis.h"
>
</File>
<File
RelativePath="..\..\..\include\gbfplain.h"
>
</File>
<File
RelativePath="..\..\..\include\gbfredletterwords.h"
>
</File>
<File
RelativePath="..\..\..\include\gbfrtf.h"
>
</File>
<File
RelativePath="..\..\..\include\gbfstrongs.h"
>
</File>
<File
RelativePath="..\..\..\include\gbfthml.h"
>
</File>
<File
RelativePath="..\..\..\include\gbfwebif.h"
>
</File>
<File
RelativePath="..\..\..\include\Greek2Greek.h"
>
</File>
<File
RelativePath="..\..\..\include\GreekChars.h"
>
</File>
<File
RelativePath="..\..\..\include\greeklexattribs.h"
>
</File>
<File
RelativePath="..\..\..\include\hebrewmcim.h"
>
</File>
<File
RelativePath="..\..\..\include\hrefcom.h"
>
</File>
<File
RelativePath="..\..\..\include\latin1utf16.h"
>
</File>
<File
RelativePath="..\..\..\include\latin1utf8.h"
>
</File>
<File
RelativePath="..\..\..\include\listkey.h"
>
</File>
<File
RelativePath="..\..\..\include\localemgr.h"
>
</File>
<File
RelativePath="..\..\..\include\lzsscomprs.h"
>
</File>
<File
RelativePath="..\..\..\include\markupfiltmgr.h"
>
</File>
<File
RelativePath="..\..\..\include\multimapwdef.h"
>
</File>
<File
RelativePath="..\..\..\include\nullim.h"
>
</File>
<File
RelativePath="..\..\..\include\osisfootnotes.h"
>
</File>
<File
RelativePath="..\..\..\include\osisheadings.h"
>
</File>
<File
RelativePath="..\..\..\include\osishtmlhref.h"
>
</File>
<File
RelativePath="..\..\..\include\osislemma.h"
>
</File>
<File
RelativePath="..\..\..\include\osismorph.h"
>
</File>
<File
RelativePath="..\..\..\include\osismorphsegmentation.h"
>
</File>
<File
RelativePath="..\..\..\include\osisosis.h"
>
</File>
<File
RelativePath="..\..\..\include\osisplain.h"
>
</File>
<File
RelativePath="..\..\..\include\osisredletterwords.h"
>
</File>
<File
RelativePath="..\..\..\include\osisrtf.h"
>
</File>
<File
RelativePath="..\..\..\include\osisscripref.h"
>
</File>
<File
RelativePath="..\..\..\include\osisstrongs.h"
>
</File>
<File
RelativePath="..\..\..\include\osiswebif.h"
>
</File>
<File
RelativePath="..\..\..\include\papyriplain.h"
>
</File>
<File
RelativePath="..\..\..\include\rawcom.h"
>
</File>
<File
RelativePath="..\..\..\include\rawfiles.h"
>
</File>
<File
RelativePath="..\..\..\include\rawgbf.h"
>
</File>
<File
RelativePath="..\..\..\include\rawgenbook.h"
>
</File>
<File
RelativePath="..\..\..\include\rawld.h"
>
</File>
<File
RelativePath="..\..\..\include\rawld4.h"
>
</File>
<File
RelativePath="..\..\..\include\rawstr.h"
>
</File>
<File
RelativePath="..\..\..\include\rawstr4.h"
>
</File>
<File
RelativePath="..\..\..\include\rawtext.h"
>
</File>
<File
RelativePath="..\..\..\include\rawverse.h"
>
</File>
<File
RelativePath="..\..\..\include\regex.h"
>
</File>
<File
RelativePath="..\..\..\include\remotesourcemgr.h"
>
</File>
<File
RelativePath="..\..\..\include\roman.h"
>
</File>
<File
RelativePath="..\..\..\include\rtfhtml.h"
>
</File>
<File
RelativePath="..\..\..\include\sapphire.h"
>
</File>
<File
RelativePath="..\..\..\include\scsuutf8.h"
>
</File>
<File
RelativePath="..\..\..\include\stringmgr.h"
>
</File>
<File
RelativePath="..\..\..\include\strkey.h"
>
</File>
<File
RelativePath="..\..\..\include\swbasicfilter.h"
>
</File>
<File
RelativePath="..\..\..\include\swbuf.h"
>
</File>
<File
RelativePath="..\..\..\include\swcacher.h"
>
</File>
<File
RelativePath="..\..\..\include\swcipher.h"
>
</File>
<File
RelativePath="..\..\..\include\swcom.h"
>
</File>
<File
RelativePath="..\..\..\include\swcomprs.h"
>
</File>
<File
RelativePath="..\..\..\include\swconfig.h"
>
</File>
<File
RelativePath="..\..\..\include\swdisp.h"
>
</File>
<File
RelativePath="..\..\..\include\swdisprtf.h"
>
</File>
<File
RelativePath="..\..\..\include\swdisprtfchap.h"
>
</File>
<File
RelativePath="..\..\..\include\swfilter.h"
>
</File>
<File
RelativePath="..\..\..\include\swfiltermgr.h"
>
</File>
<File
RelativePath="..\..\..\include\swgenbook.h"
>
</File>
<File
RelativePath="..\..\..\include\swinputmeth.h"
>
</File>
<File
RelativePath="..\..\..\include\swinstallmgr.h"
>
</File>
<File
RelativePath="..\..\..\include\swkey.h"
>
</File>
<File
RelativePath="..\..\..\include\swld.h"
>
</File>
<File
RelativePath="..\..\..\include\swlocale.h"
>
</File>
<File
RelativePath="..\..\..\include\swlog.h"
>
</File>
<File
RelativePath="..\..\..\include\swmacs.h"
>
</File>
<File
RelativePath="..\..\..\include\swmgr.h"
>
</File>
<File
RelativePath="..\..\..\include\swmodule.h"
>
</File>
<File
RelativePath="..\..\..\include\swobject.h"
>
</File>
<File
RelativePath="..\..\..\include\swoptfilter.h"
>
</File>
<File
RelativePath="..\..\..\include\swremotemgr.h"
>
</File>
<File
RelativePath="..\..\..\include\swsearchable.h"
>
</File>
<File
RelativePath="..\..\..\include\swtext.h"
>
</File>
<File
RelativePath="..\..\..\include\swversion.h"
>
</File>
<File
RelativePath="..\..\..\include\swwinlog.h"
>
</File>
<File
RelativePath="..\..\..\include\sysdata.h"
>
</File>
<File
RelativePath="..\..\..\include\tbdisp.h"
>
</File>
<File
RelativePath="..\..\..\include\teiplain.h"
>
</File>
<File
RelativePath="..\..\..\include\teirtf.h"
>
</File>
<File
RelativePath="..\..\..\include\thmlfootnotes.h"
>
</File>
<File
RelativePath="..\..\..\include\thmlgbf.h"
>
</File>
<File
RelativePath="..\..\..\include\thmlheadings.h"
>
</File>
<File
RelativePath="..\..\..\include\thmlhtml.h"
>
</File>
<File
RelativePath="..\..\..\include\thmlhtmlhref.h"
>
</File>
<File
RelativePath="..\..\..\include\thmllemma.h"
>
</File>
<File
RelativePath="..\..\..\include\thmlmorph.h"
>
</File>
<File
RelativePath="..\..\..\include\thmlosis.h"
>
</File>
<File
RelativePath="..\..\..\include\thmlplain.h"
>
</File>
<File
RelativePath="..\..\..\include\thmlrtf.h"
>
</File>
<File
RelativePath="..\..\..\include\thmlscripref.h"
>
</File>
<File
RelativePath="..\..\..\include\thmlstrongs.h"
>
</File>
<File
RelativePath="..\..\..\include\thmlvariants.h"
>
</File>
<File
RelativePath="..\..\..\include\thmlwebif.h"
>
</File>
<File
RelativePath="..\..\..\include\treekey.h"
>
</File>
<File
RelativePath="..\..\..\include\treekeyidx.h"
>
</File>
<File
RelativePath="..\..\..\include\unicodertf.h"
>
</File>
<File
RelativePath="..\..\..\include\unixstr.h"
>
</File>
<File
RelativePath="..\..\..\include\untgz.h"
>
</File>
<File
RelativePath="..\..\..\include\url.h"
>
</File>
<File
RelativePath="..\..\..\include\utf16utf8.h"
>
</File>
<File
RelativePath="..\..\..\include\utf8arshaping.h"
>
</File>
<File
RelativePath="..\..\..\include\utf8bidireorder.h"
>
</File>
<File
RelativePath="..\..\..\include\utf8cantillation.h"
>
</File>
<File
RelativePath="..\..\..\include\utf8greekaccents.h"
>
</File>
<File
RelativePath="..\..\..\include\utf8hebrewpoints.h"
>
</File>
<File
RelativePath="..\..\..\include\utf8arabicpoints.h"
>
</File>
<File
RelativePath="..\..\..\include\utf8html.h"
>
</File>
<File
RelativePath="..\..\..\include\utf8latin1.h"
>
</File>
<File
RelativePath="..\..\..\include\utf8nfc.h"
>
</File>
<File
RelativePath="..\..\..\include\utf8nfkd.h"
>
</File>
<File
RelativePath="..\..\..\include\utf8transliterator.h"
>
</File>
<File
RelativePath="..\..\..\include\utf8utf16.h"
>
</File>
<File
RelativePath="..\..\..\include\utilfuns.h"
>
</File>
<File
RelativePath="..\..\..\include\utilstr.h"
>
</File>
<File
RelativePath="..\..\..\include\utilxml.h"
>
</File>
<File
RelativePath="..\..\..\include\versekey.h"
>
</File>
<File
RelativePath="..\..\..\include\versetreekey.h"
>
</File>
<File
RelativePath="..\..\..\include\zcom.h"
>
</File>
<File
RelativePath="..\..\..\include\zconf.h"
>
</File>
<File
RelativePath="..\..\..\include\zipcomprs.h"
>
</File>
<File
RelativePath="..\..\..\include\zld.h"
>
</File>
<File
RelativePath="..\..\..\include\zlib.h"
>
</File>
<File
RelativePath="..\..\..\include\zstr.h"
>
</File>
<File
RelativePath="..\..\..\include\ztext.h"
>
</File>
<File
RelativePath="..\..\..\include\zverse.h"
>
</File>
</Filter>
</Files>
<Globals>
</Globals>
</VisualStudioProject>
_______________________________________________
sword-devel mailing list: sword-devel@crosswire.org
http://www.crosswire.org/mailman/listinfo/sword-devel
Instructions to unsubscribe/change your settings at above page