|
From: | Mark Brand |
Subject: | Re: [Mingw-cross-env-list] What's missing? |
Date: | Thu, 11 Oct 2012 09:17:46 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/20120904 Firefox/15.0.1 SeaMonkey/2.12.1 |
Enoch wrote:
Hi, I have a small program that builds well in Linux but refuses to link against sqlite3 and readline under MXE. I guess that if I turn this program into an autoconf compliant project then autoconf would figure out how to do that, but that's daunting :-) By the way, pointing environment variables LD_LIBRARY_PATH and LIBRARY_PATH to mxe's lib places did not help.
You shouldn't expect those to help.LD_LIBRARY_PATH is for finding shared libraries at run time. As far as I know, LIBRARY_PATH doesn't do anything.
Thanks, Enoch. PATH=/home/enoch/mxe/usr/bin:/home/enoch/mxe/usr/i686-pc-mingw32/bin CPATH=/home/enoch/mxe/usr/include:/home/enoch/mxe/usr/i686-pc-mingw32/include i686-pc-mingw32-gcc -Wall -Wextra -g -lreadline -lsqlite3 -o vote.exe vote.c /tmp/ccF65ASU.o: In function `Guard': /home/enoch/Words/winston_management/owners/vote.c:42: undefined reference to `sqlite3_close' /tmp/ccF65ASU.o: In function `main': /home/enoch/Words/winston_management/owners/vote.c:101: undefined reference to `sqlite3_open_v2'
Libraries defining symbols must come after objects using them. Something like this should work, which also takes care of readline's dependency on pdcurses:
i686-pc-mingw32-gcc -Wall -Wextra -g -o vote.exe vote.c -lsqlite3 -lreadline -lpdcurses Mark
[Prev in Thread] | Current Thread | [Next in Thread] |