Development :  K-Meleon Web Browser Forum
K-Meleon development related discussions. 
compiling/linking issues under msvc
Posted by: MetaTroN
Date: January 13, 2005 05:45PM

Hiho,

i'm trying to compile k-meleon and hit a few and very annoying snags.

no matter if i use msvc6 or msvc7.1, the compiler complains about:
- that there are default arguments in [kmeleon_plugin.h:struct kmeleonFunctions]
- [kmeleon_plugin.h:struct kmeleonPlugin:kmeleonFunctions *kf] is used under the name kFuncs in some places
- a few others i don't remember right now
So far, i seem to have fixed them.

But what i get now are 200+ linker errors about in total 38 different unresolved
symbols. I have to admit my way to success in compiling mozilla was a very
messy one and i think the libraries i got out of it are not useful for compiling
kmeleon:

baseembed_s.lib, 5kb (not embed_base_s.lib as states in the instructions)
nspr4.lib, 84kb
plc4.lib, 47kb
xpcom.lib, 10k

- this cannot be everything i need to link to; what am i missing here?
- could somebody please provide me with the proper libs i need to get kmel linked?

i just can't wait to finally be able to mess around with the source and eventually create something useful.

thanks in advance for your help

Options: ReplyQuote
Re: compiling/linking issues under msvc
Posted by: MetaTroN
Date: January 13, 2005 06:56PM

ok, i included xpcom_core.lib and it reduced the linker errors to:

MfcEmbed.obj : unresolved external symbol nsComponentManager::RegisterFactory (__imp_?RegisterFactory@nsComponentManager@@SAIABUnsID@@PBD1PAVnsIFactory@@H@Z) referenced in function "public: unsigned int __thiscall CMfcEmbedApp::OverrideComponents(void)"
UnknownContentTypeHandler.obj :unresolved external symbol CProgressDialog::GetSize(unsigned __int64 *)" (?GetSize@CProgressDialog@@UAGIPA_K@Z)
UnknownContentTypeHandler.obj : unresolved external symbol CProgressDialog::GetAmountTransferred(unsigned __int64 *)" (?GetAmountTransferred@CProgressDialog@@UAGIPA_K@Z)

It appears GetAmountTransferred and GetSize are not implemented anywhere, so i created two dummies for them in the hope to have a temporary fix.

The RegisterFactory issue is trickier:
the compiler throws
MfcEmbed.cpp: error C2653: 'nsComponentManager' : is not a class or namespace name
and when I add an
#include <nsComponentManagerObsolete.h>
above the function, i get that linker error.
I know xpcomcomponents_s.lib got that symbol without the leading "__imp_".

I'm quite pissed off now and need to bash something. bbl.

Options: ReplyQuote
Re: compiling/linking issues under msvc
Posted by: ra
Date: January 13, 2005 10:53PM

"MetaTroN",
<g>

I have to admit my way to success in compiling mozilla was a very
messy one


Could you please elaborate a bit on that sentence?

baseembed_s.lib, 5kb (not embed_base_s.lib as states in the instructions)
nspr4.lib, 84kb
plc4.lib, 47kb
xpcom.lib, 10k


Well, the size depends on the Mozilla version you compiled (I assume 1.7.5), the optimization you have chosen and the compiler you have used. Without knowing anything about your setup that's difficult to answer. The sizes I got were different, but I optimized for speed and not for size this time, so...

