Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Xalan-C / Xerces-C in BCB?

Posted on 2004-10-31
9
Medium Priority
?
424 Views
Last Modified: 2013-11-17
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
0
Comment
Question by:blackfrancis75
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 3
  • 2
9 Comments
 
LVL 16

Expert Comment

by:George Tokas
ID: 12461600
Did you added the libs at your project (Stupid question but many times happens )...

gtokas.
0
 
LVL 5

Author Comment

by:blackfrancis75
ID: 12461638
yes, I've done that - I presume they are linked correctly - Is there a way to check?
0
 
LVL 16

Expert Comment

by:George Tokas
ID: 12461680
At View|Project Manager you can see what modules/libraries are included at your project's exe..

gtokas.
0
Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

 
LVL 5

Author Comment

by:blackfrancis75
ID: 12461763
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
 
LVL 16

Expert Comment

by:George Tokas
ID: 12461871
>>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
 
LVL 5

Author Comment

by:blackfrancis75
ID: 12463648
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
 
LVL 9

Accepted Solution

by:
Cayce earned 2000 total points
ID: 12463822
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
 
LVL 5

Author Comment

by:blackfrancis75
ID: 12468918
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
 
LVL 9

Expert Comment

by:Cayce
ID: 12473550
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

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Update (December 2011): Since this article was published, the things have changed for good for Android native developers. The Sequoyah Project (http://www.eclipse.org/sequoyah/) automates most of the tasks discussed in this article. You can even fin…
Jaspersoft Studio is a plugin for Eclipse that lets you create reports from a datasource.  In this article, we'll go over creating a report from a default template and setting up a datasource that connects to your database.
This tutorial covers a step-by-step guide to install VisualVM launcher in eclipse.
The viewer will learn how to use NetBeans IDE 8.0 for Windows to connect to a MySQL database. Open Services Panel: Create a new connection using New Connection Wizard: Create a test database called eetutorial: Create a new test tabel called ee…
Suggested Courses

636 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question