Sign in to follow this  
Sevay86

Dev-C++ Makefile error

Recommended Posts

I'm trying the lua scripting template in dev-c++, and I get this error: C:\Dev-Cpp\Makefile.win [Build Error] [Project1.exe] Error 1 Here's the code: #include <iostream> extern "C" { #include "lua.h" #include "lualib.h" #include "lauxlib.h" } void report_errors(lua_State *L, int status) { if ( status!=0 ) { std::cerr << "-- " << lua_tostring(L, -1) << std::endl; lua_pop(L, 1); // remove error message } } int main(int argc, char** argv) { char * file = "hello.lua"; // file to load //REMEMBER!!!! "hello.lua" cant be compiled!!!! lua_State *L = lua_open(); luaopen_io(L); // provides io.* luaopen_base(L); luaopen_table(L); luaopen_string(L); luaopen_math(L); luaopen_loadlib(L); std::cerr << "-- Loading file: " << file << std::endl; int s = luaL_loadfile(L, file); if ( s==0 ) { // execute Lua program s = lua_pcall(L, 0, LUA_MULTRET, 0); } report_errors(L, s); lua_close(L); system("pause"); //pause to show the result... std::cerr << std::endl; return 0; } Here's the linkers: -lLua -lLualib -lmingw32 -lSDL -lSDLmain -mwindows lib/liblua.a lib/liblualib.a Thanks!

Share this post


Link to post
Share on other sites
If it's a build error, it should tell you what line it's broken on.

But it might be that you don't have the lib directory of your lua libs in your ide settings (unless you copied the lua stuff into dev-cpp's 'lib' directory or something...)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this