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/autoconf@gnu.org/8275001.html
http://www.opensubscriber.com/message/autoconf@gnu.org/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
Checked in some of the changes:
Sending branches/sleuthkit-3.2/NEWS.txt
Sending branches/sleuthkit-3.2/configure.ac
Sending branches/sleuthkit-3.2/tsk3/auto/tsk_auto.h
Sending branches/sleuthkit-3.2/tsk3/img/ewf.h
Sending trunk/NEWS.txt
Sending trunk/configure.ac
Sending trunk/tsk3/auto/tsk_auto.h
Sending trunk/tsk3/img/ewf.h
Transmitting file data ........
Committed revision 316.
Open issues include:
- why does TSK need to check for zlib if that is a libewf dependency? The attached configure.ac makes zlib a requirement for TSK.
- Does changing the wide arguments work on Visual Studio?