Development :  K-Meleon Forum
K-Meleon development related discussions. 
Problem Building K-Meleon with Gecko 1.8.1 Static Debug Version
Posted by: Ken
Date: April 18, 2009 12:58AM

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@@B)
MfcEmbed.obj : error LNK2001: unresolved external symbol "unsigned int const kStaticModuleCount" (?kStaticModuleCount@@3IB)
..\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

Options: ReplyQuote
Re: Problem Building K-Meleon with Gecko 1.8.1 Static Debug Version
Posted by: guenter
Date: April 18, 2009 04:10PM

Quote
Ken
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 ac_add_options --enable-debug

ac_add_options --disable-shared --enable-static --disable-libxul


Little trouble when building K-Meleon statically.
Posted by: Hao Jiang

Date: May 11, 2005 11:37PM

But there was not resolution.


Only Dorian builds the GREs, exes and kplugins for K-Meleon. In May 2005 AFAIR he was not here to read or help and the project had only users that tried to help themselves.

I did not get further than You. Your Error might come from missing files. The errors are possibly specific to MFCembed modules.

AFAIK K-Meleon needs MFC header files. It is an MFC application. They are AFAIR only available with some commercial Microsoft development products and might be possibly shipped with Microsoft Platform SDK for Windows Server 2003 R2 (that is the only Microsoft SDK that mentiones that 32 bit MFC files are included "\Include Header and IDL files to support development, including ATL, CRT, and MFC").

Best check whether You have them with Your compiler & tools.

I managed to build a static and a non static Seamonkey with 1.8.1.21 Gecko using the optimising 7.1 compiler from free Microsoft Visual C++ Toolkit 2003, some free .Net SDK Framework v1.1 files, ml.exe from masm32, Mozilla-Build version: 1.3. and free Microsoft Platform SDK for Windows Server 2003 R2. I used similar build options as You.


mk_add_options MOZ_OBJDIR=@TOPSRCDIR@/seamonkey
ac_add_options --enable-application=suite
ac_add_options --with-user-appdir="K-Meleon"

'ac_add_options --enable-optimize=-ML'
(that is done because I only have static multithreaded libs).

ac_add_options --enable-strip
ac_add_options --enable-crypto
ac_add_options --disable-debug

rest like You....

e.g. ac_add_options --enable-static (disable done also)


But the build can AFAIR not use K-Meleon's chrome since K-Meleon uses (since some versions) the same chrome.dll & xpt model as Firefox and SeaMonkey 2.

So finding how to build Seamonkey sources with Firefox chrome.dll & xpt model will be needed by You (& me) also.

p.s. The other thing I do not know is how to get a make file for K-Meleon.exe so that I can use my command line Microsoft® C/C++ Compiler Driver 13.10.3077.



Edited 2 time(s). Last edit at 04/19/2009 12:29AM by guenter.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.