aMule Forum

Please login or register.

Login with username, password and session length
Advanced search  

News:

We're back! (IN POG FORM)

Author Topic: Link errors when compiling command line client  (Read 3018 times)

emule_os2

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 10
Link errors when compiling command line client
« on: September 21, 2005, 01:32:00 AM »

I'm working on porting amule to OS/2, starting with the command line client. I've gotton it up to linking, but I'm getting unresolved external errors. While I'm pretty good with C, I haven't done too much with C++. Perhaps I'm missing something obvious. Even if you can't tell me the solition, it would be good to know what theses symbols have in common that might cause an error.

Using OS/2 I'm compiling with gcc 3.3.5, but it is calling the OS/2 linker ilink. Most UNIX utilities have been ported to OS/2, although you might find a few of the command line arguments unfamilar, things work a lot like they do on UNIX.

I made some small changes to the makefiles. I took out  the  "-lpthread" and  "-ggdb"  parameter.l

First there error:

g++  -DUSE_EMBEDDED_CRYPTO -W -Wall -g -fno-inline -D__DEBUG__ -fmessage-length=0     -o amulecmd.exe  amulecmd-TextClient.o amulecmd-MD5Sum.o amulecmd-ECSocket.o amulecmd-ExternalConnector.o amulecmd-ECPacket.o amulecmd-ECSpecialTags.o amulecmd-OtherFunctions.o amulecmd-StringFunctions.o amulecmd-Format.o -L/wxpm/lib -Zomf  -Zcrtdll  -L/usr/X11R6/lib -Zmt  -Zlinker /EXEPACK -lwx_base-2.6 -lwx_base_net-2.6   -lz  -lbfd -liberty
weakld: error: Unresolved symbol (UNDEF) '__GLOBAL__D__ZN6MD5SumC2Ev'.
weakld: info: The symbol is referenced by:
    C:\tcpip\tmp\ldconv_amulecmd-MD5Sum_o_8347433097e9155730.obj
weakld: error: Unresolved symbol (UNDEF) '__GLOBAL__I__Z11utf8_mbtowcPjPKhi'.
weakld: info: The symbol is referenced by:
    C:\tcpip\tmp\ldconv_amulecmd-ECSocket_o_8347433097e91687e0.obj
weakld: error: Unresolved symbol (UNDEF) '__GLOBAL__I__ZN6CECTag12s_theNullTagE'.
weakld: info: The symbol is referenced by:
    C:\tcpip\tmp\ldconv_amulecmd-ECPacket_o_8347433097eb121ef8.obj
weakld: error: Unresolved symbol (UNDEF) '__GLOBAL__I__ZN6MD5SumC2Ev'.
weakld: info: The symbol is referenced by:
    C:\tcpip\tmp\ldconv_amulecmd-MD5Sum_o_8347433097e9155730.obj
weakld: error: Unresolved symbol (UNDEF) '__GLOBAL__I__ZN23CaMuleExternalConnectorC2Ev'.
weakld: info: The symbol is referenced by:
    C:\tcpip\tmp\ldconv_amulecmd-ExternalConnector_o_8347433097e91b2f48.obj
weakld: error: Unresolved symbol (UNDEF) '__GLOBAL__D__Z11utf8_mbtowcPjPKhi'.
weakld: info: The symbol is referenced by:
    C:\tcpip\tmp\ldconv_amulecmd-ECSocket_o_8347433097e91687e0.obj
weakld: error: Unresolved symbol (UNDEF) '__GLOBAL__D__ZN23CaMuleExternalConnectorC2Ev'.
weakld: info: The symbol is referenced by:
    C:\tcpip\tmp\ldconv_amulecmd-ExternalConnector_o_8347433097e91b2f48.obj
weakld: error: Unresolved symbol (UNDEF) '__GLOBAL__D__ZN6CECTag12s_theNullTagE'.
weakld: info: The symbol is referenced by:
    C:\tcpip\tmp\ldconv_amulecmd-ECPacket_o_8347433097eb121ef8.obj
Ignoring unresolved externals reported from weak prelinker.

