FAQ
Hello,

i want to cross-compile mysql++ 3.1.0 on Ubuntu (32 bit, x86)
The resulting code shall run on a ARM Linux system.
Compiler itself is running.
I have mysql already running on ARM Linux and copied the mysql include and libs to my build machine
(located in /home/testuser/mm11/mysql5_from_arm_board/include and /home/testuser/mm11/mysql5_from_arm_board/libs)
C compiler is gcc for ARM Linux (the free edition from Codesourcery, now Mentor Graphics)

I have created a shell script to setup my variable:

export CC=/home/testuser/mm11/arm-2007q3/bin/arm-none-linux-gnueabi-gcc
export CXX=/home/testuser/mm11/arm-2007q3/bin/arm-none-linux-gnueabi-g++
export LD=/home/testuser/mm11/arm-2007q3/bin/arm-none-linux-gnueabi-gcc
export AR=/home/testuser/mm11/arm-2007q3/bin/arm-none-linux-gnueabi-ar
export RANLIB=/home/testuser/mm11/arm-2007q3/bin/arm-none-linux-gnueabi-ranlib
export ac_cv_func_getpgrp_void=yes
export ac_cv_func_setpgrp_void=yes
./configure --target=arm-linux --host=arm-linux --with-mysql-lib=/home/testuser/mm11/mysql5_from_arm_board/lib --with-mysql-include=/home/testuser/mm11/mysql5_from_arm_board/include

Then i call the shell script and configure runs and prints the following:

$ ./mysqlpp_comp.sh
configure: WARNING: If you wanted to set the --build type, don't use --host.
If a cross compiler is detected then cross compile mode will be used.
checking build system type... i686-pc-linux-gnu
checking host system type... arm-unknown-linux-gnu
checking target system type... arm-unknown-linux-gnu
checking for arm-linux-gcc... /home/testuser/mm11/arm-2007q3/bin/arm-none-linux-gnueabi-gcc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... yes
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether /home/testuser/mm11/arm-2007q3/bin/arm-none-linux-gnueabi-gcc accepts -g... yes
checking for /home/testuser/mm11/arm-2007q3/bin/arm-none-linux-gnueabi-gcc option to accept ANSI C... none needed
checking whether we are using the Intel C compiler... no
checking for arm-linux-g++... /home/testuser/mm11/arm-2007q3/bin/arm-none-linux-gnueabi-g++
checking whether we are using the GNU C++ compiler... yes
checking whether /home/testuser/mm11/arm-2007q3/bin/arm-none-linux-gnueabi-g++ accepts -g... yes
checking whether we are using the Intel C++ compiler... no
checking whether we are using the Sun C++ compiler... no
checking for arm-linux-ranlib... /home/testuser/mm11/arm-2007q3/bin/arm-none-linux-gnueabi-ranlib
checking for a BSD-compatible install... /usr/bin/install -c
checking whether ln -s works... yes
checking whether make sets $(MAKE)... yes
checking for arm-linux-ar... /home/testuser/mm11/arm-2007q3/bin/arm-none-linux-gnueabi-ar
checking for arm-linux-strip... no
checking for strip... strip
checking for arm-linux-nm... no
checking for nm... nm
checking for command to install directories... /usr/bin/install -c -d
checking if make is GNU make... yes
checking for dependency tracking method... gcc
checking for arm-linux-gcc... (cached) /home/testuser/mm11/arm-2007q3/bin/arm-none-linux-gnueabi-gcc
checking whether we are using the GNU C compiler... (cached) yes
checking whether /home/testuser/mm11/arm-2007q3/bin/arm-none-linux-gnueabi-gcc accepts -g... (cached) yes
checking for /home/testuser/mm11/arm-2007q3/bin/arm-none-linux-gnueabi-gcc option to accept ANSI C... (cached) none needed
checking how to run the C preprocessor... /home/testuser/mm11/arm-2007q3/bin/arm-none-linux-gnueabi-gcc -E
checking for egrep... grep -E
checking for ANSI C header files... yes
checking for getopt... yes
checking whether -lm is needed to use C math functions... no
checking whether -lsocket is needed... no
checking whether -lnsl is needed... no
checking for MySQL library directory... /home/testuser/mm11/mysql5_from_arm_board/lib
checking for MySQL include directory... /home/testuser/mm11/mysql5_from_arm_board/include
checking if we can link to MySQL C API library directly... no
checking zlib.h usability... no
checking zlib.h presence... no
checking for zlib.h... no
checking whether adding -lz will let MySQL C API link succeed... no
configure: error: Unable to link to MySQL client library!

