[sleuthkit-developers] [ sleuthkit-Bugs-3184419 ] mingw compile errors
Brought to you by:
carrier
From: SourceForge.net <no...@so...> - 2011-02-17 03:22:34
|
Bugs item #3184419, was opened at 2011-02-16 22:22 Message generated for change (Tracker Item Submitted) made by carrier You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=477889&aid=3184419&group_id=55685 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: File System Tools Group: None Status: Open Resolution: None Priority: 5 Private: No Submitted By: Brian Carrier (carrier) Assigned to: Nobody/Anonymous (nobody) Summary: mingw compile errors Initial Comment: Simson G sent the following to the list: Using SleuthKit with libewf under mingw results in the error below in the configure.ac script because zlib isn't included natively in mingw; the solution is to add this line before the libewf test: My winning configure.ac script is attached. Unfortunately, this causes another problem with ewf.h: #if defined(TSK_WIN32) #include <config_msc.h> #endif It turns out that you don't have config_msc.h when compiling under mingw, because WIN32 and MSC are not synonyms. There really needs to be an explicit check to see if config_msc.h is present. So this needs to be added to configure.ac: AC_CHECK_HEADERS([config_msc.h]) And the line in ewf.h needs to be changed to read: #ifdef HAVE_CONFIG_MSC_H #include <config_msc.h> #endif Another problem shows up in ewf.c: #if defined (TSK_WIN32) if (libewf_check_file_signature_wide(images[0]) == 0) { #else if (libewf_check_file_signature(images[0],0) == 0) { #endif which generates this error: ewf.c:147: error: too few arguments to function `libewf_check_file_signature_wide' Which can be fixed with: if (libewf_check_file_signature_wide(images[0],0) == 0) { Another problem is auto.cpp: libtool: compile: /opt/local/bin//i386-mingw32-g++ -DHAVE_CONFIG_H -I. -I../../tsk3 -I../.. -Wall -mwin32 -mconsole -march=pentium4 -Wall -MT auto.lo -MD -MP -MF .deps/auto.Tpo -c auto.cpp -o auto.o In file included from /opt/local/i386-mingw32/include/c++/3.4.5/bits/stl_algobase.h:67, from /opt/local/i386-mingw32/include/c++/3.4.5/bits/stl_tree.h:66, from /opt/local/i386-mingw32/include/c++/3.4.5/map:66, from tsk_auto.h:32, from tsk_auto_i.h:29, from auto.cpp:16: /opt/local/i386-mingw32/include/c++/3.4.5/cstdlib:111: error: `::realloc' has not been declared This seems to happening when tsk_auto.h executes the #include <map> or the #include<string> The interesting thing is, neither of those includes are actually necessary to compile the auto class. I commented them out and the compile proceeded but linking failed with this: libtool: link: /opt/local/bin//i386-mingw32-g++ -mwin32 -mconsole -march=pentium4 -Wall -o img_cat.exe img_cat.o ../../tsk3/.libs/libtsk3.a -L/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_cross_i386-mingw32-gcc/work/build/i386-mingw32/libstdc++-v3/src -L/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_cross_i386-mingw32-gcc/work/build/i386-mingw32/libstdc++-v3/src/.libs -L/opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_ports_cross_i386-mingw32-gcc/work/build/gcc -L/opt/local/i386-mingw32/bin -L/opt/local/i386-mingw32/lib -L/opt/local/lib/../i386-mingw32/lib /opt/local/i386-mingw32/lib/libstdc++.a -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt -lm /opt/local/i386-mingw32/lib/libewf.a -lz -lws2_32 -lgdi32 ../../tsk3/.libs/libtsk3.a(mymalloc.o):mymalloc.c:(.text+0x8d): undefined reference to `_rpl_realloc' Now that's weird, but it turns out that in tsk3/tsk_config.h, you'll find this: /* Define to rpl_realloc if the replacement function should be used. */ #define realloc rpl_realloc Which is just the wrong thing to be doing. We have realloc on this platform, but for some reason AC_FUNC_REALLOC things that we don't. So I commented out AC_FUNC_REALLOC in configure.ac Apparently the failure of AC_FUNC_REALLOC has been discovered in the past: http://www.opensubscriber.com/message/aut...@gn.../8275001.html http://www.opensubscriber.com/message/aut...@gn.../8275242.html AND THEN YOU CAN COMPILE SLEUTHKIT 3.2.0 on MINGW! HURRAY! ============== configure:19255: result: no configure:19324: checking libewf.h usability configure:19341: /opt/local/bin//i386-mingw32-gcc -c -mwin32 -mconsole -march=pentium4 -Wall conftest.c >&5 configure:19347: $? = 0 configure:19361: result: yes configure:19365: checking libewf.h presence configure:19380: /opt/local/bin//i386-mingw32-gcc -E conftest.c configure:19386: $? = 0 configure:19400: result: yes configure:19428: checking for libewf.h configure:19436: result: yes configure:19445: checking for libewf_open in -lewf configure:19480: /opt/local/bin//i386-mingw32-gcc -o conftest.exe -mwin32 -mconsole -march=pentium4 -Wall -lws2_32 conftest.c -lewf -lws2_32 -lgdi32 >&5 /opt/local/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/libewf.a(libewf_write_io_handle.o):libewf_write_io_handle.c:(.text+0x2901): undefined reference to `_adler32' /opt/local/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/libewf.a(libewf_write_io_handle.o):libewf_write_io_handle.c:(.text+0x541e): undefined reference to `_adler32' /opt/local/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/libewf.a(libewf_read_io_handle.o):libewf_read_io_handle.c:(.text+0x569): undefined reference to `_adler32' /opt/local/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/libewf.a(libewf_compression.o):libewf_compression.c:(.text+0x1ba): undefined reference to `_compress2' /opt/local/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/libewf.a(libewf_compression.o):libewf_compression.c:(.text+0x1e8): undefined reference to `_compressBound' /opt/local/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/libewf.a(libewf_compression.o):libewf_compression.c:(.text+0x3b0): undefined reference to `_uncompress' /opt/local/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/libewf.a(libewf_section.o):libewf_section.c:(.text+0x5c3): undefined reference to `_adler32' /opt/local/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/libewf.a(libewf_section.o):libewf_section.c:(.text+0xa98): undefined reference to `_adler32' /opt/local/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/libewf.a(libewf_section.o):libewf_section.c:(.text+0x1be8): undefined reference to `_adler32' /opt/local/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/libewf.a(libewf_section.o):libewf_section.c:(.text+0x21c0): undefined reference to `_adler32' /opt/local/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/libewf.a(libewf_section.o):libewf_section.c:(.text+0x2557): undefined reference to `_adler32' /opt/local/lib/gcc/i386-mingw32/3.4.5/../../../../i386-mingw32/lib/libewf.a(libewf_section.o):libewf_section.c:(.text+0x2e6a): more undefined references to `_adler32' follow collect2: ld returned 1 exit status ------------------------------------------------------------------------------ Special Offer-- Download ArcSight Logger for FREE (a $49 USD value)! Finally, a world-class log management solution at an even better price-free! Download using promo code Free_Logger_4_Dev2Dev. Offer expires February 28th, so secure your free ArcSight Logger TODAY! http://p.sf.net/sfu/arcsight-sfd2d_______________________________________________ sleuthkit-users mailing list https://lists.sourceforge.net/lists/listinfo/sleuthkit-users http://www.sleuthkit.org ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=477889&aid=3184419&group_id=55685 |