1

I try to compile this piece of code: http://www.mr-edd.co.uk/code/stack_trace, given in this advice: Win32 API stack walk with MinGW/MSYS?

My command line is:

i586-mingw32msvc-g++ src/stack.cpp -L. -lbfd -lintl -liconv -ldbghelp -limagehlp -limagehlp -liberty  -I./include/   -D__MINGW32__

Here is what I get:

./libbfd.a(opncls.o):(.text+0x5ee): undefined reference to `_fcntl'
./libbfd.a(bfdio.o):(.text+0x16b): undefined reference to `___errno'
./libbfd.a(bfdio.o):(.text+0x199): undefined reference to `___errno'
./libbfd.a(bfdio.o):(.text+0x1b0): undefined reference to `___errno'
./libbfd.a(bfdio.o):(.text+0x3de): undefined reference to `_fcntl'
./libbfd.a(bfdio.o):(.text+0x3f9): undefined reference to `_fcntl'
./libbfd.a(bfdio.o):(.text+0x509): undefined reference to `___errno'
./libbfd.a(bfdio.o):(.text+0x6e6): undefined reference to `___errno'
./libbfd.a(bfdio.o):(.text+0x706): undefined reference to `___errno'
./libbfd.a(bfdio.o):(.text+0x388): undefined reference to `_ftello'
./libbfd.a(bfdio.o):(.text+0x398): undefined reference to `_fseeko'
./libbfd.a(bfd.o):(.text+0xb6): undefined reference to `___errno'
./libbfd.a(bfd.o):(.text+0xdc): undefined reference to `___getreent'
./libbfd.a(bfd.o):(.text+0x104): undefined reference to `___getreent'
./libbfd.a(bfd.o):(.text+0x120): undefined reference to `___getreent'
./libbfd.a(bfd.o):(.text+0x145): undefined reference to `___getreent'
./libbfd.a(bfd.o):(.text+0x2f0): undefined reference to `___getreent'
./libbfd.a(bfd.o):(.text+0x30e): more undefined references to `___getreent' follow
./libbfd.a(compress.o):(.text+0x19): undefined reference to `_compressBound'
./libbfd.a(compress.o):(.text+0x53): undefined reference to `_compress'
./libbfd.a(compress.o):(.text+0x1df): undefined reference to `_inflateEnd'
./libbfd.a(compress.o):(.text+0x33f): undefined reference to `_inflateInit_'
./libbfd.a(compress.o):(.text+0x364): undefined reference to `_inflateReset'
./libbfd.a(compress.o):(.text+0x38e): undefined reference to `_inflate'
./libbfd.a(syms.o):(.text+0x78a): undefined reference to `_filename_ncmp'
./libbfd.a(archive.o):(.text+0x108): undefined reference to `_filename_ncmp'
./libbfd.a(archive.o):(.text+0x88d): undefined reference to `___errno'
./libbfd.a(archive.o):(.text+0xa05): undefined reference to `___errno'
./libbfd.a(archive.o):(.text+0xa2c): undefined reference to `___errno'
./libbfd.a(archive.o):(.text+0xc16): undefined reference to `___errno'
./libbfd.a(archive.o):(.text+0x1e8a): undefined reference to `_filename_ncmp'
./libbfd.a(archive.o):(.text+0x2f6f): undefined reference to `_getuid'
./libbfd.a(archive.o):(.text+0x2f7a): undefined reference to `_getgid'
./libbfd.a(archive.o):(.text+0x3014): undefined reference to `___errno'
./libbfd.a(archive.o):(.text+0x3570): undefined reference to `_getuid'
./libbfd.a(archive.o):(.text+0x3577): undefined reference to `_getgid'
./libbfd.a(elf32.o):(.text+0x25e3): undefined reference to `___errno'
./libbfd.a(elf32.o):(.text+0x2767): undefined reference to `___errno'
./libbfd.a(elf32.o):(.text+0x278d): undefined reference to `___errno'
./libbfd.a(elf.o):(.text+0x4c6c): undefined reference to `___getreent'
./libbfd.a(elf.o):(.text+0x4c7c): undefined reference to `___getreent'
./libbfd.a(elf.o):(.text+0x4cad): undefined reference to `___getreent'
./libbfd.a(elf.o):(.text+0x4cd1): undefined reference to `___getreent'
./libbfd.a(elf.o):(.text+0x4ce9): undefined reference to `___getreent'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: Offset (8688) greater than or equal to .debug_abbrev size (760).
./libintl.a(dcigettext.o):dcigettext.c:(.text+0x4a5): undefined reference to `_pthread_rwlock_rdlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '0', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0x500): undefined reference to `_pthread_rwlock_unlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '20039', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0x605): undefined reference to `_pthread_rwlock_wrlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '8259', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0x65c): undefined reference to `_pthread_rwlock_unlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '11829', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0x678): undefined reference to `_pthread_mutex_lock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '12033', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0x712): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '12146', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0x727): undefined reference to `_pthread_mutex_unlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '12131', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0x7a2): undefined reference to `_pthread_mutex_unlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '27491', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0x995): undefined reference to `_pthread_rwlock_unlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '29541', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0x9c9): undefined reference to `_pthread_mutex_unlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '29797', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0x9f5): undefined reference to `_pthread_mutex_lock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '29816', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0xa12): undefined reference to `_pthread_mutex_unlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '29797', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0xa75): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '29816', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0xa86): undefined reference to `_pthread_rwlock_rdlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '12590', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0xd20): undefined reference to `_pthread_rwlock_wrlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '11825', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0xd4b): undefined reference to `_pthread_rwlock_unlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '12082', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0xd67): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '12131', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0xd83): undefined reference to `_pthread_rwlock_unlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '29812', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0xe51): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '11636', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0xe73): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '14385', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0xf3c): undefined reference to `_pthread_rwlock_unlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '12590', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0xf71): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '29797', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0xfc1): undefined reference to `_getuid'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '29816', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0xfc8): undefined reference to `_geteuid'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '28527', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0x10b4): undefined reference to `_getgid'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '11823', this reader only handles version 2 and 3 information.
./libintl.a(dcigettext.o):dcigettext.c:(.text+0x10bb): undefined reference to `_getegid'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: Offset (11108) greater than or equal to .debug_abbrev size (433).
./libintl.a(loadmsgcat.o):loadmsgcat.c:(.text+0x17): undefined reference to `_pthread_mutex_lock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '0', this reader only handles version 2 and 3 information.
./libintl.a(loadmsgcat.o):loadmsgcat.c:(.text+0xc8): undefined reference to `_mmap'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '20039', this reader only handles version 2 and 3 information.
./libintl.a(loadmsgcat.o):loadmsgcat.c:(.text+0x18e): undefined reference to `_munmap'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '8259', this reader only handles version 2 and 3 information.
./libintl.a(loadmsgcat.o):loadmsgcat.c:(.text+0x1b0): undefined reference to `_pthread_mutex_unlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '11829', this reader only handles version 2 and 3 information.
./libintl.a(loadmsgcat.o):loadmsgcat.c:(.text+0x1ca): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '12033', this reader only handles version 2 and 3 information.
./libintl.a(loadmsgcat.o):loadmsgcat.c:(.text+0x383): undefined reference to `_pthread_rwlock_init'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '12146', this reader only handles version 2 and 3 information.
./libintl.a(loadmsgcat.o):loadmsgcat.c:(.text+0xfbd): undefined reference to `_munmap'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: Offset (400) greater than or equal to .debug_abbrev size (238).
./libintl.a(localcharset.o):localcharset.c:(.text+0x11): undefined reference to `_nl_langinfo'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: Offset (1252) greater than or equal to .debug_abbrev size (264).
./libintl.a(finddomain.o):finddomain.c:(.text+0x17): undefined reference to `_pthread_rwlock_rdlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '0', this reader only handles version 2 and 3 information.
./libintl.a(finddomain.o):finddomain.c:(.text+0x87): undefined reference to `_pthread_rwlock_unlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '20039', this reader only handles version 2 and 3 information.
./libintl.a(finddomain.o):finddomain.c:(.text+0x15d): undefined reference to `_pthread_rwlock_wrlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '8259', this reader only handles version 2 and 3 information.
./libintl.a(finddomain.o):finddomain.c:(.text+0x1cb): undefined reference to `_pthread_rwlock_unlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: Offset (1604) greater than or equal to .debug_abbrev size (528).
./libintl.a(log.o):log.c:(.text+0xe7): undefined reference to `_pthread_mutex_lock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '0', this reader only handles version 2 and 3 information.
./libintl.a(log.o):log.c:(.text+0x247): undefined reference to `_pthread_mutex_unlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: Offset (436) greater than or equal to .debug_abbrev size (265).
./libintl.a(plural-exp.o):plural-exp.c:(.text+0x4e): undefined reference to `__imp____ctype_ptr__'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: Offset (1504) greater than or equal to .debug_abbrev size (357).
./libintl.a(l10nflist.o):l10nflist.c:(.text+0x2e0): undefined reference to `_argz_next'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '0', this reader only handles version 2 and 3 information.
./libintl.a(l10nflist.o):l10nflist.c:(.text+0x469): undefined reference to `_argz_stringify'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '20039', this reader only handles version 2 and 3 information.
./libintl.a(l10nflist.o):l10nflist.c:(.text+0x48a): undefined reference to `_argz_count'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '8259', this reader only handles version 2 and 3 information.
./libintl.a(l10nflist.o):l10nflist.c:(.text+0x4f9): undefined reference to `__imp____ctype_ptr__'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '11829', this reader only handles version 2 and 3 information.
./libintl.a(l10nflist.o):l10nflist.c:(.text+0x558): undefined reference to `__imp____ctype_ptr__'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: Offset (2788) greater than or equal to .debug_abbrev size (665).
./libintl.a(localealias.o):localealias.c:(.text+0xd6): undefined reference to `__imp____ctype_ptr__'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '0', this reader only handles version 2 and 3 information.
./libintl.a(localealias.o):localealias.c:(.text+0x464): undefined reference to `_pthread_mutex_lock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '20039', this reader only handles version 2 and 3 information.
./libintl.a(localealias.o):localealias.c:(.text+0x4f1): undefined reference to `_pthread_mutex_unlock'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: Offset (178020) greater than or equal to .debug_abbrev size (1313).
./libiconv.a(iconv.o):iconv.c:(.text+0x11177): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found address size '85', this reader can not handle sizes greater than '8'.
./libiconv.a(iconv.o):iconv.c:(.text+0x1122f): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '20039', this reader only handles version 2 and 3 information.
./libiconv.a(iconv.o):iconv.c:(.text+0x11246): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '8259', this reader only handles version 2 and 3 information.
./libiconv.a(iconv.o):iconv.c:(.text+0x11262): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '11829', this reader only handles version 2 and 3 information.
./libiconv.a(iconv.o):iconv.c:(.text+0x1127d): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '12033', this reader only handles version 2 and 3 information.
./libiconv.a(iconv.o):iconv.c:(.text+0x112a6): more undefined references to `___errno' follow
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '12146', this reader only handles version 2 and 3 information.
./libiconv.a(iconv.o):iconv.c:(.text+0x113fb): undefined reference to `___locale_mb_cur_max'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '12131', this reader only handles version 2 and 3 information.
./libiconv.a(iconv.o):iconv.c:(.text+0x114d4): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '27491', this reader only handles version 2 and 3 information.
./libiconv.a(iconv.o):iconv.c:(.text+0x1153f): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '29541', this reader only handles version 2 and 3 information.
./libiconv.a(iconv.o):iconv.c:(.text+0x1160d): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '25193', this reader only handles version 2 and 3 information.
./libiconv.a(iconv.o):iconv.c:(.text+0x1161e): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '28271', this reader only handles version 2 and 3 information.
./libiconv.a(iconv.o):iconv.c:(.text+0x11631): undefined reference to `___errno'
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/bin/ld: Dwarf Error: found dwarf version '26988', this reader only handles version 2 and 3 information.
./libiconv.a(iconv.o):iconv.c:(.text+0x11732): more undefined references to `___errno' follow
/usr/lib/gcc/i586-mingw32msvc/4.2.1-sjlj/../../../../i586-mingw32msvc/lib/libmingw32.a(main.o):(.text+0x85): undefined reference to `_WinMain@16'
collect2: ld returned 1 exit status