How can i see with more detail what configure is currently doing in this step ?
Or is there something missing, e.g. additional packages ? Is this error message still related to zlib ?
Do i need to change something in the script ?

Best regards,

Martin

Search Discussions

  • Jonathan Wakely at Jan 13, 2012 at 3:48 pm

    On 13 January 2012 15:43, Martin Maurer wrote:
    checking for MySQL library directory... /home/testuser/mm11/mysql5_from_arm_board/lib
    checking for MySQL include directory... /home/testuser/mm11/mysql5_from_arm_board/include
    checking if we can link to MySQL C API library directly... no
    checking zlib.h usability... no
    checking zlib.h presence... no
    checking for zlib.h... no
    checking whether adding -lz will let MySQL C API link succeed... no
    configure: error: Unable to link to MySQL client library!

    How can i see with more detail what configure is currently doing in this step ?
    Is there a config.log file created in the current directory?

    --
    MySQL++ Mailing List
    For list archives: http://lists.mysql.com/plusplus
    To unsubscribe: http://lists.mysql.com/plusplus
  • Martin Maurer at Jan 13, 2012 at 4:10 pm

    On 13 January 2012 15:43, Martin Maurer wrote:
    checking for MySQL library directory...
    /home/testuser/mm11/mysql5_from_arm_board/lib
    checking for MySQL include directory...
    /home/testuser/mm11/mysql5_from_arm_board/include
    checking if we can link to MySQL C API library directly... no
    checking zlib.h usability... no
    checking zlib.h presence... no
    checking for zlib.h... no
    checking whether adding -lz will let MySQL C API link succeed... no
    configure: error: Unable to link to MySQL client library!

    How can i see with more detail what configure is currently doing in this
    step ?
    Is there a config.log file created in the current directory?
    Here is the content of the logfile: see Attachment

    Best regards,

    Martin
  • Jonathan Wakely at Jan 13, 2012 at 4:17 pm

    On 13 January 2012 16:09, Martin Maurer wrote:
    On 13 January 2012 15:43, Martin Maurer wrote:

    checking for MySQL library directory...
    /home/testuser/mm11/mysql5_from_arm_board/lib
    checking for MySQL include directory...
    /home/testuser/mm11/mysql5_from_arm_board/include
    checking if we can link to MySQL C API library directly... no
    checking zlib.h usability... no
    checking zlib.h presence... no
    checking for zlib.h... no
    checking whether adding -lz will let MySQL C API link succeed... no
    configure: error: Unable to link to MySQL client library!

    How can i see with more detail what configure is currently doing in this
    step ?

    Is there a config.log file created in the current directory?

    Here is the content of the logfile: see Attachment
    I didn't ask to see it, I asked if it's there, because that's where
    you should look to see more detail of what configure is currently
    doing.

    But since you sent it ...

    If you look for the test "configure:9195: checking if we can link to
    MySQL C API library directly" you will see it failed with this error:

    arm-none-linux-gnueabi/bin/ld: warning: libz.so.1, needed by
    /home/testuser/mm11/
    mysql5_from_arm_board/lib/libmysqlclient.so, not found (try using
    -rpath or -rpath-link)
    /home/testuser/mm11/mysql5_from_arm_board/lib/libmysqlclient.so: undefined
    reference to `compress'
    /home/testuser/mm11/mysql5_from_arm_board/lib/libmysqlclient.so: undefined
    reference to `uncompress'

    The following tests then try to resolve the problem by including
    zlib.h (which fails because it's not installed) and linking to -lz
    (which fails because it's not installed).

    Basically, you need libz.so.1 built for your ARM system.

    --
    MySQL++ Mailing List
    For list archives: http://lists.mysql.com/plusplus
    To unsubscribe: http://lists.mysql.com/plusplus
  • Martin Maurer at Jan 13, 2012 at 5:09 pm
    Hello Wakely,
    On 13 January 2012 16:09, Martin Maurer wrote:
    On 13 January 2012 15:43, Martin Maurer wrote:

    checking for MySQL library directory...
    /home/testuser/mm11/mysql5_from_arm_board/lib
    checking for MySQL include directory...
    /home/testuser/mm11/mysql5_from_arm_board/include
    checking if we can link to MySQL C API library directly... no
    checking zlib.h usability... no
    checking zlib.h presence... no
    checking for zlib.h... no
    checking whether adding -lz will let MySQL C API link succeed... no
    configure: error: Unable to link to MySQL client library!

    How can i see with more detail what configure is currently doing in
    this
    step ?

    Is there a config.log file created in the current directory?

    Here is the content of the logfile: see Attachment
    I didn't ask to see it, I asked if it's there, because that's where
    you should look to see more detail of what configure is currently
    doing.

    But since you sent it ...

    If you look for the test "configure:9195: checking if we can link to
    MySQL C API library directly" you will see it failed with this error:

    arm-none-linux-gnueabi/bin/ld: warning: libz.so.1, needed by
    /home/testuser/mm11/
    mysql5_from_arm_board/lib/libmysqlclient.so, not found (try using
    -rpath or -rpath-link)
    /home/testuser/mm11/mysql5_from_arm_board/lib/libmysqlclient.so: undefined
    reference to `compress'
    /home/testuser/mm11/mysql5_from_arm_board/lib/libmysqlclient.so: undefined
    reference to `uncompress'

    The following tests then try to resolve the problem by including
    zlib.h (which fails because it's not installed) and linking to -lz
    (which fails because it's not installed).

    Basically, you need libz.so.1 built for your ARM system.
    just want to say a big thank you for your quick help !

    I copied libs and header files for libz, added CFLAGS and LDFLAGS to point
    to them and "configure" was successful.
    And even "make" was successful.

    Looking forward to testing and using it.

    Best regards,

    Martin



    --
    MySQL++ Mailing List
    For list archives: http://lists.mysql.com/plusplus
    To unsubscribe: http://lists.mysql.com/plusplus
  • Jonathan Wakely at Jan 13, 2012 at 5:10 pm

    On 13 January 2012 17:08, Martin Maurer wrote:
    I copied libs and header files for libz, added CFLAGS and LDFLAGS to point
    to them and "configure" was successful.
    And even "make" was successful.
    Excellent :)

    --
    MySQL++ Mailing List
    For list archives: http://lists.mysql.com/plusplus
    To unsubscribe: http://lists.mysql.com/plusplus
  • Martin Maurer at Jan 14, 2012 at 5:47 pm
    Hello Jonathan et all,
    I copied libs and header files for libz, added CFLAGS and LDFLAGS to
    point
    to them and "configure" was successful.
    And even "make" was successful.
    Excellent :)
    may i come back with an additional error please, which i have with my
    program where i added mysql++:
    I built a pgm which uses the (self-built) mysql++ and some other libaries
    needed by mysql++ (e.g. libz).

    When i now start the program on ARM Linux board i get the following error
    messages:

    root@arm:~# ./mypgm
    ./mypgm: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.14' not found
    (required by ./mypgm)
    ./mypgm: /usr/lib/libstdc++.so.6: version `CXXABI_ARM_1.3.3' not found
    (required by ./mypgm)
    root@arm:~# ls /usr/lib/libstdc\+\+.
    /usr/lib/libstdc++.a /usr/lib/libstdc++.so.6
    /usr/lib/libstdc++.la /usr/lib/libstdc++.so.6.0.10
    /usr/lib/libstdc++.so

    I have libstdc++.so.6 and it seems it was already used.
    But somehow libstdc++ does not contain GLIBCXX_3.4.14 nor CXXABI_ARM_1.3.3.
    I already tried to update libstdc++, but i already have latest version.

    I also tried to use a different cross compiler version (an older one) to get
    rid of the error message,
    but error and version number in error messages remain the same.

    Do i need to install additional libs / packages ? Can someone shed some
    light, if the libstdc++ is the problem,
    or that libstdc++ needs something additional ?

    Best regards,

    Martin




    --
    MySQL++ Mailing List
    For list archives: http://lists.mysql.com/plusplus
    To unsubscribe: http://lists.mysql.com/plusplus
  • Jonathan Wakely at Jan 14, 2012 at 5:52 pm

    On 14 January 2012 17:46, Martin Maurer wrote:
    When i now start the program on ARM Linux board i get the following error
    messages:

    root@arm:~# ./mypgm
    ./mypgm: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.14' not found
    (required by ./mypgm)
    ./mypgm: /usr/lib/libstdc++.so.6: version `CXXABI_ARM_1.3.3' not found
    (required by ./mypgm)
    root@arm:~# ls /usr/lib/libstdc\+\+.
    /usr/lib/libstdc++.a          /usr/lib/libstdc++.so.6
    /usr/lib/libstdc++.la         /usr/lib/libstdc++.so.6.0.10
    /usr/lib/libstdc++.so

    I have libstdc++.so.6 and it seems it was already used.
    But somehow libstdc++ does not contain GLIBCXX_3.4.14 nor CXXABI_ARM_1.3.3.
    I already tried to update libstdc++, but i already have latest version.
    This means the libstdc++.so on your ARM board is from an older GCC
    than you used to compile and link with. The program (or mysql++)
    requires the newer libstdc++.so that matches the compiler it was built
    with.

    libstdc++.so.6.0.10 is from GCC 4.3.0, the symbol version
    GLIBCXX_3.4.14 is from GCC 4.5.0

    http://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning

    --
    MySQL++ Mailing List
    For list archives: http://lists.mysql.com/plusplus
    To unsubscribe: http://lists.mysql.com/plusplus
  • Martin Maurer at Jan 15, 2012 at 7:03 pm
    Hello Jonathan,
    ./mypgm: /usr/lib/libstdc++.so.6: version `GLIBCXX_3.4.14' not found
    (required by ./mypgm)
    ./mypgm: /usr/lib/libstdc++.so.6: version `CXXABI_ARM_1.3.3' not found
    (required by ./mypgm)
    root@arm:~# ls /usr/lib/libstdc\+\+.
    /usr/lib/libstdc++.a /usr/lib/libstdc++.so.6
    /usr/lib/libstdc++.la /usr/lib/libstdc++.so.6.0.10
    /usr/lib/libstdc++.so

    I have libstdc++.so.6 and it seems it was already used.
    But somehow libstdc++ does not contain GLIBCXX_3.4.14 nor
    CXXABI_ARM_1.3.3.
    I already tried to update libstdc++, but i already have latest version.
    This means the libstdc++.so on your ARM board is from an older GCC
    than you used to compile and link with. The program (or mysql++)
    requires the newer libstdc++.so that matches the compiler it was built
    with.
    libstdc++.so.6.0.10 is from GCC 4.3.0, the symbol version
    GLIBCXX_3.4.14 is from GCC 4.5.0
    http://gcc.gnu.org/onlinedocs/libstdc++/manual/abi.html#abi.versioning
    just want to say "thank you" again ! Your help is great !

    I have installed libstdc++.so.6.0.16 (which was delivered with the compiler)
    on ARM board.
    Now program is running and can access the MySQL database.

    Best regards,

    Martin


    --
    MySQL++ Mailing List
    For list archives: http://lists.mysql.com/plusplus
    To unsubscribe: http://lists.mysql.com/plusplus
  • Paul at Jun 15, 2012 at 2:25 pm

    Jonathan Wakely <mysql <at> kayari.org> writes:

    On 13 January 2012 17:08, Martin Maurer wrote:

    I copied libs and header files for libz, added CFLAGS and LDFLAGS to point
    to them and "configure" was successful.
    And even "make" was successful.
    Excellent :)

    I'm sorry I have the same problem. How did you added CFLAGS and LDFLAGS? Can
    you share your configure command or script?

    Thank you


    --
    MySQL++ Mailing List
    For list archives: http://lists.mysql.com/plusplus
    To unsubscribe: http://lists.mysql.com/plusplus
  • Warren Young at Jun 15, 2012 at 3:04 pm

    On 6/15/2012 7:47 AM, Paul wrote:
    How did you added CFLAGS and LDFLAGS?
    The same way you do with any autoconf-generated configure script:

    $ ./configure CFLAGS=-stuff LDFLAGS="-more -Wl,stuff"

    Perhaps this chapter in the autoconf FM will help?

    http://sources.redhat.com/autobook/autobook/autobook_258.html

    --
    MySQL++ Mailing List
    For list archives: http://lists.mysql.com/plusplus
    To unsubscribe: http://lists.mysql.com/plusplus

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupplusplus @
categoriesmysql
postedJan 13, '12 at 3:44p
activeJun 15, '12 at 3:04p
posts11
users4
websitemysql.com
irc#mysql

People

Translate

site design / logo © 2022 Grokbase