C:\tcpip\tmp\ldconv_amulecmd-ECSocket_o_8347433097e91687e0.obj(ECSocket.cpp) : error LNK2029: "__GLOBAL__D__Z11utf8_mbtowcPjPKhi" : unresolved external
C:\tcpip\tmp\ldconv_amulecmd-ECSocket_o_8347433097e91687e0.obj(ECSocket.cpp) : error LNK2029: "__GLOBAL__I__Z11utf8_mbtowcPjPKhi" : unresolved external
C:\tcpip\tmp\ldconv_amulecmd-ExternalConnector_o_8347433097e91b2f48.obj(ExternalConnector.cpp) : error LNK2029: "__GLOBAL__D__ZN23CaMuleExternalConnectorC2Ev" : unresolved external
C:\tcpip\tmp\ldconv_amulecmd-ExternalConnector_o_8347433097e91b2f48.obj(ExternalConnector.cpp) : error LNK2029: "__GLOBAL__I__ZN23CaMuleExternalConnectorC2Ev" : unresolved external
C:\tcpip\tmp\ldconv_amulecmd-MD5Sum_o_8347433097e9155730.obj(MD5Sum.cpp) : error LNK2029: "__GLOBAL__D__ZN6MD5SumC2Ev" : unresolved external
C:\tcpip\tmp\ldconv_amulecmd-MD5Sum_o_8347433097e9155730.obj(MD5Sum.cpp) : error LNK2029: "__GLOBAL__I__ZN6MD5SumC2Ev" : unresolved external
C:\tcpip\tmp\ldconv_amulecmd-ECPacket_o_8347433097eb121ef8.obj(ECPacket.cpp) : error LNK2029: "__GLOBAL__D__ZN6CECTag12s_theNullTagE" : unresolved external
C:\tcpip\tmp\ldconv_amulecmd-ECPacket_o_8347433097eb121ef8.obj(ECPacket.cpp) : error LNK2029: "__GLOBAL__I__ZN6CECTag12s_theNullTagE" : unresolved external

