Re: Touble with Win32-API-0.41

From: Sisyphus (kalinaubears_at_iinet.net.au)
Date: 02/16/04

  • Next message: Martien Verbruggen: "Re: Help: Image::Magick::Thumbnail"
    Date: Mon, 16 Feb 2004 14:44:08 +1100
    
    

    C McKay wrote:

    > Creating library file: libCallback.dll.a
    > Callback.o(.text+0x87b):Callback.c: undefined reference to `_itoa'
    > Callback.o(.text+0xf87):Callback.c: undefined reference to `_itoa'
    > collect2: ld returned 1 exit status
    > perlld: *** system() failed to execute

    I was able to compile the code below by simply running 'gcc itoa.c'.
    No additional libs needed to be linked in. (Removing the leading
    underscores made no difference at all.)

    Will it build for you ? Your post suggests that it won't - but if you
    can get that code to compile, then you should not have that trouble with
    Win32::API.

    I am using Mingw (but not Cygwin). Doing a search of your compiler's
    '.a' files for the string 'itoa' should throw up something. I get
    matches in 7 separate files including libcrtdll.a, libmsvcrt.a and
    libntdll.a. Is 'itoa' not defined in *any* of your library files ? If
    it's simply not there, then I don't know what you can do - maybe the
    Cygwin list would be able to provide better help.

    #include <stdlib.h>
    #include <stdio.h>

    int main()
    {
        char buffer[20];
        int i = 3445;
        long l = -344115L;
        unsigned long ul = 1234567890UL;

        _itoa( i, buffer, 10 );
        printf( "String of integer %d (radix 10): %s\n", i, buffer );
        _itoa( i, buffer, 16 );
        printf( "String of integer %d (radix 16): 0x%s\n", i, buffer );
        _itoa( i, buffer, 2 );
        printf( "String of integer %d (radix 2): %s\n", i, buffer );

        _ltoa( l, buffer, 16 );
        printf( "String of long int %ld (radix 16): 0x%s\n", l,
                                                         buffer );

        _ultoa( ul, buffer, 16 );
        printf( "String of unsigned long %lu (radix 16): 0x%s\n", ul,
                                                         buffer );
    }

    Hth .... somehow :-)

    Cheers,
    Rob

    -- 
    To reply by email u have to take out the u in kalinaubears.
    

  • Next message: Martien Verbruggen: "Re: Help: Image::Magick::Thumbnail"

    Relevant Pages

    • Re: How do I install this missing library?
      ... you really should be carefully following LSTC's installation ... libg2c is part of gcc. ... to tell a newcomer to compile. ... like the source code to GNU tar, and make sure you understand what's ...
      (comp.os.linux.misc)
    • Re: HPGCC Questions ladies and gentlemen!!!
      ... No matter how you slice it in order to compile a C program you need to know ... it took a few hours just to get gcc running in my computer ... of the students that used an ide in the c++ class I took a few years ago. ... so why not use a data inspector if it's available? ...
      (comp.sys.hp48)
    • Re: Aquarius prolog so fast?
      ... Mercury cannot do all this because Mercury cannot keep track of the fact ... you need this capability quite rarely, ... Why not the alternative GCC back-end, ... While Mercury can compile to the internal data structures of the gcc backend, ...
      (comp.lang.prolog)
    • Re: Just starting out in C
      ... was based on the ANSI standard as it was being developed. ... Some words about gcc: ... gcc provides some extensions to the language that aren't supported by ... For example, to compile the Hello, World program, use the command line ...
      (comp.lang.c)
    • Re: Question about gcc on OS X 10.0.4.11 Tiger
      ... running Linux and gcc 4.0.2. ... How do I switch to a different version of gcc to compile with on OS X ... fgetsis a libc function and is not really part of the compiler. ... int main(int argc, char* argv){ ...
      (comp.sys.mac.programmer.help)