Monday, April 6, 2009

Changes for building Abiword in MSVC2008 [Thanks to sum1]

Index: src/af/xap/win/xap_Win32Dlg_About.cpp
===================================================================
--- src/af/xap/win/xap_Win32Dlg_About.cpp (revision 26019)
+++ src/af/xap/win/xap_Win32Dlg_About.cpp (working copy)
@@ -45,8 +45,8 @@

/*****************************************************************/

-extern unsigned char g_pngSidebar[]; // see ap_wp_sidebar.cpp
-extern unsigned long g_pngSidebar_sizeof; // see ap_wp_sidebar.cpp
+/*extern*/ unsigned char g_pngSidebar[1]; // see ap_wp_sidebar.cpp
+/*extern*/ unsigned long g_pngSidebar_sizeof = 1; // see ap_wp_sidebar.cpp

bool XAP_Win32Dialog_About::s_bEventLoopDone;

Index: src/wp/main/xp/abi_ver.cpp
===================================================================
--- src/wp/main/xp/abi_ver.cpp (revision 26019)
+++ src/wp/main/xp/abi_ver.cpp (working copy)
@@ -41,7 +41,7 @@
#endif /* ABI_BUILD_TARGET */

const char* XAP_App::s_szBuild_ID = ABI_BUILD_ID;
-const char* XAP_App::s_szAbiSuite_Home = ABIWORD_DATADIR;
+const char* XAP_App::s_szAbiSuite_Home = "";//ABIWORD_DATADIR;
const char* XAP_App::s_szBuild_Version = ABI_BUILD_VERSION;
const char* XAP_App::s_szBuild_Options = ABI_BUILD_OPTIONS;
const char* XAP_App::s_szBuild_Target = ABI_BUILD_TARGET;


======================================================================




Update as on October 2009:


When I tried to build Abiword using MSVC 2008, I got this error.

------ Build started: Project: LibAbiWord, Configuration: Debug Win32 ------

Compiling...

ap_wp_sidebar_static.cpp

Linking...

ap_wp_sidebar_static.obj : error LNK2005: "unsigned char * g_pngSidebar" (?g_pngSidebar@@3PAEA) already defined in xap_Win32Dlg_About.obj

ap_wp_sidebar_static.obj : error LNK2005: "unsigned long g_pngSidebar_sizeof" (?g_pngSidebar_sizeof@@3KA) already defined in xap_Win32Dlg_About.obj

Creating library C:\abi-trunk\msvc-2008\Debug\bin\LibAbiWord.lib and object C:\abi-trunk\msvc-2008\Debug\bin\LibAbiWord.exp

C:\abi-trunk\msvc-2008\Debug\bin\LibAbiWord.dll : fatal error LNK1169: one or more multiply defined symbols found

Build log was saved at "file://c:\abi-trunk\msvc-2008\LibAbiWord\Debug\BuildLog.htm"

LibAbiWord - 3 error(s), 0 warning(s)

------ Build started: Project: PluginOpendocument, Configuration: Debug Win32 ------

Linking...

LINK : C:\abi-trunk\msvc-2008\Debug\plugins\PluginOpendocument.dll not found or not built by the last incremental link; performing full link

Creating library C:\abi-trunk\msvc-2008\Debug\plugins\PluginOpendocument.lib and object C:\abi-trunk\msvc-2008\Debug\plugins\PluginOpendocument.exp

Embedding manifest...

Build log was saved at "file://c:\abi-trunk\msvc-2008\PluginOpendocument\Debug\BuildLog.htm"

PluginOpendocument - 0 error(s), 0 warning(s)

========== Build: 1 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

I replaced C:\abi-trunk\src\af\xap\win\xap_Win32Dlg_About.cpp with this. That gave me a rapid solution to the issue, but which is not the real fix for the issue I faced, of course.

No comments:

Post a Comment