C:\amule > ash ./configure --enable-amulecmd --with-wx-config=/wxpm/bin/wx-config AWK=awk CC=gcc
configure: creating cache /dev/null
checking build system type... i386-pc-os2-emx
checking host system type... i386-pc-os2-emx
checking target system type... i386-pc-os2-emx
checking for a BSD-compatible install... ./install-sh -c
checking whether build environment is sane... yes
checking for gawk... awk
checking whether make sets $(MAKE)... yes
checking whether to enable maintainer-specific portions of Makefiles... no
checking for g++... no
checking for c++... no
checking for gpp... no
checking for aCC... no
checking for CC... no
checking for cxx... no
checking for cc++... no
checking for cl... no
checking for FCC... no
checking for KCC... no
checking for RCC... no
checking for xlC_r... no
checking for xlC... no
checking for C++ compiler default output file name... conftest.exe
checking whether the C++ compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables... .exe
checking for suffix of object files... o
checking whether we are using the GNU C++ compiler... yes
checking whether g++ accepts -g... yes
checking for style of include used by make... GNU
checking dependency style of g++... gcc3
checking how to run the C++ preprocessor... g++ -E
checking for gcc... gcc
checking whether we are using the GNU C compiler... yes
checking whether gcc accepts -g... yes
checking for gcc option to accept ANSI C... none needed
checking dependency style of gcc... gcc3
checking how to run the C preprocessor... gcc -E
test: x: unexpected operator
checking whether make sets $(MAKE)... (cached) yes
checking for a BSD-compatible install... ./install-sh -c
checking for ranlib... :
checking for bison... no
checking for byacc... no
checking whether ln -s works... no, using cp -p
checking for ranlib... (cached) :
checking for strip... no
checking for ar... no
checking for ld... no
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking for zlib >= 1.1.4... yes (version 1.2.1)
checking whether we need the GUI... yes
checking for wx-config... /wxpm/bin/wx-config
checking for wxWidgets version >= 2.4.2... yes (version 2.6.2)
configure: WARNING: wxWidgets >=2.5.0: Using wx-config --libs base,net
checking for GUI toolkit to use... PM
test: 2: unexpected operator
checking whether to use embedded Crypto... yes
checking for bfd headers... yes
checking for autopoint... yes (0.13)
not updating unwritable cache /dev/null
checking for X... no
checking for working alloca.h... yes
checking for alloca... yes
checking for dirent.h that defines DIR... yes
checking for library containing opendir... none required
checking for ANSI C header files... (cached) yes
checking argz.h usability... yes
checking argz.h presence... yes
checking for argz.h... yes
checking arpa/inet.h usability... yes
checking arpa/inet.h presence... yes
checking for arpa/inet.h... yes
checking fcntl.h usability... yes
checking fcntl.h presence... yes
checking for fcntl.h... yes
checking for inttypes.h... (cached) yes
checking langinfo.h usability... yes
checking langinfo.h presence... yes
checking for langinfo.h... yes
checking libintl.h usability... yes
checking libintl.h presence... yes
checking for libintl.h... yes
checking limits.h usability... yes
checking limits.h presence... yes
checking for limits.h... yes
checking locale.h usability... yes
checking locale.h presence... yes
checking for locale.h... yes
checking malloc.h usability... yes
checking malloc.h presence... yes
checking for malloc.h... yes
checking mntent.h usability... no
checking mntent.h presence... no
checking for mntent.h... no
checking netdb.h usability... yes
checking netdb.h presence... yes
checking for netdb.h... yes
checking netinet/in.h usability... yes
checking netinet/in.h presence... yes
checking for netinet/in.h... yes
checking stddef.h usability... yes
checking stddef.h presence... yes
checking for stddef.h... yes
checking for stdint.h... (cached) yes
checking stdio_ext.h usability... yes
checking stdio_ext.h presence... yes
checking for stdio_ext.h... yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for strings.h... (cached) yes
checking sys/ioctl.h usability... yes
checking sys/ioctl.h presence... yes
checking for sys/ioctl.h... yes
checking sys/mount.h usability... yes
checking sys/mount.h presence... yes
checking for sys/mount.h... yes
checking sys/param.h usability... yes
checking sys/param.h presence... yes
checking for sys/param.h... yes
checking sys/socket.h usability... yes
checking sys/socket.h presence... yes
checking for sys/socket.h... yes
checking sys/statvfs.h usability... yes
checking sys/statvfs.h presence... yes
checking for sys/statvfs.h... yes
checking sys/time.h usability... yes
checking sys/time.h presence... yes
checking for sys/time.h... yes
checking for unistd.h... (cached) yes
checking for sys/wait.h that is POSIX.1 compatible... yes
checking for stdbool.h that conforms to C99... yes
checking for _Bool... yes
checking for an ANSI C-conforming const... yes
checking for inline... inline
checking for mode_t... yes
checking for off_t... yes
checking for size_t... yes
checking whether time.h and sys/time.h may both be included... yes
checking whether struct tm is in sys/time.h or time.h... time.h
checking for uid_t in sys/types.h... yes
checking for working volatile... yes
checking for ptrdiff_t... yes
checking whether closedir returns void... no
checking for msgfmt... no
checking for gmsgfmt... :
checking for xgettext... no
checking for msgmerge... no
checking for library containing strerror... none required
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... yes
checking for working mmap... no
checking whether we are using the GNU C Library 2.1 or newer... no
checking whether integer division by zero raises SIGFPE... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unsigned long long... yes
checking for inttypes.h... yes
checking whether the inttypes.h PRIxNN macros are broken... no
checking for ld used by GCC... C:/gcc/335/usr/i386-pc-os2-emx/bin/ld.exe
checking if the linker (C:/gcc/335/usr/i386-pc-os2-emx/bin/ld.exe) is GNU ld... no
checking for shared library run path origin... done
checking for argz.h... (cached) yes
checking for limits.h... (cached) yes
checking for locale.h... (cached) yes
checking nl_types.h usability... yes
checking nl_types.h presence... yes
checking for nl_types.h... yes
checking for malloc.h... (cached) yes
checking for stddef.h... (cached) yes
checking for stdlib.h... (cached) yes
checking for string.h... (cached) yes
checking for unistd.h... (cached) yes
checking for sys/param.h... (cached) yes
checking for feof_unlocked... yes
checking for fgets_unlocked... yes
checking for getc_unlocked... yes
checking for getcwd... yes
checking for getegid... yes
checking for geteuid... yes
checking for getgid... yes
checking for getuid... yes
checking for mempcpy... yes
checking for munmap... no
checking for putenv... yes
checking for setenv... yes
checking for setlocale... yes
checking for stpcpy... yes
checking for strcasecmp... yes
checking for strdup... yes
checking for strtoul... yes
checking for tsearch... yes
checking for __argz_count... yes
checking for __argz_stringify... yes
checking for __argz_next... yes
checking for iconv... yes
checking for iconv declaration...
         extern size_t iconv (iconv_t cd, const char * *inbuf, size_t *inbytesleft, char * *outbuf, size_t *outbytesleft);
