All, I'm having some issues compiling omega. Here are the particulars I'm on win7, using cygwin 4.9.2 64 bit. Here's the relevant output from make: libtool: link: g++ -fshow-column -Wall -W -Wredundant-decls -Wpointer-arith -Wca st-qual -Wcast-align -Wno-long-long -Wformat-security -fno-gnu-keywords -Wundef -Woverloaded-virtual -Wstrict-null-sentinel -Wshadow -Wstrict-overflow=1 -Wlogic al-op -Wmissing-declarations -Wdouble-promotion -Winit-self -fvisibility=hidden -I/home/John/xapian-core-1.4.0/include -g -O2 -std=gnu++11 -o .libs/omindex.exe omindex.o myhtmlparse.o htmlparse.o index_file.o mime.o common/getopt.o commonhe lp.o utils.o hashterm.o loadfile.o md5.o md5wrap.o xmlparse.o metaxmlparse.o utf 8convert.o sample.o diritor.o runfilter.o freemem.o common/msvc_dirent.o xpsxmlp arse.o common/str.o pkglibbindir.o svgparse.o tmpdir.o urlencode.o atomparse.o x lsxparse.o opendocparse.o common/keyword.o msxmlparse.o common/safe.o timegm.o d atetime.o portability/mkdtemp.o -Wl,--enable-runtime-pseudo-reloc -lmagic /home /John/xapian-omega-1.4.0/../xapian-core-1.4.0/.libs/libxapian.dll.a -lrpcrt4 -lw s2_32 -lz -L/usr/local/lib /usr/bin/x86_64-w64-mingw32-ld: cannot find -lmagic collect2: error: ld returned 1 exit status make[2]: *** [Makefile:1102: omindex.exe] Error 1 make[2]: Leaving directory '/home/John/xapian-omega-1.4.0' make[1]: *** [Makefile:1391: all-recursive] Error 1 make[1]: Leaving directory '/home/John/xapian-omega-1.4.0' make: *** [Makefile:868: all] Error 2 I used the cygwin packages utility to install file 5.25, which is the package for libmagic. I have verified the presence of the file "magic" - in cygwin, it exists as /usr/share/magic (a link to /usr/share/misc/magic) and /usr/share/file/magic (a link to /usr/share/magic) and /usr/misc/magic, which is the file itself I have tried various permutations with the -l and -L switches (e.g. -L /usr/share -lmagic) to no avail. I'm not a C/C++ expert, but as far as I can tell the linker should be able to find the file. It's possible there's some subtle thing at work that I've missed in terms of getting the right flag values to the linker. The other thought is that the magic file supplied by the cygwin package is corrupt. I tried compiling the magic package from source, but was running into other issues with getting the right libraries in place to compile libmagic, which is why I opted to install the pre-compiled cygwin package. Anyone have any bright ideas? Thanks! John
On 22 Sep 2016, at 18:35, John Bankert <jbankert at gmail.com> wrote:> /usr/bin/x86_64-w64-mingw32-ld: cannot find -lmagicIt's slightly confusing, but this error means it's failing to find a _library_ called magic, which won't be in a file just called "magic". I don't know where libraries live under cygwin, or what they're called, but it'll probably start "libmagic". It might end ".dll". J -- James Aylett devfort.com ? spacelog.org ? tartarus.org/james/
James, That was exactly the issue. libmagic.dll.a was in /lib under cygwin. Adding a -L/lib took care of this. This was also an issue with -lpcre, which adding -L/lib fixed as well. Of course, I'm now running up against something else. from make libtool: link: g++ -fshow-column -Wall -W -Wredundant-decls -Wpointer-arith -Wca st-qual -Wcast-align -Wno-long-long -Wformat-security -fno-gnu-keywords -Wundef -Woverloaded-virtual -Wstrict-null-sentinel -Wshadow -Wstrict-overflow=1 -Wlogic al-op -Wmissing-declarations -Wdouble-promotion -Winit-self -fvisibility=hidden -I/home/John/xapian-core-1.4.0/include -g -O2 -std=gnu++11 -o .libs/omega.exe om ega.o query.o cgiparam.o utils.o configfile.o date.o cdb_init.o cdb_find.o cdb_h ash.o cdb_unpack.o jsonescape.o loadfile.o datevalue.o common/str.o sample.o url encode.o weight.o expand.o csvescape.o -Wl,--enable-runtime-pseudo-reloc /home/ John/xapian-omega-1.4.0/../xapian-core-1.4.0/.libs/libxapian.dll.a -lrpcrt4 -lz -lws2_32 ./.libs/libtransform.a -L/lib -lpcre -L/usr/local/lib datevalue.o: In function `DateRangeLimit::operator-(int)': /home/John/xapian-omega-1.4.0/datevalue.cc:87: undefined reference to `timegm(tm *)' datevalue.o: In function `DateRangeLimit::operator+(int)': /home/John/xapian-omega-1.4.0/datevalue.cc:92: undefined reference to `timegm(tm *)' If I'm understanding the undefined reference error correctly, I think what make is telling me is that it can't find timegm.o, which I believe handles the definitions as specified in timegm.h. The libtool: link command is being generated by some variables in the Makefile. As best as I can tell, the list of .o files comes from libtransform_la_OBJECTS, which comes from am_libtransform_la_OBJECTS, which comes from libtransform_la-transform.lo, which does some make stuff that I can't follow that seems to be centered around transform.cc I'm guessing that if I could somehow get timegm.o added to that list that the undefined reference would go bye-bye, but as I freely admit I'm out of my depth here as relates to C/C++ I won't swear to it. Again, any useful information very much appreciated. Thanks! John On Thu, Sep 22, 2016 at 2:34 PM, James Aylett <james-xapian at tartarus.org> wrote:> On 22 Sep 2016, at 18:35, John Bankert <jbankert at gmail.com> wrote: > > > /usr/bin/x86_64-w64-mingw32-ld: cannot find -lmagic > > It's slightly confusing, but this error means it's failing to find a > _library_ called magic, which won't be in a file just called "magic". I > don't know where libraries live under cygwin, or what they're called, but > it'll probably start "libmagic". It might end ".dll". > > J > > -- > James Aylett > devfort.com ? spacelog.org ? tartarus.org/james/ > >