Andy,

On behalf of the Xalan team, we greatly appreciate your reviews.
This information will help make the release of Xalan-C 1.11 a
useful product.

Sincerely,
Steven J. Hathaway
Xalan Documentation Project

On 3/10/2012 8:20 AM, Andy Tidball wrote:
Thanks for the consideration, Steven. Unfortunately none of your suggestions or information on the new build instructions solved my problem (though I did ultimately figure it out, more info below). I am incredibly happy to see the work you're doing to get 1.11 released, though, and am greatly looking forward to being able to just use the release.

One minor suggestion on the new Windows build instructions - it could be made much less complicated/intimidating by just instructing people to use the appropriate "Visual Studio Command Prompt" shortcut in their Start Menu under Visual Studio Tools (within the folder for whichever version of Visual Studio they want to build with). That shortcut opens a prompt with an environment that is already properly configured for building with that version of Visual Studio. I was able to use that method just fine on VS10. All it required was opening that prompt, setting XERCESCROOT, XALANCROOT, and optionally ICUROOT, and then running devenv.exe /useenv /build "<CONFIG>" on the appropriate .sln.

For posterity's sake, what ultimately solved my problem on Ubuntu 12.04 was changing the order of arguments passed to the linker. I was able to successfully build Xalan without incident on Ubuntu 10.04 (the latest Long Term Support release), and the main thing I could find that changed since then was the gcc version, from 4.3 or 4.4 (can't remember which) to 4.6. Seems that 4.6 had a fair number of potentially breaking changes, so I started looking through them.

The --as-needed flag seemed to have a fair amount of potential for causing linker problems. I actually never pinned down whether or not that was the actual cause, because Xalan doesn't seem to be specifying it explicitly, and I'm not sure where all to check for implicit specification (perhaps Ubuntu is somehow configured to always use it). Regardless, suggestions for how to fix builds that are broken due to --as-needed (specifically http://www.gentoo.org/proj/en/qa/asneeded.xml) led me to try re-ordering the link command such that -lxerces-c is passed AFTER the list of .o files, and that worked like a charm.

So if anyone else runs into undefined symbol linker errors for Xerces-C symbols when building Xalan-C on gcc 4.6, that might be your problem. The fix only required modifying a half-dozen or so lines between XALANCROOT/src/xalanc/Makefile.in and XALANCROOT/src/xalanc/Utils/MsgCreator/Makefile.in such that $(XALAN_LIB), $(ALLLIBS), $(LIBS), and $(XERCES_LIB) (depending on the file) are listed after $^ instead of before it on ${LINK} commands.

Andy


On 3/5/2012 12:27 AM, shath...@e-z.net wrote:
You might try looking at the new Xalan-C documentation I am
building for Xalan-C 1.11 hosted on my committer's web site.

   http://www.apache.org/~shathaway/docs/xalan/xalan-c/

The Build Libraries page describes how I build Xerces 3.1.1
and Xalan 1.11 from sources.  The description also describes
how to build the products in a directory separate from the
SVN or download repository.

I finished yesterday completing builds using GCC 4.4.5 on a
Debian Linux virtual machine.

It could be that XERCESCROOT may be pointing to the wrong part
of the Xerces directory tree.

Xerces-C moved away from runConfigure with release 3.0 and now uses
the automake configure process.

Xalan-C still uses the runConfigure front end for the configure process.

Your review and comments for the documentation effort would be
appreciated.

Sincerely,
Steven J. Hathaway

I'm getting errors building Xalan-C from the trunk (revision 1294167 to be
precise) that I cannot figure out for the life of me, and I'm hoping
someone out there can help me.  I'm not super familiar with the Linux
toolchain, so it's possible I'm making some kind of newbie mistake. I was
able to get Xalan-C building on Windows with VC10 (I even seem to have
updated the projects/solutions to use ICU as a message loader, though I
haven't actually tested using that build yet).

I'm building on Ubuntu 12.04 (which is currently a beta release, I
realize, but the version of gcc has only changed from 4.6.1 to 4.6.3 since the last release of Ubuntu, 11.10, which doesn't seem likely to cause this kind of trouble). I would prefer to just use the libxerces-c-dev package
(which is 3.1.1), but after getting these errors I also tried building
Xerces myself and ended up with the exact same problem.

I used the default configure options for Xalan (-p linux, -c gcc, -x g++)
and for Xerces when I built it myself.

Basically, I get a whole lot of "undefined reference to" various
xerces_3_1::* symbols.  See the attached xalan.log for the full make
output. The obvious problem would be that the reference to the xerces-c lib is missing, however the command line from the make output proves this
not to be the case.  It correctly uses -L to reference the Xerces lib
folder, and uses -lxerces-c to reference the lib itself, and would spit
errors if it couldn't find the lib (I tried several bogus lib names to
check this).

Furthermore, using the "nm" utility on libxerces-c.so (and libxerces-c.a, for whatever it's worth) clearly shows that it contains the symbols that are apparently undefined. So, at this point, I'm at a loss. Can anyone
suggest something I'm missing?

Here's console output from an attempted build. The referenced xalan.log
is attached.  Thanks for any suggestions!

$ pwd
/home/andy/Development/Libraries/Builds/xalan-c-trunk.1294167

$ echo $XERCESCROOT
/home/andy/Development/Libraries/Builds/xerces-c-3.1.1

$ echo $XALANCROOT
/home/andy/Development/Libraries/Builds/xalan-c-trunk.1294167

$ make>  xalan.log 2>&1

$ nm $XERCESCROOT/lib/libxerces-c.so --demangle | grep
'xercesc_3_1::XMLString::stringLen'
00126f60 T xercesc_3_1::XMLString::stringLen(char const*)

$ nm $XERCESCROOT/lib/libxerces-c.so --demangle | grep
'xercesc_3_1::XMLString::compareString'
00126ae0 T xercesc_3_1::XMLString::compareString(char const*, char const*)
00127bc0 T xercesc_3_1::XMLString::compareString(unsigned short const*,
unsigned short const*)

$ nm $XERCESCROOT/lib/libxerces-c.so --demangle | grep
'xercesc_3_1::XMLString::release'
00128cf0 T xercesc_3_1::XMLString::release(char**,
xercesc_3_1::MemoryManager*)
00128d20 T xercesc_3_1::XMLString::release(unsigned short**,
xercesc_3_1::MemoryManager*)

---------------------------------------------------------------------


---------------------------------------------------------------------
To unsubscribe, e-mail: xalan-dev-unsubscr...@xml.apache.org
For additional commands, e-mail: xalan-dev-h...@xml.apache.org

Reply via email to