Upon the base of one of the samples given (XalanTransform) i am trying to
make a DLL. But i have linker errors as you can see at the bottom of this
mail.
I have set up a project called 'Test' in the workspace 'Samples'. Here is
the code of the test.cpp. Thank you to help me.
----------------------------------------------------------------------------
- TEST.CPP
-----------------------------------------------------------------
//**** Standard includes
#include "stdafx.h"
#include "Test.h"
//**** My includes for Xalan/Xerces
#include <util/PlatformUtils.hpp>
#include <XalanTransformer/XalanTransformer.hpp>
#if defined(XALAN_OLD_STREAM_HEADERS)
#include <strstream.h>
#else
#include <strstream>
#endif
//****
BOOL APIENTRY DllMain( HANDLE hModule,
DWORD ul_reason_for_call,
LPVOID lpReserved
)
{
switch (ul_reason_for_call)
{
case DLL_PROCESS_ATTACH:
case DLL_THREAD_ATTACH:
case DLL_THREAD_DETACH:
case DLL_PROCESS_DETACH:
break;
}
return TRUE;
}
// This is a test of exported function.
TEST_API int Hello(void)
{
return 999;
}
// This is My function.
TEST_API int Fusion(void)
{
#if !defined(XALAN_NO_NAMESPACES)
using std::ostrstream;
using std::cout;
using std::cerr;
using std::endl;
#endif
int theResult = 0;
// Call the static initializer for Xerces.
XMLPlatformUtils::Initialize();
// Initialize Xalan.
XalanTransformer::initialize();
// Create a XalanTransformer.
XalanTransformer theXalanTransformer;
// My Input/Output files for the test
const char* theXMLFileName="foo.xml";
const char* theXSLFileName="foo.xsl";
const char* theOutFileName ="Result.html";
// Do the transform.
theResult = theXalanTransformer.transform(theXMLFileName,
theXSLFileName, theOutFileName);
if(theResult != 0)
{
cerr << "XalanError: \n" <<
theXalanTransformer.getLastError();
}
// Terminate Xalan.
XalanTransformer::terminate();
// Call the static terminator for Xerces.
XMLPlatformUtils::Terminate();
return theResult;
}
// This is the constructor of a class that has been exported.
// see Test.h for the class definition
CTest::CTest()
{
return;
}
---------------------------------Configuration: Test - Win32
Debug----------------------------------------
Command Lines
Creating temporary file "C:\TEMP\RSP23A.tmp" with contents
[
/nologo /MTd /W4 /Gm /GR /GX /Zi /Od /I "..\..\..\..\xml-xerces\c\src" /I
"..\..\src" /I "c:\sxl\include" /I "C:\xml-xalan\c\src\include" /D
"_WINDOWS" /D "_USRDLL" /D "WIN32" /D "_DEBUG" /D "_MBCS" /D "TEST_EXPORTS"
/FR"Debug/" /Fp"Debug/Test.pch" /Yc"stdafx.h" /Fo"Debug/" /Fd"Debug/" /FD
/GZ /c
"C:\xml-xalan\c\samples\Test\StdAfx.cpp"
]
Creating command line "cl.exe @C:\TEMP\RSP23A.tmp"
Creating temporary file "C:\TEMP\RSP23B.tmp" with contents
[
kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib
shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib
..\..\..\..\xml-xerces\c\Build\Win32\VC6\Debug\xerces-c_1D.lib /nologo /dll
/incremental:yes /pdb:"..\..\Build\Win32\VC6\Debug/Test.pdb" /debug
/machine:I386 /out:"..\..\Build\Win32\VC6\Debug/Test.dll"
/implib:"Debug/Test.lib" /pdbtype:sept /libpath:"c:\sxl\lib"
".\Debug\StdAfx.obj"
".\Debug\Test.obj"
]
Creating command line "link.exe @C:\TEMP\RSP23B.tmp"
Output Window
Compiling...
StdAfx.cpp
Linking...
nafxcwd.lib(afxmem.obj) : error LNK2005: "int __stdcall
AfxEnableMemoryTracking(int)" (?AfxEnableMemoryTracking@@YGHH@Z) already
defined in sxlmtd.lib(xmemtrk.obj)
nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void
*)" (??3@YAXPAX@Z) already defined in sxlmtd.lib(delop.obj)
nafxcwd.lib(afxmem.obj) : warning LNK4006: "int __stdcall
AfxEnableMemoryTracking(int)" (?AfxEnableMemoryTracking@@YGHH@Z) already
defined in sxlmtd.lib(xmemtrk.obj); second definition ignored
nafxcwd.lib(afxmem.obj) : warning LNK4006: "void __cdecl operator
delete(void *)" (??3@YAXPAX@Z) already defined in sxlmtd.lib(delop.obj);
second definition ignored
Creating library Debug/Test.lib and object Debug/Test.exp
Test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
public: virtual __thiscall XalanTransformer::~XalanTransformer(void)"
(__imp_??1XalanTransformer@@UAE@XZ)
Test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
public: static void __cdecl XalanTransformer::terminate(void)"
(__imp_?terminate@XalanTransformer@@SAXXZ)
Test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
public: char const * __thiscall XalanTransformer::getLastError(void)const "
(__imp_?getLastError@XalanTransformer@@QBEPBDXZ)
Test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
public: int __thiscall XalanTransformer::transform(char const *,char const
*,char const *)" (__imp_?transform@XalanTransformer@@QAEHPBD00@Z)
Test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
public: __thiscall XalanTransformer::XalanTransformer(void)"
(__imp_??0XalanTransformer@@QAE@XZ)
Test.obj : error LNK2001: unresolved external symbol "__declspec(dllimport)
public: static void __cdecl XalanTransformer::initialize(void)"
(__imp_?initialize@XalanTransformer@@SAXXZ)
..\..\Build\Win32\VC6\Debug/Test.dll : fatal error LNK1120: 6 unresolved
externals
Error executing link.exe.
Results
Test.dll - 9 error(s), 2 warning(s)
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]