lua,mingw,luarocks , Luarocks error building luafilesystem

Luarocks error building luafilesystem


Tag: lua,mingw,luarocks

I'm using Luarocks 2.2.0beta1 to install luafilesystem on windows 7 with lua 5.2 and mingw. I got this error:

>luarocks install luafilesystem
Using switching to 'build' mode
mingw32-gcc -O2 -c -o src/lfs.o -IC:/lua/include/src/lfs.c
mingw32-gcc -shared -o lfs.dll src/lfs.o C:/lua/bin/lua52.dll -lm
C:\lua\bin\lua52.dll: file not recognized: File format not recognized
collect2.exe: error: Id returned 1 exit status

Error: Build error: Failed compiling module lfs.dll

any idea how to fix this?

note: until now, I have no problem installing other module with luarocks that have no dependency with luafilesystem.


Solved, this problem arise because actually I'm not using the same MinGW compiler when building lua52.dll. I don't know which compiler I use at the first time. Thanks to @siffiejoe


Trouble connecting to ESP8266 NodeMCU Server

I have been having trouble connecting to my ESP-01 Wifi module running NodeMCU. I have set up a simple server, but whenever I try to connect to the IP Address via my browser, my browser times out. I know I am making connection to the device because I can see...

Error using range-based for loop - Eclipse CDT Luna

I am a beginner at C++ programming. I tried to write a very simple program that combines the use of templates, passing arrays as arguments to a function and a range-based for loop. This is the program that I wrote and compiled using the Eclipse Luna CDT software. #include <iostream>...

Recursive loop stopping after a short time

Lua in ComputerCraft 1.5 This seems to work but the recursive loops is breaking after 4 or 5 times running. Cannot seem to see why. Am i doing something incredibly wrong here? Full Code Snippet for the loop: x = 1 function loop() if x > 0 then getTarg() derp1()...

ROBLOX Lua Error in script: '=' expected near ''

Hello I am writing a scipt on ROBLOX and I have encountered a problem. function showVictoryMessage(playerName) local message ="Message") message.Text = playerName .." has won!" message.Parent = game.Workspace wait (2) message.Destroy() end Upon running this function, or more specifically the "message.Destroy" command, I get the error: Error in script:...

horizontal movement in game (rotated player)

In my world I have a character wich is always rotated towards the mouse. It is very logical that when the player moves forward or backward, that the character's x coordinate equals it's x coordinate minus (or plus) the cosine of its x coordinate. And the same for its y...

Lua import strings from file

I can't load my user.db into Lua. user.db contains: user1="XYZ1" user2="Xzy2" .... admin="ZXY" Some Bash and Python scripts use the same db. For Bash e.g. I used the source user.db command, but I don't have a clue for lua. Should be something similiar outside?! I tried the require function but...

Convolution Neural Network in torch. Error when training the network

I am trying to base my Convolution neural network upon the following tutorial: The issue is that my images are of different dimensions than those used in the tutorial. (3x200x200). Also I have only two classes. The following are the changes that I made : Changing the dataset to...

Write lua_requiref in lua5.1

I would like to use the function lua_requiref, but in lua5.1. Is there a way to get the effect of lua_requiref in lua 5.1?...

Write to file using Lua FFI

