Hello,
I am trying to build K-Meleon with the Gecko 1.8.1 Static Debug version.
Here is my build environment:
- Compiler: MSVC 7.1 (MSVC .NET 2003).
- Gecko source: Seamonkey-1.1.13.
- Mozilla-Build version: 1.3.
The static debug version of Gecko was built successfully with the following .mozconfig file:
mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/obj-suite-dbg-static
ac_add_options --enable-application=suite
ac_add_options --with-user-appdir="K-Meleon"
ac_add_options --disable-optimize
ac_add_options --enable-strip
ac_add_options --enable-crypto
ac_add_options --enable-extensions=cookie,wallet,xml-rpc,xmlextras,p3p,pref,transformiix,inspector,universalchardet,typeaheadfind,webservices,permissions
ac_add_options --enable-debug
ac_add_options --disable-shared --enable-static --disable-libxul
ac_add_options --disable-logging
ac_add_options --disable-dtd-debug
ac_add_options --disable-tests
ac_add_options --disable-ldap
ac_add_options --disable-postscript
ac_add_options --disable-jsd
ac_add_options --disable-composer
ac_add_options --disable-activex
ac_add_options --disable-activex-scripting
ac_add_options --disable-installer
ac_add_options --disable-xprint
ac_add_options --disable-mailnews
ac_add_options --disable-xpinstall
ac_add_options --disable-chatzilla
In the K-Meleon project I added the _BUILD_STATIC_BIN preprocessor directive. The build for K-Meleon project fails with the following linker errors:
--------
Linking...
embed_base_s.lib(nsEmbedAPI.obj) : warning LNK4217: locally defined symbol _NS_InitXPCOM3 imported in function _NS_InitEmbedding@16
embed_base_s.lib(nsEmbedAPI.obj) : warning LNK4217: locally defined symbol _NS_ShutdownXPCOM imported in function _NS_TermEmbedding@0
profdirserviceprovidersa_s.lib(nsProfileDirServiceProvider.obj) : warning LNK4217: locally defined symbol _NS_StringContainerInit imported in function "public: __thiscall nsString_external::nsString_external(void)" (??0nsString_external@@QAE@XZ)
profdirserviceprovidersa_s.lib(nsProfileDirServiceProvider.obj) : warning LNK4217: locally defined symbol _NS_StringContainerFinish imported in function "public: __thiscall nsString_external::~nsString_external(void)" (??1nsString_external@@QAE@XZ)
profdirserviceprovidersa_s.lib(nsProfileLock.obj) : warning LNK4049: locally defined symbol _NS_StringContainerFinish imported
profdirserviceprovidersa_s.lib(nsProfileDirServiceProvider.obj) : warning LNK4217: locally defined symbol _NS_StringGetData imported in function "public: unsigned short const * __thiscall nsString_external::get(void)const " (?get@nsString_external@@QBEPBGXZ)
profdirserviceprovidersa_s.lib(nsProfileDirServiceProvider.obj) : warning LNK4217: locally defined symbol _NS_StringContainerInit2 imported in function "protected: __thiscall nsString_external::nsString_external(unsigned short const *,unsigned int,unsigned int)" (??0nsString_external@@IAE@PBGII@Z)
profdirserviceprovidersa_s.lib(nsProfileLock.obj) : warning LNK4049: locally defined symbol _NS_StringContainerInit2 imported
profdirserviceprovidersa_s.lib(nsProfileDirServiceProvider.obj) : warning LNK4217: locally defined symbol _NS_CStringContainerInit2 imported in function "protected: __thiscall nsCString_external::nsCString_external(char const *,unsigned int,unsigned int)" (??0nsCString_external@@IAE@PBDII@Z)
profdirserviceprovidersa_s.lib(nsProfileDirServiceProvider.obj) : warning LNK4217: locally defined symbol _NS_CStringContainerFinish imported in function "public: __thiscall nsCString_external::~nsCString_external(void)" (??1nsCString_external@@QAE@XZ)
profdirserviceprovidersa_s.lib(nsProfileLock.obj) : warning LNK4049: locally defined symbol _NS_CStringContainerFinish imported
profdirserviceprovidersa_s.lib(nsProfileDirServiceProvider.obj) : warning LNK4217: locally defined symbol _NS_CStringContainerInit imported in function "public: __thiscall nsCString_external::nsCString_external(void)" (??0nsCString_external@@QAE@XZ)
profdirserviceprovidersa_s.lib(nsProfileLock.obj) : warning LNK4049: locally defined symbol _NS_CStringContainerInit imported
profdirserviceprovidersa_s.lib(nsProfileLock.obj) : warning LNK4217: locally defined symbol _NS_CStringGetData imported in function "public: char const * __thiscall nsCString_external::get(void)const " (?get@nsCString_external@@QBEPBDXZ)
MfcEmbed.obj : error LNK2001: unresolved external symbol "struct nsStaticModuleInfo const * const kPStaticModules" (?kPStaticModules@@3QBUnsStaticModuleInfo@@
MfcEmbed.obj : error LNK2001: unresolved external symbol "unsigned int const kStaticModuleCount" (?kStaticModuleCount@@3I
..\debug\k-meleon.exe : fatal error LNK1120: 2 unresolved externals
--------
Near the top of the k-meleon\StdAfx.h file I see the following:
........
#ifdef XPCOM_GLUE
#pragma comment(lib, "xpcomglue.lib")
#else
#ifdef _BUILD_STATIC_BIN
// Lot of shit to put here.
#else
#pragma comment(lib, "xpcomglue_s.lib")
#pragma comment(lib, "xpcom.lib")
#endif
#endif
#pragma comment(lib, "nspr4.lib")
#pragma comment(lib, "embed_base_s.lib")
#define _ATL_CSTRING_EXPLICIT_CONSTRUCTORS // some CString constructors will be explicit
// turns off MFC's hiding of some common and often safely ignored warning messages
#define _AFX_ALL_WARNINGS
........
What should go between the following?
#ifdef _BUILD_STATIC_BIN
// Lot of shit to put here.
#else
I searched around and found the following topic from a few years ago:
Little trouble when building K-Meleon statically.
Posted by: Hao Jiang
Date: May 11, 2005 11:37PM
But there was not resolution.
Thanks for all the help.
Ken