[Quickfix-developers] compiling for ISO C++ standard causes errors
Brought to you by:
orenmnero
From: Cicero, M. <mc...@va...> - 2002-03-15 16:50:57
|
My programs are compiled with gcc v3.0.4 using the flag "-pedantic" to ensure strict ISO C++ adherence. I noticed that it was erroring out when linking in the quickfix library so I put in the following updates to quickfix: > diff configure configure.orig 1394c1394 < CXXFLAGS="-Wall -fexceptions -pedantic -D_XOPEN_SOURCE=500" --- > CXXFLAGS="-Wall -fexceptions -D_XOPEN_SOURCE=500" 1398c1398 < CFLAGS="-pedantic -D_XOPEN_SOURCE=500" --- > CFLAGS="-D_XOPEN_SOURCE=500" > diff configure.in configure.in.orig 9c9 < CXXFLAGS="-Wall -fexceptions -pedantic -D_XOPEN_SOURCE=500" --- > CXXFLAGS="-Wall -fexceptions -D_XOPEN_SOURCE=500" 13c13 < CFLAGS="-pedantic -D_XOPEN_SOURCE=500" --- > CFLAGS="-D_XOPEN_SOURCE=500" > diff src/C++/strptime.h src/C++/strptime.h.orig 3c3 < strptime(const char *buf, const char *fmt, struct tm *tm) throw(); --- > strptime(const char *buf, const char *fmt, struct tm *tm); > diff src/C++/ConfigLexer.h src/C++/ConfigLexer.h.orig 63c63 < LC_STATE_VALUE --- > LC_STATE_VALUE, > diff src/C++/ConfigLexer.cpp src/C++/ConfigLexer.cpp.orig 1225c1225 < extern "C" int isatty YY_PROTO(( int )) throw (); --- > extern "C" int isatty YY_PROTO(( int )); Maybe you could add it to the sources. I also had to do a little trick to get it compile with gcc v3.0.4. gcc v2.95.3 is in /usr/bin and v3.0.4 is in /usr/local/bin. I first had to remove /usr/local/bin from my path, do "configure" and "make" until make breaks, do "cp `which libtool` ./", then add back /usr/local/bin in order to compile. If not, I'd get this error: quickfix> make cd . && aclocal cd . && automake --foreign Makefile cd . && autoconf configure.in:26: warning: AC_PROG_LEX invoked multiple times /bin/sh ./config.status --recheck running /bin/sh configure --no-create --no-recursion checking for a BSD compatible install... /usr/bin/install -c checking whether build environment is sane... yes checking whether make sets ${MAKE}... yes checking for working aclocal... found checking for working autoconf... found checking for working automake... found checking for working autoheader... found checking for working makeinfo... found checking for g++... g++ checking for C++ compiler default output... a.out checking whether the C++ compiler works... configure: error: cannot run C++ compiled programs. If you meant to cross compile, use `--host'. make: *** [config.status] Error 1 Finally, the Unit Tests works, but the Acceptance Tests won't load: > setenv LD_LIBRARY_PATH /usr/local/lib quickfix-gcc3.0.4-ISO/test> runut 12345 ............................................................................ ............................. 105 out of 105 tests passing (100%) quickfix-gcc3.0.4-ISO/test> runat Created Session - BeginString: FIX.4.2, SenderCompID: ISLD, TargetCompID: TW SocketAcceptPort not defined./Reflector.rb:162:in `require': No such file to load -- runit/testcase (LoadError) from ./Reflector.rb:162 from ./ReflectorClient.rb:49:in `require' from ./ReflectorClient.rb:49 from Runner.rb:49:in `require' from Runner.rb:49 runat: kill: (27917) - No such pid Any ideas? I'm running SuSE Linux 7.3 Professional on a PIII, 500MHz, 512MB RAM and will try Solaris 8 Sparc later. FWIW, I also going to link in log4cpp. Thanks, Marlon |