[xsde-users] Building VS2015 Project that uses XSDE

Boris Kolpackov boris at codesynthesis.com
Tue Oct 20 10:50:55 EDT 2015


Hi Luke,

Hollenback, Luke <Luke.Hollenback at ballardtech.com> writes:

> Upon building the solution, which has all of the basic, pimpl, and pskel
> header and implementation files included in it, as well as the driver.cxx
> file, a mess of linker errors get spit out.

Have you built the XSD/e runtime with the same VC++ runtime option
as your project? Quoting from the INSTALL file, "Microsoft nmake"
section:

"If you are using an IDE (e.g., Visual Studio, eMbedded Visual C++,
or Rational Rhapsody) to develop your applications, you can copy
the compiler options (such as C++ language features, CPU and
Platform preprocessor macros, etc.) from your project's C++
compiler settings. In particular, you need to make sure the
CFLAGS and CXXFLAGS variables in config.nmake contain the same
runtime option (one of /MD, /MDd, /ML, /MLd, /MT, /MTd) as your
application. A common symptom of using different runtime options
when building the XSD/e runtime library (xsde.lib) and your
application is a large number of link errors related to undefined
or redefined symbols."


> The C/C++ command line arguments listed in the project property page are:
> 
> /GS /analyze- /W3 /Gy /Zc:wchar_t /Zi /Gm- /O2 /Fd"Release\vc140.pdb"
> /Zc:inline /fp:precise /D "WIN32" /D "NDEBUG" /D "_CONSOLE" /D "_UNICODE" /D
> "UNICODE" /errorReport:prompt /WX- /Zc:forScope /Gd /Oy- /Oi /MD
> /Fa"Release\" /EHsc /nologo /Fo"Release\" /Fp"Release\VSProj.pch"

So in your case it is /MD. Add it to CFLAGS/CXXFLAGS in config.nmake
and rebuild the XSD/e runtime.

You may also want to build and link different version of the XSD/e
runtime for Debug and Release (though a release runtime built with
/MD should work for debug builds). For example, make two copies of
the original libxsde directory called, say, libxsd-release and
libxsde-debug, and configure each accordingly.


> Similarly, the linker command line arguments listed in the project 
> property page are:
>
> /OUT:"D:\Working\XSDe Hello World\VSProj\Release\VSProj.exe" /MANIFEST /NXCOMPAT
> /PDB:"D:\Working\XSDe Hello World\VSProj\Release\VSProj.pdb" /DYNAMICBASE
> "xsde.lib" /MACHINE:X86 /OPT:REF /SAFESEH /INCREMENTAL:NO /PGD:"D:\Working\XSDe
> Hello World\VSProj\Release\VSProj.pgd" /SUBSYSTEM:CONSOLE
> /MANIFESTUAC:"level='asInvoker' uiAccess='false'"
> /ManifestFile:"Release\VSProj.exe.intermediate.manifest" /OPT:ICF
> /ERRORREPORT:PROMPT /NOLOGO /LIBPATH:"D:\XSDe\libxsde\xsde" /TLBID:2

I assume you have entered xsde.lib in the "Linker" -> "Input" -> 
"Additional Dependencies" field? This is important since in case of
static libraries (which xsde.lib is), the position on the command
line where theyr appear is significant.

Boris



More information about the xsde-users mailing list