Yet another cygwin log again. Since the unfamiliar with under surface details of how it works, whenever sometime wrong happens on cygwin, it'll be a nightmare. This time is the xerces-c & xalan-c.
Since recent project requires to use the xpath in c++, the only choice probably is the xalan-c. I did think that if the library of c++ become rich enough, everyone c++ worker will be much easier from a developer coming from enterprise computing language and script language perspective. = =
This time, the story goes like this, i need to compile the xerces-c 2.7 as xalan 1.1 compatibility. The original binary package for cygwin is 3.0.1-1 or 2.8.0-5 under Devel/libxerces-c-devel. The steps of compilation as the Readme.html said:
1. set the XERCESCROOT virable to the directory contains the extracting of xerces. for example ~/dev/xerces-c-src_2_7_0
2. go the the XERCESCROOT/src/xercesc, use ./runConfigure -pcygwin -cgcc -xg++ to make the Makefile (runConfigure is a helper script, we can use ./configure also)
3. if everything's done properly, just make it. and make install
My problem comes at the step 3, the make can not be processed when reaching the 'deprecated DOM part'. The Problem is the exactly the same as this bug report XERCESC-1501.
Creating library file: \ /cygdrive/d/tmp/xerces-c-src_2_7_0/lib/libxerces-depdom27.dll.a \ CYGWIN/depdom/AttrImpl.o(.text+0x4bb):AttrImpl.cpp: undefined reference to \ `xercesc_2_7::XMemory::operator delete(void*)' \ CYGWIN/depdom/AttrImpl.o(.text+0x50d):AttrImpl.cpp: undefined reference to \ `xercesc_2_7::XMemory::
......... ::fgNoString' collect2: ld returned 1 exit status make[1]: *** [/cygdrive/d/tmp/xerces-c-src_2_7_0/lib/cygxerces-depdom27.dll] Error 1 make[1]: Target `ALL' not remade because of errors. make: *** [/cygdrive/d/tmp/xerces-c-src_2_7_0/lib/cygxerces-c27.dll] Error 2
The error seems saying the it can not find certain deprecated dom library. First, I went through the way this post said. After spending 1 hour to find where I can add that link options in the Makefile, the make still not work. Then I thought probably, it's the libxerces-c-devel problem. I uninstalled it. Then everything just works, with some auto-import warning, INFO.After make install the compiled code, we can do test with the sample. The compilation of the sample works well. Everything works now.Next, compilation of xalan-c. Nightmare again ...1. set the XALANCROOT virable to the extracted xalan/c , make sure the XERCESCROOT is still there2. in the XALANCROOT, run ./runConfigure -p cygwin -c gcc -x g++ -P /usr/local , make sure including the -P in order to use the 'make install'.3. type 'make', here comes the problem, exactly the same as this one: http://marc.info/?l=xalan-c-users&m=115953899805021&w=2make -C src/xalanc all make[1]: Entering directory `/usr/src/xml-xalan/c/src/xalanc' Preparing the directory structure for a build ... mkdir -p ../../obj mkdir -p ../../lib mkdir -p ../../bin make -C Utils prepare make[2]: Entering directory `/usr/src/xml-xalan/c/src/xalanc/Utils' Makefile:71: *** multiple target patterns. Stop. make[2]: Leaving directory `/usr/src/xml-xalan/c/src/xalanc/Utils' make[1]: *** [prepare] Error 2 make[1]: Leaving directory `/usr/src/xml-xalan/c/src/xalanc' make: *** [all] Error 2
The thread is very interesting. The last one solved this problem partly: http://marc.info/?l=xalan-c-users&m=116048865019326&w=2 I could now compile Xalan.The problem was the empty XLIFF_FILE_NAME.I hard coded the Windows form of the file, "C:/cygwin/usr/....", to Utils/Makefile and changed the line$(XSL_NLS_DIR)/include/LocalMsgData.hpp : $(XSL_BIN_DIR)/MsgCreator $(XLIFF_FILE_NAME) to$(XSL_NLS_DIR)/include/LocalMsgData.hpp : $(XSL_BIN_DIR)/MsgCreatorBut the "make install" fails:
Actually it says the problem is because the XLIFF_FILE_NAME has not been processed successfully, but with an empty string in the real make run. In order to fix that one, we need to set it manually in the Utils/Makefile. 1. In the line 38 of the Utils/Makefile, we can find the XLIFF_FILE_NAME for Cygwin. comment out that line, add add XLIFF_FILENAME=$XALANCROOT/src/xalanc/NLS/en_US/XalanMsg_en_US.xlf 2. In the line 71, i found that keep it the same still can make successful. so what we need is do the step 1. I said the solution solves the problem partly, because when I make the xalan now, the result is not that stable, sometimes errors, sometimes successful, and everytime the errors are different. In the make output, After lots of g++ -O, it starts to create the .dll file. The problem here is sometimes, it says some *.o can not be found in obj/ . The time I successfully compiled it is I redirected the make output into a text file. = = Otherwise, different *.o are reported as can not be found in different run. = = very wired. Anyway, the compilation seems finished, then comes the 'make install'. Remember when doing ./runConfigure, we should specify the -P as the installation directory. I set as /usr/local/ at the beginning. The make file will try to install the file at //usr/local//bin|lib|include, and // can not be recogonized by bash in cygwin. The solution is to modify the Makefile.incl at the root directory. Line 40, change 'prefix=/usr/local/' to 'prefix=usr/local'. I tried to rerun the runConfigure with -P usr/local, but it does not work because absolute path checking. Then the 'make install' works. Next nightmare to me, is the installation seems having something wrong. The cygxalan-c110.dll has been installed in /usr/local/lib, not in /usr/local/bin, and the cygxalanMsg110.dll has been kept in the XALANCROOT/lib, but not in /usr/local/binI compiled the samples by 'make samples' to see whether everything works. But the result is frustrating. only the MsgCreator.exe works, others said: the procedure entry point AddAtomA could not be located in the dynamic link library cygwin1.dll
Googled the AddAtomA, it said that AddAtomA has been exported by kernal32.dll : http://www.pc1news.com/virus/function-addatoma-1177.html kernal32.dll is in C:\Windows\system32 but why cygwin1.dll can not locate that?? 