I am trying to use Lua FFI using LuaJIT to append some text to a file, but I am not very knowledgable of C, so I have some trouble. This is the code: local ffi = require "ffi" ffi.cdef[[ typedef int __kernel_ssize_t; typedef __kernel_ssize_t ssize_t; ssize_t write(int fildes, const void...

Torch Lua: Why is my gradient descent not optimizing the error?

I've been trying to implement a siamese neural network in Torch/Lua, as I already explained here. Now I have my first implementation, that I suppose to be good. Unfortunately, I'm facing a problem: during training back-propagation, the gradient descent does not update the error. That is, it always computes the...

Nginx disable or decode url encoding when writing to access log

I have an open resty nginx with lua code that enhance the data and then I write this data to the access log for data analysis. The data that the lua code produce includes double quotes but nginx write it to the access log as \x22. Can I disable this...

Lua error loading module 'libpng' (Torch, MacOSX)

How do I make libpng load properly in Lua? I am running Lua/Torch in iTorch Notebook in Mac OSX 10.10.3, where other basic functions in Lua work, such as plotting and calculations. brew install libpng Warning: libpng-1.6.17 already installed If I run: require 'nn'; require 'image'; itorch.image(image.lena()) error loading module...

Lua in pairs with same order as it's written

Is there any way to loop trough a table like the one below in the same order as it's written? local tbl = { ["hello"] = 1, [2] = 2, [50] = 3, ["bye"] = 4, [200] = 5 } What I mean is that when I use "in pairs"...

Call download lua script in app

I am trying to develop a game by using the c++ with lua, and I am using the quick-cocos2d-x engine to help me finish that. The problem is: I need user to download the lua scripts into their sdcard on their iphone/android devices, so that I can call the function...

storyboard.removeScene(“scene name”) is not working

I am new to corona sdk and trying to build sample in it. i want to get back to main screen automatically after some time by destroying my scene(i mean that scene destroys itself after some particular time and user get back to main screen).I know that for some this...

Redis Cluster: Find which master holds particular key/slot

I'm using Redis Cluster, and some keys have a special prefix {foo}, so redis puts them in one slot. I do this because i want to run some lua scripts against these keys (i can do this if i login to the master as a single instance). In my setup...

Multiline function tables in lua

I cannot seem to find any other online help about creating a table which contains functions which are multiline. For example, here is a snippit of code from the lua wiki. action = { [1] = function (x) print(1) end, [2] = function (x) z = 5 end, ["nop"] =...

iterating over a table passed as an argument to a function in lua

I am trying using the for _ in pairs() notation to iterate over a table within a function, but if I type anything, even gibberish like print('asdgfafs'), nested inside the for loop, it never gets printed. Code: record = {bid1,bid2,bid3} bid1 = {bidTime = 0.05,bidType = 'native'} bid2 = {bidTime...

Role of __WORDSIZE in compilation

Below are the contents of /usr/include/x86_64-linux-gnu/gnu/stubs-32.h file: #include <bits/wordsize.h> #if __WORDSIZE == 32 # include <gnu/stubs-32.h> #elif __WORDSIZE == 64 # include <gnu/stubs-64.h> #else # error "unexpected value for __WORDSIZE macro" #endif I am on 64 Bit machine, so the result of #include<stdio.h> main() { printf("Word size : %d\n",__WORDSIZE); }...

MinGW's ld cannot perform PE operations on non PE output file

I know there are some other similar questions about this out there, be it StackOverflow or not. I've researched a lot for this, and still didn't find a single solution. I'm doing an operative system as a side project. I've been doing all in Assembly, but now I wanna join...

2D Line reflection on a “mirror”

So I've been working at this on and off for a week, googling and all and I haven't found how to do this. I have a table of "rays" and a table of "lines", and I want the lines to act as mirrors and reflect a ray whenever the ray...

Supporting “recursive objects” in lua

I'm fairly new to lua and have the following problem with an assignment from a class: We currently extend lua to support objects and inheritance. The Syntax for that is Class{'MyClass', attribute1 = String, attribute2 = Number } Class{'MySubClass', MyClass, attribute3 = Number } This works perfectly fine. The real...

conditional assignment of multiple values

I've got a function that either can take two parameter, or calls another function to retreive these values(semi-defaults in that case). Let's say the first function looks like this: -- the actuall issue function: function foo( param_1, param_2 ) local bar_1, bar_2 = param_1, param_2 or getBar() -- make funny...

Luarocks can't install a library

I want to install this library: I do luarocks search lua-dbus There are 0 results. sudo luarocks install lua-dbus doesn't install anything as well. The problem is only with this library, because I can search for other libraries on luarocks, for example luarocks search socket gives plenty of matches....

Lua C++ Table Iteration

I am having a slight confusion of how lua_next really works. User defines a table: a={["a1"]=20,["a2"]=30} I want to print this table with a C++ code: inline int lua_print(lua_State* L) { wxString wxReturnStr=wxEmptyString; wxString tempString=wxEmptyString; int nargs = lua_gettop(L); for (int i=1; i <= nargs; i++) { int type =...

Lua in-place initialized table order

I want to be able to do the following: MyObject:SetSize( { 10.0, 20.0 } ) But when I iterate over this on the C-side (SetSize is a C function). The order of the parameters is random. This is the C++ side processing the table: glm::vec2 State::PopVec2() { glm::vec2 v(); lua_pushnil(...

Lua: how to check whether a process is running

I would like to start a process from Lua and monitor whether the process is still running. [EDIT] I know starting can be achieved by os:execute, but this is blocking. I would like to find a way to start a process non-blocking and monitor whether it still runs....

Can't link wxWidgets app with Code::Blocks / MinGW

I have an already working c++ + wxWidgets app built in Eclipse, with wxWidgets built using MSYS. Now i'd like to try different IDEs, like CodeLite and Code::Blocks, but when i tried them they did'nt work 'cause i was lacking a build.cfg file they wants. So i tried a "clean"...

Must compile Opencv with Mingw in order to use in QT under Winodws?

I've visit these blogs How to link opencv in QtCreator and use Qt library All of them are using Mingw to compile Opencv through Cmake. If I want to use Opencv in QT, is compiling with Mingw the only way? I have this question because I already compiled...

Error while using Boost Asio

I get "::UnregisterWaitEx is not declared" inside win_object_handle_service.ipp whenever I try to include < boost/asio.hpp > into my code. Currently I am using Code::Blocks, MinGW compiler (which didn't come bundled with IDE) on Windows 8.1. Boost is built outside of mingw include folder, though is included in project settings. Exact...

Reading a table when function has many argument return an error

I'm trying to read an array inside a Lua function in a library that I'm developing. When I call the function with one argument, like xyz = {3, 4, 5} setxyz(xyz) I read the array correctly, while if I add a second argument xyz = {3, 4, 5} setxyz(xyz, 3)...

How to use use precompiled static libraries with MinGW?

I am trying to use MinGW to compile Linux project into Windows. I have been successful doing so with Cygwin, but I would match rather prefer to use MinGW so I the program does not end up having dozens of unnecessary dependencies. Unfortunately, I have run into a problem that...

How do I do user inputs on the same line in Lua?

Here is my code: while true do opr = txt = if opr == "print" then print(txt) else print("wat") end end What I'm trying to do is make it where you type print and then whatever you want like this: print text And it'll print text but I...

lua - table.concat with string keys

I'm having a problem with lua's table.concat, and suspect it is just my ignorance, but cannot find a verbose answer to why I'm getting this behavior. > t1 = {"foo", "bar", "nod"} > t2 = {["foo"]="one", ["bar"]="two", ["nod"]="yes"} > table.concat(t1) foobarnod > table.concat(t2) The table.concat run on t2 provides no...

Compiling standalone Qt application using MinGW

I am trying to build a standalone Qt app without any DLLs needed. I recompiled Qt 5.4.1 statically. When I compile and run an application, it doesn't require any Qt DLLs, but it requires libgcc_s_dw2-1.dll instead. I have also edited my mkspecs before configuring and building Qt, I edited these...

MAMP or Mac nginx MySQL Lua

I've recently purchased a Mac Mini with the only purpose of being a server. I'm a C programmer, learning Lua and Obj-C at the moment. I'm trying to set up a website, a kind of CV/Personal Promotion site. I've been looking at MAMP for a while however, I would like...

How to iterate through a table in its exact order?

If i try to output this table, they are looped through in the false order: local letters = {DIN1="hi", AIN1= "my", AIN2 ="name", DIN2="is"} for name, value in pairs(letters) do print(name,value) end Expected Output: DIN1 hi AIN1 my AIN2 name DIN2 is Output: AIN1 my DIN2 is DIN1 hi AIN2...

Link target to libraries

I have a "CMakified" version of CryptoPP and I am using CMake-GUI to create a MakeFile which ming-make could process as shown in the image below. The "MakeFile" creation was successful but when I executed mingw32-make.exe I got below errors at the very end. Linking CXX executable cryptest.exe CMakeFiles\cryptest.dir/objects.a(test.cpp.obj):test.cpp:(.text+0x8e82): undefined...

What is the difference between MinGW SEH and MinGW SJLJ?

I am just starting to learn C and installing now QT x64 (form here: I have two options to install: MinGW 4.9.2 SEH or MinGW 4.9.2 SJLJ. Question: Which is better to install and why? I read What is difference between sjlj vs dwarf vs seh? and but...

Lua os.tempname

The file names returned by the Lua os.tempname function are weak in two respects Unlike most other languages it is not possible to define a custom prefix for the file name The _6char suffix that is generated can, with brute force but nevertheless, be guessed I have at times used...

How can I convert a character code to a string character in Lua?

How can I convert a character code to a string character in Lua? E.g. d = 48 -- this is what I want str_d = "0" ...

Lua obfuscator, how to

I understand this question will appear silly but I'm clueless what to do, which makes it even more silly. I have written a lua script for a game - which works, but I've never actually run any lua with the lua programs(from the site download). I would like to obfuscate...

Run Lua script from Python

Suppose I have a Lua script that contains 2 functions. I would like to call each of these functions with some arguments from a Python script. I have seen tutorials on how to embed Lua code in Python and vice versa using Lunatic Python, however, my Lua functions to be...

Corona sdk not view random text

I'm have a problem because when I touch my button sometimes my text doe not appear and I do not understand what is wrong. Code: function randomText(event) display.remove(mmDis) local a = {"Cristiano ronaldo jest najlepszy!", "messi jest dobry!","lewandowski jest ok","diego lopez to bramkarz realu"} com = (a[math.random(1,#a)]) local mmDis =...

Erlang spawning large amounts of C processes

I've been looking into how I could embed languages (let's use Lua as an example) in Erlang. This of course isn't a new idea and there are many libraries out there that can do this. However I was wondering if it was possible to start a Genserver with state which...

Lua - Function That Creates Detours

I need to make several detours to various functions and doing it one by one is just not an option. I'm looking for a function that will take a table, ideally, and this table is class. Loop through it and for each key, value pair that is a function make...

How I get the cdata out in c function with variable arguments using luajit?

Here is the code. The aim is to print messages. In PrintC, I would like to get e...but arrives as cdata. How can I unpack that or circumvent that? extern "C" { static int PrintC ( lua_State *L ) { // does not work cdata //executor* e = ( executor*...

Reading Lua Table from C++

I have tried many alternatives for this simple thing but could not get it work. I want user to define a table from Lua in the 1st step: a={["something"]=10} -- key=something, value=10 Then, in the second step the user will call from Lua a function designed in C++: b=afunction(a) --...

Lua search through table

I am working on a game project using Corona SDK and I am running into an issue. I am trying to use string.find() in a for loop to test to determine if a value is in a certain table and if so, add that value to another table. My problem...

Lua - Is it possible to check if 2 functions are equal?

Is it either possible to get the size of a function in bytes to see if it matches another function similar to C++ sizeof operator, or evaluate two functions some other way to see if they are both equal without actually knowing what the function/s are? Example: local function equals(func1,...