Skip to main content
gamedev.net
🔒 Locked

linking problem

Started by cody Nov 26, 2001 at 3:05 PM 10 replies 950+ views
Original Post
cody
cody
im using the lua script system for a game. it links under windows without problems. but under linux i get unresolved externals. i copied the liblua.a file to my lib directory und used gcc -llua. but that doesnt work. lua has a c-interface so i use extern "C"... to call it from my c++ game, can this be the reason for that? however i think it worked when i used kdevelop to compile. but i didnt understand it because it was too complex;-)
cody
cody
hm... i will try that!
Oluseyi
Oluseyi
quote:
Original post by Null and Void
Try ''manually'' linking the library. In other words, instead of "-llua" use "/fullpath/liblua.a" as if it were a .c/.cpp file. That often times clears up annoying problems I have with linking static libraries .

Hmm. That seems to suggest you need to edit your /etc/ld.conf file and run ldconfig again...


Start Here!
cody
cody
really strange... it doesnt work.

i have tested a small testprogram with only one call to the lua library... and this works!

in my game i include the header the same way and i cant link.

im wondering what could cause such a problem.
cody
cody
hey it seams to work! order matters! i have other undefined references now but no complains about lua anymore:-)

for example i have a undefined reference to

`ostream::operator<<(ostream &(*)(ostream &))''
(i dont think i have used it anywhere in my code...)

and some std:string functions.

which libs do i have to link for those standard libraries?
cody
cody
ehm... i dont know, i have installed suse linux 7.3 and have no extra libs.
the headers for stl are there and it all compiles just fine.

you see im a real linux newbie.
cody
cody
well, i kicked out the stl-code and now it works.

never mind, stl sucks anyway ;-)

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.