Results 1 to 3 of 3

Thread: ClanLib 0.8 and undefined references

  1. #1
    Peasant
    Join Date
    Sep 2007
    Posts
    7

    Default ClanLib 0.8 and undefined references

    Well I have compiled and installed ClanLib 0.8 on my Ubuntu edgy system.

    In my configure.ac file I have a row that looks like this:
    AC_CHECK_LIB(clanApp,main, ,echo "Clan Ops requires ClanLib to run. clanApp missing"; exit 1)

    After I have run autoconf etc. I run ./configure and it fails on that test (the earlier mentioned AC_CHECK_LIB). When i look in the configure.log I find this:
    configure:3743: checking for main in -lclanApp
    configure:3772: gcc -o conftest -g -O2 conftest.c -lclanApp >&5
    /usr/local/lib/libclanApp.so: undefined reference to `CL_SetupCore::deinit()'
    /usr/local/lib/libclanApp.so: undefined reference to `CL_SetupCore::init(bool)



    Why does this happen? Have i built ClanLib wrong in someway?

    Thnx in advance for answer

  2. #2
    Peasant
    Join Date
    Sep 2007
    Posts
    7

    Thumbs up I fixed it (but now i use 0.9 instead)

    I fixed it (but now i use 0.9 instead) for my Ubuntu edgy machine.

    I did a rebuild of the ClanLib for my machine but before i did build it I added the --with-gnu-ld to the configure command like this:
    ./configure --with-gnu-ld --disable-clanSDL --disable-clanMySQL --disable-docs

    After I installed I changed my configure.ac for my project to look like this:
    AC_INIT([myapp], [0.1], [myemail@mail.com])
    AC_CONFIG_AUX_DIR([config])
    AM_INIT_AUTOMAKE
    CXXFLAGS='-Wall -g -O2'
    AC_PROG_CXX

    PKG_CHECK_MODULES(clanCore, clanCore-0.9 >= 0.9.0)
    CPPFLAGS="$CPPFLAGS $clanCore_CFLAGS"
    LIBS="$LIBS $clanCore_LIBS"

    PKG_CHECK_MODULES(clanDisplay, clanDisplay-0.9 >= 0.9.0)
    CPPFLAGS="$CPPFLAGS $clanDisplay_CFLAGS"
    LIBS="$LIBS $clanDisplay_LIBS"

    PKG_CHECK_MODULES(clanApp, clanApp-0.9 >= 0.9.0)
    CPPFLAGS="$CPPFLAGS $clanApp_CFLAGS"
    LIBS="$LIBS $clanApp_LIBS"

    PKG_CHECK_MODULES(clanGL, clanGL-0.9 >= 0.9.0)
    CPPFLAGS="$CPPFLAGS $clanGL_CFLAGS"
    LIBS="$LIBS $clanGL_LIBS"

    AC_CONFIG_FILES([
    Makefile
    ])
    AC_OUTPUT


    The important part of the configure.ac is the PKG_CHECK_MODULES stuff:
    PKG_CHECK_MODULES(clanXXXXX, clanGL-0.9 >= 0.9.0)
    CPPFLAGS="$CPPFLAGS $clanXXXXX_CFLAGS"
    LIBS="$LIBS $clanXXXXX_LIBS"


    I hope you understand the XXXXX stuff =)

  3. #3
    Peasant
    Join Date
    Sep 2007
    Posts
    7

    Thumbs up Tested the same methology for ClanLib 0.8

    Tested the same methodology for ClanLib 0.8 and it worked! The key is the --with-gnu-ld when clan lib is configured before build.

    The only thing i needed to change when I chaned to 0.8 from 0.9 was the all the version strings for the PKG_CHECK_MODULES in the configure.ac for my project from 0.9 and 0.9.0 to 0.8 and 0.8.0:
    PKG_CHECK_MODULES(clanXXXXX, clanGL-0.8 >= 0.8.0 )
    CPPFLAGS="$CPPFLAGS $clanXXXXX_CFLAGS"
    LIBS="$LIBS $clanXXXXX_LIBS"


    Happy hacking dudes

Bookmarks

Bookmarks

Posting Permissions

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