Tried to search for some of these symbolds, but with no luck. Can anyone help me? PS: Why there is no service that indexes libraries? Thanx in advance.

Community
  • 1
  • 1
Stepan Yakovenko
  • 8,670
  • 28
  • 113
  • 206
  • I would try to reorder the `-l...` parameter on the command line. Putting `-lbfd` at the front position and adding `-lintl -liconv` could help. – jofel Dec 10 '12 at 13:35
  • Done this, but I still get errors.... – Stepan Yakovenko Dec 10 '12 at 15:10
  • I've updated description, would you be so kind to take a look. – Stepan Yakovenko Dec 10 '12 at 15:15
  • It seems that you try to mix libraries compiled with different compilers or compiler versions. Furthermore, stack.cc is not a complete program, but a library that you link with your program. At the moment, you compile it as a main program and not as a library (WinMain error). For a possible main program, see inside the `example` folder. Furthermore, the bug http://sourceforge.net/tracker/?func=detail&atid=102435&aid=2988371&group_id=2435 could affect you. Have you considered using http://www.mr-edd.co.uk/code/dbg instead? – jofel Dec 10 '12 at 16:35
  • I cant build dbg. Its says NameError: name 'project' is not defined. I use: python3 ./make.py – Stepan Yakovenko Dec 10 '12 at 17:30
  • For dbg, you need probably python 2.x and https://bitbucket.org/edd/doozer and later https://bitbucket.org/edd/fungo/src . However, everything do not seem to be user-friendly at all. Compiling manually could work, but as far as I have tested it, seems to need modification in the code. – jofel Dec 10 '12 at 18:09
  • let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/20890/discussion-between-stiv-and-jofel) – Stepan Yakovenko Dec 10 '12 at 19:20

1 Answers1

1

It seems that your libraries comes from different compilers or compiler versions. Reinstalling/rebuilding everything should help.

However, the best way is to switch to dbg. It is like stack_trace, but completely rewritten and under a more liberal license. It does not depend on libfd.

tukan
  • 17,050
  • 1
  • 20
  • 48
jofel
  • 3,297
  • 17
  • 31