Xalan-C / Xerces-C in BCB?

Hello,
I've been trying to build a BCB project that links to the Xalan-C and Xerces-C libraries provided by the Apache foundation (http://xml.apache.org/xalan-c/).
The problem is that they provide MSVC++ versions of the .lib and .dll files but so far they havent ported it to BCB.

So I realise that there are a couple of different ways to (attempt to) use MSVC libraries in BCB - these being
(a) using COFF2OMF.EXE on the .lib file to make a BCB-friendly (OMF) lib file
(b) using IMPLIB.EXE to work on the compiled DLL and extract a BCB-friendly lib file

Now I have done both of these, and both yeild the same result;
I can compile my BCB project which links to these libraries, but when it comes to linking, I get the following errors:

[Linker Error] Unresolved external 'xalanc_1_8::XalanTransformer::~XalanTransformer()' referenced from C:\PROJECTS\XSLFREE\MAINUNIT.OBJ
[Linker Error] Unresolved external 'xalanc_1_8::XalanQNameByValue::~XalanQNameByValue()' referenced from C:\PROJECTS\XSLFREE\MAINUNIT.OBJ
[Linker Error] Unresolved external 'xalanc_1_8::XSLTResultTarget::~XSLTResultTarget()' referenced from C:\PROJECTS\XSLFREE\MAINUNIT.OBJ
[Linker Error] Unresolved external 'xercesc_2_5::XMemory::operator delete(void *)' referenced from C:\PROJECTS\XSLFREE\MAINUNIT.OBJ
[Linker Error] Unresolved external 'xercesc_2_5::InputSource::~InputSource()' referenced from C:\PROJECTS\XSLFREE\MAINUNIT.OBJ
[Linker Error] Unresolved external 'xercesc_2_5::XMLUni::fgXercescDefaultLocale' referenced from C:\PROJECTS\XSLFREE\MAINUNIT.OBJ
[Linker Error] Unresolved external 'xercesc_2_5::XMLPlatformUtils::Initialize(const char * const, const char * const, xercesc_2_5::PanicHandler * const, xercesc_2_5::MemoryManager * const)' referenced from C:\PROJECTS\XSLFREE\MAINUNIT.OBJ
[Linker Error] Unresolved external 'xalanc_1_8::XalanTransformer::initialize()' referenced from C:\PROJECTS\XSLFREE\MAINUNIT.OBJ
[Linker Error] Unresolved external 'xalanc_1_8::XalanTransformer::XalanTransformer()' referenced from C:\PROJECTS\XSLFREE\MAINUNIT.OBJ
[Linker Error] Unresolved external 'xalanc_1_8::XSLTResultTarget::XSLTResultTarget(const char *)' referenced from C:\PROJECTS\XSLFREE\MAINUNIT.OBJ
[Linker Error] Unresolved external 'xalanc_1_8::XSLTInputSource::XSLTInputSource(const char *)' referenced from C:\PROJECTS\XSLFREE\MAINUNIT.OBJ
[Linker Error] Unresolved external 'xalanc_1_8::XalanTransformer::transform(const xalanc_1_8::XSLTInputSource&, const xalanc_1_8::XSLTInputSource&, const xalanc_1_8::XSLTResultTarget&)' referenced from C:\PROJECTS\XSLFREE\MAINUNIT.OBJ
[Linker Error] Unresolved external 'xalanc_1_8::XalanTransformer::terminate()' referenced from C:\PROJECTS\XSLFREE\MAINUNIT.OBJ
[Linker Error] Unresolved external 'xercesc_2_5::XMLPlatformUtils::Terminate()' referenced from C:\PROJECTS\XSLFREE\MAINUNIT.OBJ
[Linker Error] Unresolved external 'xalanc_1_8::XalanTransformer::ICUCleanUp()' referenced from C:\PROJECTS\XSLFREE\MAINUNIT.OBJ

Now I'm presuming that these issues are due to inadequacies of the LIB conversion process; I've played around with both conversion exe's and their command-line arguments but I dont seem to be gatting any where.  I'd really love to be able to build my BCB project with Xalan, so if anyone can help I'll be stoked.  For example, does anyone know of maybe a BCB port of these libs?
Cheers,
George
LVL 5
blackfrancis75Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

George TokasCommented:
Did you added the libs at your project (Stupid question but many times happens )...

gtokas.
0
blackfrancis75Author Commented:
yes, I've done that - I presume they are linked correctly - Is there a way to check?
0
George TokasCommented:
At View|Project Manager you can see what modules/libraries are included at your project's exe..

gtokas.
0
Cloud Class® Course: Microsoft Office 2010

This course will introduce you to the interfaces and features of Microsoft Office 2010 Word, Excel, PowerPoint, Outlook, and Access. You will learn about the features that are shared between all products in the Office suite, as well as the new features that are product specific.

blackfrancis75Author Commented:
Yeah, thats how I added them originally - i thought there might be another way to check they were being linked properly, but I presume that since the error messages mention 'xalanc_1_8' and 'xercesc_2_5' that these strings are being picked up from the lib files...
0
George TokasCommented:
>>Unresolved external 'xalanc_1_8::XalanTransformer::~XalanTransformer()'
This message means that the linker can not find the specified function everywere at libs or source files... Something is made wrong...

gtokas.
0
blackfrancis75Author Commented:
where does it get the part-string 'xalanc_1_8' if not from the Lib file?  

The only other things I did to the project (apart from adding the .lib files in Project Manager)  to integrate Xalan and Xerces was to add their include directories to the project settings.
0
CayceCommented:
Don't even bother trying. You need to recompile the whole thing under BCB. C++ code is not binary compatible between VC++ and BCB (C code is, just need to do some linker tricks).

I'm actually working on a port (should be ready today I hope, cause I really need it for a project :) ) of the Xerces libraries. Xalan shouldn't be much different. (Same compiler & linker flags, same modifications to header files).

Also I've ported the ICU library (which can be used with Xalan for i18n), you can find the binary libraries in here:
http://www.idea.com.mx/icu/
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
blackfrancis75Author Commented:
Thanks!  I suspected this might be the case.  I have the Xalan src, do you think it's worth me trying to port it to BCB?
0
CayceCommented:
I've found out that the latest version of xerces contains a BCB port (under the projects folder). It would be a good starting point for porting Xalan.

It's not that hard, basically add all the sources files into a DLL then fix up the dependencies and include paths. You may need to add the __declspec(dllexport) clause to all the classes and C functions you want to be exported (unless you compile everything into a lib). I usually create a macro like this:

#if defined(__DLL_BUILD)
#  define DECLSPEC __declspec(dllexport)
#elif defined(__LIB_BUILD)
#  define DECLSPEC
#else
#  define DECLSPEC __declspec(dllimport)
#endif

And then I declare all the classes like this:

class DECLSPEC myClass { /* ... */ };

Then just add the __DLL_BUILD or the __LIB_BUILD define in the project options (makefile) so the compiler will known when to export and when to import.

Be sure to DISABLE the "Zero length empty base classes" option in the C++ page of project properties. I leads to a lot "FATAL INTERNAL COMPILER ERROR"'s. I don't know why this happens must be a bug of the BCB compiler.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Editors IDEs

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.