I need help to setup Dev-C++ to lua

Started by
6 comments, last by Darknetster 18 years ago
I need help setting up the file. I am new at this program. I know it need this lib. #include <lualib.h> #include <lua.h> Can any one help me set up the file and the locations to run lua from Dev-C++?
Advertisement
I have never used lua, and I don't even have dev cpp, but I CAN do a mean google search :). Try this out:

http://lua-users.org/wiki/BuildingLua

C++: A Dialog | C++0x Features: Part1 (lambdas, auto, static_assert) , Part 2 (rvalue references) , Part 3 (decltype) | Write Games | Fix Your Timestep!

It not working.
I got this error.
syntax error near unexpected token `('
`gcc.exe -c ../src/lzio.c -o ../src/lzio.o -I"C:/Dev-Cpp/include" -I"../include" -DLUA_API=__declspec(dllexport) -DUSE_FASTROUND '
C:\Dev-Cpp\devcpp\Makefile.win [Build Error] [../src/lzio.o] Error 2
Quote:Original post by Darknetster
It not working.
I got this error.
syntax error near unexpected token `('
`gcc.exe -c ../src/lzio.c -o ../src/lzio.o -I"C:/Dev-Cpp/include" -I"../include" -DLUA_API=__declspec(dllexport) -DUSE_FASTROUND '
C:\Dev-Cpp\devcpp\Makefile.win [Build Error] [../src/lzio.o] Error 2


Is the error in your code? If so, what is on (and near) that line?
Quote:Original post by Darknetster
Can any one help me set up the file and the locations to run lua from Dev-C++?


If you open DevCpp and go to "Tools->Check for Updates/Packages", then choose "devpaks.org Community Devpaks" for the "Select devpak server", then hit the "Check For Updates" button in the bottom left corner, you will get a list of avaliable packages to download and install for DevCpp. Towards the top there should be an entry for "Lua" that you can select to download and install. Alternatively, you can download the .DevPak file here and double click to install it.

Once you have it installed, click File->New->Project and in the new dialog choose the Lua Tab. Click on the Lua project Icon, name your project and hit Ok. Choose where to save the project file and you will now be in the DevCpp IDE with two main files open. "Main.cpp" and "hello.lua.cpp"

You will first need to rename the "hello.lua.cpp" file to "hello.lua", or make the change in the main.cpp file. Next, you will need to remove that hello.lua file from the workspace. Now you can compile and build the project and it will work! I tried it out to be sure and had no problems with it. If you run into any more troubles, let us know. Good luck!
Sweet Thanks. Will this work for window app.? That I am trying to get it in the window.
Quote:Original post by Darknetster
Sweet Thanks. Will this work for window app.? That I am trying to get it in the window.


Yes, it should, you just have to make a Win32 GUI rather than the Console when you first create the project. Just note that the provide example will not work since it simply prints to the console [wink]
That I don't know how to do that coding in window. There alot information that I haven't known yet. I know just the baisc part.

This topic is closed to new replies.

Advertisement