[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: RE: Compiling/Executing problems in C
- From: Patrick Donnelly <batrick@...>
- Date: Mon, 9 Jul 2007 13:50:00 -0600
> On 7/9/07, Patrick Donnelly <email@example.com> wrote:
> > PIL says the program works with lua 5.1 with minor adjustments (all of them
> > I made). http://www.lua.org/pil/24.1.html (Read the red
> > warning)
> > I have no liblua51.a on my system. I only have liblua.a inside
> > /usr/local/lib. I also want to make it clear I never had lua5.0 on this
> > system. I just installed lua5.1.2 today!
> > When I do `gcc mytest.c /usr/local/lib/liblua.a` I get link errors (mostly
> > math functions) such as:
> > /usr/local/lib/liblua.a(lmathlib.o): In function `math_acos':
> > lmathlib.c:(.text+0x85e): undefined reference to `acos'
> > /usr/local/lib/liblua.a(loadlib.o): In function `ll_loadfunc':
> > loadlib.c:(.text+0x937): undefined reference to `dlsym'
> Ok, for these two use: -ldl -lm
That did it thanks!
How do you guys know these link options (is there a list somewhere?)? Compiling stuff in C is often the most frustrating thing I do in programming. Reading the man pages for ld or gcc most often tells me nothing. : /