C++ (Qt)#include <QtGui>#include "QwtBeginner.h"#include <QMenu.h>#include "lua.h"#include "luaconf.h"#include "lualib.h"#include "lauxlib.h"int main(int argc, char *argv[]){ QApplication app(argc, argv); QwtBeginner *wnd = new QwtBeginner; int k=10; lua_State *L=lua_open(); luaL_openlibs(L); luaL_dofile(L,"function.lua"); lua_getglobal(L,"myfunc"); lua_pushnumber(L,k); lua_call(L,1,1); double res=lua_tonumber(L,-1); lua_close(L); QMenuBar pmen(wnd); QMenu menu("&Application"); menu.addAction("&close",&app,SLOT(quit())); pmen.addMenu(&menu); pmen.setVisible(true); wnd->show(); return app.exec(); }
release/main.o:main.cpp:(.text+0x4a): undefined reference to `luaL_newstate()'release/main.o:main.cpp:(.text+0x54): undefined reference to `luaL_openlibs(lua_State*)'release/main.o:main.cpp:(.text+0x64): undefined reference to `luaL_loadfile(lua_State*, char const*)'release/main.o:main.cpp:(.text+0x88): undefined reference to `lua_pcall(lua_State*, int, int, int)'release/main.o:main.cpp:(.text+0xa0): undefined reference to `lua_getfield(lua_State*, int, char const*)'release/main.o:main.cpp:(.text+0xb8): undefined reference to `lua_pushnumber(lua_State*, double)'release/main.o:main.cpp:(.text+0xd0): undefined reference to `lua_call(lua_State*, int, int)'release/main.o:main.cpp:(.text+0xe0): undefined reference to `lua_tonumber(lua_State*, int)'release/main.o:main.cpp:(.text+0xea): undefined reference to `lua_close(lua_State*)'collect2: ld returned 1 exit statusmingw32-make[1]: *** [release\untitled.exe] Error 1mingw32-make: *** [release] Error 2