BTW: I don't know which instructions you followed either, but are you sure you didn't mix embed_base_s.lib and baseembed_s.lib? Just copy embed_base_s.lib (that's the current name, mozilla.org changed it a while back) and rename it to baseembed_s.lib and you'll be fine.

IIRC you should at least be able to compile some plugins without any errors (e.g. winamp) without having to mess with K-M project files. If you can't there's probably s.th. wrong with your setup. (BTW: In general MSCVC6 is easier to fix than 7, which is much more restrict...)

Have fun!

Options: ReplyQuote
Re: compiling/linking issues under msvc
Posted by: MetaTroN
Date: January 14, 2005 11:37AM

yo ra,

thanks for your speedy reply.

- messy mozilla : i'd rather not elaborate, the whole thing boils down to more or less "use make, not nmake"

- ah yes, the libs ... forget about the libs, i solved that problem. i updated my
personal top five of horrors with a second post ^^
i had already figured out the baseembed renaming trick.

- most of the plugins compile fine or i atm don't care about their frickn problems
(missing quicksort,stristr,EditProc,ViewProc). now i'm just stuck with problems
with the "k-meleon" project in the solution.

- thanks for the fun-wish smiling smiley i really could use some fun in relation to k-meleon compiling

- my most important question is atm: why does msvc look for an '__imp_?RegisterFactory@blabla'
and the xpcomcomponents_s.lib (which i take as the theoretical solution to the missing symbol problem) only got a '?RegisterFactory@blabla' symbol?
Interestingly, when i remove the NSCOM macro from the nsComponentManager class declaration (class NSCOM nsComponentManager... in nsComponentManagerObsolete.h) i open a whole different
whale's belly of linker errors. I'd love to know which slippery path here is the one to success sad smiley

P.S. was solln des ' "MetaTroN", <g>' ? ;p btw wär' ich wirklich metatron würd' ich mozilla in einen fisch verwandeln (den film dogma gesehen? winking smiley

P.P.S: make -f mozilla, not browser-wars ^^

Options: ReplyQuote
Re: compiling/linking issues under msvc
Posted by: ra
Date: January 15, 2005 01:31PM

- messy mozilla : i'd rather not elaborate, the whole thing boils down to more or less "use make, not nmake"

Yeah, okay, but either it worked or it didn't. So I'm wondering what can be be messy with your build. That was messy trial and error, wasn't it? But the build was fine in the end?

- most of the plugins compile fine

Great.

or i atm don't care about their frickn problems (missing quicksort,stristr,EditProc,ViewProc).

Just add qsort.c[pp] & stristr.c[pp] to the plugins and they should compile.

now i'm just stuck with problems with the "k-meleon" project in the solution.

Already solved?

i open a whole different whale's belly of linker errors. I'd love to know which slippery path here is the one to success sad smiley

C++ is soo nice... ;-/
I only added paths + libs and it worked (okay, it complained about three #endifs but that's solved in a second or two).

P.S. was solln des ' "MetaTroN", <g>' ? ;p btw wär' ich wirklich metatron würd' ich mozilla in einen fisch verwandeln (den film dogma gesehen? winking smiley

Metatron sagt mir was und Dogma kenn ich auch. Aber bei so einem Nick und v.a. mit dieser Schreibweise kann man sich eben das Grinsen nicht verkneifen. So schreiben doch nur kEwLe 14jährige dUdEs, oder? winking smiley Ist natürlich jedem seine aka Deine Sache, aber ich persönlich finde das geradezu peinlich, sorry. Nichts für ungut. :-)

Options: ReplyQuote
Re: compiling/linking issues under msvc
Posted by: mtt
Date: January 15, 2005 10:31PM


- with messy i indeed meant "messy trial and error". Of course the mozilla build worked, otherwise probably I wouldn't have gotten all these nice libs ^^

- thanks for the qsort/stristr.c hint @ ra .. worked like a charm lol

- add qsort.c/stristr.c here, add hist_view.cpp there, add this .lib, comment that #endif out .. i'm quiiiite pissed now, because for a windows-only project this is absolutely not understandable (it's maybe not fair, but the miranda im client project is at least as large and compiles at _once_).
i'm really eager to contribute to this fabulous browser effort, but there is practically NO resource or a strong enough activity on this forum to be of effective help.

- I was quite astonished to actually see a source compile because you remove a
#endif in a #if..#include..#endif block ... imo if anything, 0.9 shouldn't -ever- be released before the source is cleaned from that kind of bugs.
UPDATE: this sounds strange, but after fiddling around (maybe because of
disabling the UsePrecompiledHeader setting [think ra pointed that out somewhere])
the #endif problem reverted to normal. Now the only thing msvc complains about is

unresolved external symbol
"__declspec(dllimport) public: static unsigned int __cdecl nsComponentManager::RegisterFactory(struct nsID const &,char const *,char const *,class nsIFactory *,int)"
(__imp_?RegisterFactory@nsComponentManager@@SAIABUnsID@@PBD1PAVnsIFactory@@H@Z)

Anyone any idea ?

PS @ra : die schreibweise is aus meiner clanzockerzeit, also su smiling smiley
da du der einzige bist, der mir bis dato mir weiterhelfen konnte, werde ich meinen
nick deinen altersvorstellungen anpassen: mtt, kurz und kleingeschrieben, wie es
sich für nicht-kewle, nicht-14jährige gehört *g*
halbwegs ernsthaft: ob man sich den nick eines altägyptischen sonnengottes oder
eines erzengels gibt, ich finde das nicht gerade so einen großen unterschied. im
alter vielleicht 2 jahre maximal ;P

PPS: http://www.mozillastore.com/products/clothing/?mozstore=9cbe15891656bbb6833a55cbb6bb58e5
when are we going to see k-meleon shirts? grinning smiley

Options: ReplyQuote
Re: compiling/linking issues under msvc
Posted by: ra
Date: January 16, 2005 06:45PM

add qsort.c/stristr.c here, add hist_view.cpp there, add this .lib, comment that #endif out ..

It would just be too simple otherwise, wouldn't it?

Does K-M compile now?

PS @ra : die schreibweise is aus meiner clanzockerzeit, also su smiling smiley
da du der einzige bist, der mir bis dato mir weiterhelfen konnte, werde ich meinen nick deinen altersvorstellungen anpassen: mtt, kurz und kleingeschrieben, wie es
sich für nicht-kewle, nicht-14jährige gehört *g*


Thanks. ;-)

halbwegs ernsthaft: ob man sich den nick eines altägyptischen sonnengottes oder eines erzengels gibt, ich finde das nicht gerade so einen großen unterschied. im alter vielleicht 2 jahre maximal ;P

Nicht ganz. ra kommt von meinem (richtigen) Namen.

PPS: http://www.mozillastore.com/products/clothing/?mozstore=9cbe15891656bbb6833a55cbb6bb58e5
when are we going to see k-meleon shirts? grinning smiley


Dunno, but I hop never in a shop.

Options: ReplyQuote
Re: compiling/linking issues under msvc
Posted by: ra
Date: January 16, 2005 06:45PM

hope

Options: ReplyQuote
Re: compiling/linking issues under msvc
Posted by: Andrew
Date: January 17, 2005 04:01AM

mtt,

Developer support is available via the dev list. I know that Ra has been of help but Ulf, our main developer, pretty much only answers posts to the dev list.

Options: ReplyQuote
Re: compiling/linking issues under msvc
Posted by: mtt
Date: January 17, 2005 11:24AM

Andrew,

i joined the devlist, although with all these problems i feel more like a noob than a
developer lol. who knows, maybe my nagging will do some good and help write a
documentation about HowtoBuildKmeleon winking smiley

Options: ReplyQuote
Re: compiling/linking issues under msvc
Posted by: jsnj
Date: January 19, 2005 10:28AM

bump

Options: ReplyQuote
Re: compiling/linking issues under msvc
Posted by: Hao Jiang
Date: March 04, 2005 06:59PM

mtt:
Have you solved problems building K-Meleon now?

Hao

Options: ReplyQuote


K-Meleon forum is powered by Phorum.