Issue #9 resolved

Compilation fails in OSX 10.9.1

Anonymous created an issue

I get this:

gcc -g -O2 -Wall -Wextra -Wno-unused-parameter   -c -o src/capture.o src/capture.c
gcc -g -O2 -Wall -Wextra -Wno-unused-parameter   -c -o src/common.o src/common.c
gcc -g -O2 -Wall -Wextra -Wno-unused-parameter   -c -o src/cvs.o src/cvs.c
gcc -g -O2 -Wall -Wextra -Wno-unused-parameter   -c -o src/fossil.o src/fossil.c
gcc -g -O2 -Wall -Wextra -Wno-unused-parameter   -c -o src/git.o src/git.c
gcc -g -O2 -Wall -Wextra -Wno-unused-parameter   -c -o src/hg.o src/hg.c
gcc -g -O2 -Wall -Wextra -Wno-unused-parameter   -c -o src/svn.o src/svn.c
src/svn.c:80:59: warning: implicit declaration of function 'sqlite3_errstr' is
      invalid in C99 [-Wimplicit-function-declaration]
        debug("error opening database in .svn/wc.db: %s", sqlite3_errstr...
1 warning generated.
gcc -g -O2 -Wall -Wextra -Wno-unused-parameter   -c -o src/vcprompt.o src/vcprompt.c
gcc  -o vcprompt src/capture.o src/common.o src/cvs.o src/fossil.o src/git.o src/hg.o src/svn.o src/vcprompt.o -lsqlite3 
Undefined symbols for architecture x86_64:
  "_sqlite3_errstr", referenced from:
      _svn_get_info in svn.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
make: *** [vcprompt] Error 1

Comments (7)

  1. Greg Ward repo owner

    Hmmm. Looks like an unexpected version of sqlite. The configure script should catch this, but I guess it doesn't.

    Quick workaround: if you don't care about Subversion support, run "./configure --without-sqlite3" and rebuild.

    If you do care about svn support, please tell me what version of sqlite3 you have installed on your system. Also, are you using homebrew or MacPorts, or just vanilla OS X with all of Apple's builds?

  2. Ladislav Prskavec

    brew install sqlite, SQLite version 3.7.13

    checking sqlite3.h usability... yes
    checking sqlite3.h presence... yes
    checking for sqlite3.h... yes
    checking for sqlite3_open_v2 in -lsqlite3... yes
  3. Greg Ward repo owner

    Ladislav Prskavec: what were you trying to say with your comment? Was that "installing from brew fixes this for me"? or "I also have this problem"? something else? I need more info.

    Bita Djaghouri: I need more info from you if I'm to have any chance of fixing this. Please tell me 1) what version of sqlite is installed on your system and 2) where it came from.

    First, run the command:

    find /usr/include /usr/local/include /opt /sw -name 'sqlite*.h'

    and let me know what the output is. Then run the command

    find /usr/include /usr/local/include /opt /sw -name 'sqlite*.h' | xargs grep 'define SQLITE_VERSION'

    and tell me what that says.

  4. Ladislav Prskavec
    1. installation without sqlite works for me
    2. sqlite i have installed from homebrew packages
    3. part from my previous comment is from ./configure command

    This is output from your commands:

    ╰─$ find /usr/include /usr/local/include /opt /sw -name 'sqlite*.h'
    ╰─$ find /usr/include /usr/local/include /opt /sw -name 'sqlite*.h' | xargs grep 'define SQLITE_VERSION'                                                                                                    1 ↵
    find: /sw: No such file or directory
    /usr/include/php/ext/sqlite3/libsqlite/sqlite3.h:#define SQLITE_VERSION        ""
    /usr/include/php/ext/sqlite3/libsqlite/sqlite3.h:#define SQLITE_VERSION_NUMBER 3007007
    /usr/include/sqlite3.h:#define SQLITE_VERSION        "3.7.13"
    /usr/include/sqlite3.h:#define SQLITE_VERSION_NUMBER 3007013

    I hope, this help you.

  5. Greg Ward repo owner

    Ladislav Prskavec: Both of your sqlite3 packages are too old. vcprompt requires sqlite >= 3.7.15. I'm documenting this and adding a check to the configure script now. Please checkout the source and try a build:

    hg clone
    cd vcprompt

    This should 1) tell you that sqlite3_errstr() isn't there and 2) build successfully anyways, albeit without support for svn >= 1.7.

    The instructions in README.txt explain how to build with a particular version of sqlite.

  6. Log in to comment