Re: [xml] libxml2-2.5.7 on vs.net - additonal



Okey now, removed LIBCMT.LIB from the linker. Changed from /MT to /MD
and added /R_REENTRANT manually to the compiler args. I don't know what
this means, and the built-in help that's usually good couldn't find
anything on it. Removed the R_ but still got no useful result. My
favourite online word translator couldn't translate it either. I guess
this is another fancy word that newbies shouldn't understand ;-)
Anyway, it's added now. There was no gui-thingie for it in the IDE that
I could find.

The compiler args (/R_REENTRANT not shown):
/Og /Ob2 /Oi /Ot /Oy /G6 /GA /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D
"_ATL_STATIC_REGISTRY" /D "_WINDLL" /GF /Gm /EHsc /MD /GS /Gy
/Fo"../Release/" /Fd"../Release/vc70.pdb" /W4 /nologo /c /Zi /Gz /TP

One small step for man, but one Big step for me =)
Soon this might work, yeah!

Oh, did I say /R_REENTRANT? I meant /D_REENTRANT. That defines a macro name
'_REENTRANT', which is a good thing to do, because the code checks for it
during the compilation and nothing will work good if it is not found :-)

That /Gz could be the problem with linking. It defaults the calling
convention to __stdcall, but libxml2 uses __cdecl. The difference is in the
stack cleanup generated by the compiler. In __stdcall, the callee cleans the
stack. In __cdecl, the caller does it. The good thing about __stdcall is
that the cleanup code is generated once per function, while in __cdecl it is
generated once per call. The drawback is that __stdcall function must have
fixed number of parameters. The C-runtime uses __cdecl, of course, because
common functions such as printf accept variable number of parameters.

If you have no idea what am I talking about, you can as well use __cdecl in
your program, you won't notice any difference. Try removing that /Gz from
the command line and see if it links properly.

Ciao,
Igor




[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]