Find the answer to your Linux question:
Results 1 to 4 of 4
Hi all I searched throughout the web but cannot find the solution for the following problem. I have an application that uses mysql C API and I need to compile ...
  1. #1
    Just Joined!
    Join Date
    Sep 2005
    Posts
    3

    Problem compiling 32bit app on 64 bit Ubuntu

    Hi all
    I searched throughout the web but cannot find the solution for the following problem.
    I have an application that uses mysql C API and I need to compile it in 32 bit mode on 64bit Ubuntu 9.04 distribution.
    I installed 32 bit libmysql library and numerous libraries that I found over internet but no luck.

    Can anyone here help me out?

    makefile content:

    Code:
    SQL_LIB := $(shell mysql_config --libs)
    SQL_HEADERS := $(shell mysql_config --include)
    
    progy:
    	gcc -m32 progy.c -o progy `$(CFG) --cflags` `$(CFG) --libs`
    When I try to compile, the first part goes OK (ok few warnings but nothing major), but then it collapses with errors like this:

    Code:
    /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib32/libmysqlclient.a(libmysql.o): In function `fetch_float_with_conversion':
    (.text+0x27d9): undefined reference to `floor'
    ...
    /usr/lib/gcc/x86_64-linux-gnu/4.3.3/../../../../lib32/libmysqlclient.a(libtaocrypt_la-dh.o): In function `TaoCrypt::DH::GeneratePrivate(TaoCrypt::RandomNumberGenerator&, unsigned char*)':
    (.text+0x4f4): undefined reference to `pow'
    and so on...

    Anyone has any idea on what I'm doing wrong here?
    Any help greatly appreciated.

  2. #2
    scm
    scm is offline
    Linux Engineer
    Join Date
    Feb 2005
    Posts
    1,044
    Looks like you're missing the math library (-lm). Does it compile okay in 64 bit mode?

  3. #3
    Just Joined!
    Join Date
    Sep 2005
    Posts
    3
    Yeap, as soon as I lose the 32 bit flag (-m32), it compiles just fine

  4. #4
    Linux Guru coopstah13's Avatar
    Join Date
    Nov 2007
    Location
    NH, USA
    Posts
    3,149
    do you have 32 bit math library installed?

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
...