Jump to content

[C++]Compiling a library with GCC


Recommended Posts

  • Bot

Good Day!
I'm trying to build a simple "hello_world" like functions, for LUA's quests.

That's the error:
Compiling questlua_global.cpp

I'm using the TheGame BSD and i've followed this guide Denic Cikiec

 

I'm using this command:

gcc -shared -o -libprova.so -fPIC -questlua_global.cpp

Thx!

Edited by Metin2 Dev
Core X - External 2 Internal
  • Metin2 Dev 2
  • Confused 1
  • Love 1

english_banner.gif

Link to comment
Share on other sites

  • Bot

Thx

 

Now i've got this error: std::string
I think that i need to work a little bit on paths, because some headers includes other headers but with a wrong path.

Like lua_incl.h that uses #include <lua.h> changed to #include "lua.h" and now it works

 

---UPDATE!---

replacing GCC with G++ it works (90% works), now it says:

undefined reference QUEST

/usr/lib/crt1.o: In function `_start1':
crt1_c.c:(.text+0xa6): undefined reference to `main'
/tmp//ccxMzbuE.o: In function `quest::RegisterGlobalFunctionTable(lua_State*)':
prova.cpp:(.text+0x1bd): undefined reference to `lua_pushstring(lua_State*, char const*)'
prova.cpp:(.text+0x1db): undefined reference to `lua_pushcclosure(lua_State*, int (*)(lua_State*), int)'
prova.cpp:(.text+0x1ee): undefined reference to `lua_settable(lua_State*, int)'
/tmp//ccxMzbuE.o: In function `quest::_ciao_mondo(lua_State*)':
prova.cpp:(.text+0x2c1): undefined reference to `quest::combine_lua_string(lua_State*, std::basic_ostringstream<char, std::char_traits<char>, std::allocator<char> >&)'
prova.cpp:(.text+0x30c): undefined reference to `quest::CQuestManager::AddScript(std::string const&)'
root@develop:/LIB_LUA #
Edited by Metin2 Dev
Core X - External 2 Internal
  • Good 1

english_banner.gif

Link to comment
Share on other sites

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now

Announcements



×
×
  • Create New...

Important Information

Terms of Use / Privacy Policy / Guidelines / We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.