checking for nl_langinfo and CODESET... yes
checking for LC_MESSAGES... yes
checking for bison... no
checking whether NLS is requested... yes
checking whether included gettext is requested... no
checking for GNU gettext in libc... no
checking for GNU gettext in libintl... yes
checking how to link with libintl... -lintl
checking for getmntent in -lsun... no
checking for getmntent in -lseq... no
checking for getmntent in -lgen... no
checking for getmntent... no
checking whether gcc needs -traditional... no
checking for pid_t... yes
checking for unistd.h... (cached) yes
checking vfork.h usability... no
checking vfork.h presence... no
checking for vfork.h... no
checking for fork... yes
checking for vfork... no
checking for working fork... yes
checking whether lstat dereferences a symlink specified with a trailing slash... no
checking whether lstat accepts an empty string... no
checking whether lstat dereferences a symlink specified with a trailing slash... (cached) no
checking for stdlib.h... (cached) yes
checking for GNU libc compatible malloc... yes
checking for working memcmp... yes
checking for stdlib.h... (cached) yes
checking for unistd.h... (cached) yes
checking for getpagesize... (cached) yes
checking for working mmap... (cached) no
checking for stdlib.h... (cached) yes
checking for GNU libc compatible realloc... yes
checking sys/select.h usability... yes
checking sys/select.h presence... yes
checking for sys/select.h... yes
checking for sys/socket.h... (cached) yes
checking types of arguments for select... int,fd_set *,struct timeval *
checking for function prototypes... yes
checking whether setvbuf arguments are reversed... no
checking return type of signal handlers... void
checking whether stat accepts an empty string... no
checking for strftime... yes
checking for working strtod... yes
checking for __argz_count... (cached) yes
checking for __argz_next... (cached) yes
checking for __argz_stringify... (cached) yes
checking for endpwent... yes
checking for floor... yes
checking for ftruncate... yes
checking for getcwd... (cached) yes
checking for gethostbyaddr... yes
checking for gethostbyname... yes
checking for gethostname... yes
checking for getmntent... (cached) no
checking for getmntinfo... yes
checking for getpass... yes
checking for gettimeofday... yes
checking for inet_ntoa... yes
checking for memmove... yes
checking for mempcpy... (cached) yes
checking for memset... yes
checking for munmap... (cached) no
checking for nl_langinfo... yes
checking for select... yes
checking for setlocale... (cached) yes
checking for socket... yes
checking for sqrt... yes
checking for stpcpy... (cached) yes
checking for strcasecmp... (cached) yes
checking for strchr... yes
checking for strcspn... yes
checking for strdup... (cached) yes
checking for strerror... yes
checking for strncasecmp... yes
checking for strstr... yes
checking for strtoul... (cached) yes
checking sys/resource.h usability... yes
checking sys/resource.h presence... yes
checking for sys/resource.h... yes
checking sys/timeb.h usability... yes
checking sys/timeb.h presence... yes
checking for sys/timeb.h... yes
checking for mkdir... yes
checking for getrlimit... yes
checking for setrlimit... yes
not updating unwritable cache /dev/null
checking whether taskbar icon support should be compiled... yes
checking whether taskbar icon should use UTF-8 strings... no
checking if the applications should be statically linked... no
checking if this is a FreeBSD 4 or earlier system... no
checking for a readline compatible library... no
checking whether ccache support should be added... no
not updating unwritable cache /dev/null
configure: creating ./config.status
config.status: creating Makefile
config.status: creating docs/Makefile
config.status: creating docs/man/Makefile
config.status: creating intl/Makefile
config.status: creating m4/Makefile
config.status: creating src/Makefile
config.status: creating src/kademlia/Makefile
config.status: creating src/kademlia/utils/Makefile
config.status: creating src/kademlia/io/Makefile
config.status: creating src/kademlia/kademlia/Makefile
config.status: creating src/kademlia/routing/Makefile
config.status: creating src/kademlia/net/Makefile
config.status: creating src/pixmaps/Makefile
config.status: creating src/utils/Makefile
config.status: creating src/utils/aLinkCreator/Makefile
config.status: creating src/utils/aLinkCreator/docs/Makefile
config.status: creating src/utils/aLinkCreator/src/Makefile
config.status: creating src/utils/cas/Makefile
config.status: creating src/utils/cas/docs/Makefile
config.status: creating src/utils/wxCas/Makefile
config.status: creating src/utils/wxCas/docs/Makefile
config.status: creating src/utils/wxCas/src/Makefile
config.status: creating src/utils/xas/Makefile
config.status: creating src/utils/xas/docs/Makefile
config.status: creating src/webserver/Makefile
config.status: creating src/webserver/default/Makefile
config.status: creating src/webserver/chicane/Makefile
config.status: creating po/Makefile.in
config.status: creating Compilation.flags
config.status: creating config.h
config.status: config.h is unchanged
config.status: executing depfiles commands
config.status: executing default-1 commands
config.status: creating po/POTFILES
config.status: creating po/Makefile


  Configure script has finished system check.

  Configured aMule 2.0.3 for 'i386-pc-os2-emx'.

  aMule enabled options:

  **** aMule Core ****
  Prefix where aMule should be installed?                    /usr/local
  Should aMule be compiled with i18n support?                yes
  Should aMule be compiled in debug mode?                    yes
  Should aMule be compiled with profiling?                   no
  Should aMule be compiled with optimizations?               no
  Should aMule be compiled with taskbar icon support?        yes
  Should aMule be compiled with old GTK taskbar icon?        no
  Should aMule be compiled with UTF-8 taskbar icon support?  no
  Should aMule be linked against patched gsocket?            no
  Should aMule monolithic application be built?              yes
  Should aMule daemon version be built?                      no
  Should aMule remote gui be built? (EXPERIMENTAL)           no
  Crypto++ library/headers style?                            embedded

  **** aMule TextClient ****
  Should aMule Command Line Client be built?                 yes
  Should aMule GUI Client be built?                          no

  **** aMule WebServer ****
  Should aMule WebServer be built?                           no
  Should aMule WebServer GUI be built?                       no

  **** aMule ED2K Links Handler ****
  Should aMule ED2K Links Handler be built?                  yes

  **** aMuleLinkCreator ****
  Should aMuleLinkCreator GUI version (alc) be built?        no
  Should aMuleLinkCreator for console (alcc) be built?       no

  **** aMule Statistics ****
  Should C aMule Statistics (CAS) be built?                  no
  Should aMule GUI Statistics (wxCas) be built?              no

  **** General Libraries and Tools ****
  Should ccache support be enabled?                          no
  Libraries aMule will use to build:
                                       wxWidgets             2.6.2
                                       crypto++              embedded
                                       zlib                  1.2.1


 WARNING! gd-lib >= 2.0.0, or a functional gd.h (from gd-devel) not found.
 amuleweb will be compiled but file download progress bar images will NOT be generated.
 See the above error on gd check for solutions.
Logged

lfroen

  • Guest
Re: Link errors when compiling command line client
« Reply #1 on: September 21, 2005, 12:01:35 PM »

Quote
I'm working on porting amule to OS/2

I must wake up, because it can't be real. OS/2 ?! Any reason for doing this except for too match spare time ?
Reffering to your question, mixing gcc with non-gnu linker doesn't look like good idea to me. You may encounter some ABI compatability issues.
Logged

emule_os2

  • Approved Newbie
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 10
Linker
« Reply #2 on: September 21, 2005, 06:22:28 PM »

I tested it using the gcc linker and the same errors appear.

I was also wondering if amuleweb uses libpng for anything if gd-lib is unavailable.
Logged

lfroen

  • Guest
Re: Link errors when compiling command line client
« Reply #3 on: September 21, 2005, 06:46:38 PM »

Quote
I was also wondering if amuleweb uses libpng for anything if gd-lib is unavailable.

libpng is used for progress image rendering.
Logged