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

## Recommended Posts

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++?

##### Share on other sites
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

##### Share on other sites
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

##### Share on other sites
Quote:
 Original post by DarknetsterIt 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?

##### Share on other sites
Quote:
 Original post by DarknetsterCan 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!

##### Share on other sites
Sweet Thanks. Will this work for window app.? That I am trying to get it in the window.

##### Share on other sites
Quote:
 Original post by DarknetsterSweet 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]

##### Share on other sites
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.