Search code examples
c++eclipsemingwxercesxalan

Getting an Eclipse C++ environment running with Xalan


I have been working on getting a C++ IDE going on my 64-bit Windows 7 machine. It's been frustrating, mostly because of the incompatibilities of 32 and 64 bit programs using Eclipse IDE for C/C++ Developers

Well, I finally got HelloWorld compiling, now I want to add Xalan to my project. I've downloaded both the source and binaries. Getting the source to compile in MinGW (my compiler of choice) has been impossible, but I'm working on using the .lib files in the binary directory like xerces-c_2.lib. Can I just link these to my C++ project and if so how do I do it?

Thanks!

EDIT UPDATE 2011-08-30

I just haven't had any luck but I wanted to post an update. I tried building this outside of Eclipse without success. I am trying to create the StreamTransform.cpp example that comes bundles with Xalan-C. It is in a directory with its associated header file: XalanMemoryManagerImpl.hpp

I then created the following Makefile:

OBJS = StreamTransform.o
CC = g++
DEBU \G = -g
CFLAGS = -Wall -c $(DEBUG)
LFLAGS = -Wall $(DEBUG)
LIBDIR = -LC:\Development\xslTests\stream\lib
LIBS = -lxerces-c_2 -lxerces-depdom_2 -lXalan-C_1 
INCDIR = -IC:\Libs\xerces-c-windows_2000-msvc_60\include -IC:\Libs\Xalan-C_1_10_0-win32-msvc_60\include

all: transformer

transformer: $(OBJS)
  $(CC) $(LFLAGS) $(OBJS) -o transformer $(LIBDIR) $(LIBS) 

StreamTransform.o : StreamTransform.cpp XalanMemoryManagerImpl.hpp
  $(CC) $(INCDIR) $(CFLAGS) StreamTransform.cpp

The base target StreamTransform.o runs successfully and the output file is generated, but transformer dies. The error I am getting here is the same I was getting with Eclipse. A bunch of "undefined reference errors:

C:\Users\x_walia\workspace\TCXMLTransformer\Debug/../StreamTransform.cpp:115: undefined reference to `xalanc_1_10::XSLTInputSource::XSLTInputSource(std::istream*, xercesc_2_7::MemoryManager&)'

StreamTransform.o: In function main': C:/Libs/Xalan-C_1_10_0-win32-msvc_60/include/xalanc/XSLT/XSLTResultTarget.hpp:103: undefined reference toxalanc_1_10::XalanMemMgrs::getDefaultXercesMemMgr()'

To me, this looks like there is some sort of library linking error, but what? I should not that there are six .lib files bundled with the Windows binary distribution which I am using. Half of them have the suffix: _d as in xerces-c_2*d* which represent the debug libraries. I have tried both including and omitting these but to no avail.

I have heard that this project is abandoned and wonder if I am just having problems because I am compiling on a Windows 7 64 bit machine...


Solution

  • You can't link a C++ library built with Microsoft Visual C++ to objects or libs built with mingw. The ABI is not compatible.

    My prefered search engine doesn't give any link to existing Xalan/Xerces mingw binaries, so you will probably have to build them yourself.