Neopallium/lua-zmq

Failed to build in mingw

andrewstarks opened this issue · 14 comments

Hey all,

I'm attempting an install on Windows 7 and I followed your instructions for XP. After much, much trial and error, I'm to the point now where I can run:

cmake -G "MSYS Makefiles" -D ZMQ_PATH=c:/zeromq ..

It runs without error. I run "make" and get the following output:

$ make
"/c/Program Files (x86)/CMake 2.8/bin/cmake.exe" -H/C/src/lua-zmq -B/C/src/lua-z
mq/build --check-build-system CMakeFiles/Makefile.cmake 0
"/c/Program Files (x86)/CMake 2.8/bin/cmake.exe" -E cmake_progress_start /C/src/
lua-zmq/build/CMakeFiles /C/src/lua-zmq/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory /c/src/lua-zmq/build' make -f CMakeFiles/lua-zmq.dir/build.make CMakeFiles/lua-zmq.dir/depend make[2]: Entering directory/c/src/lua-zmq/build'
"/c/Program Files (x86)/CMake 2.8/bin/cmake.exe" -E cmake_depends "MSYS Makefiles" /C/src/lua-zmq /C/src/lua-zmq/C/src/lua-zmq/build /C/src/lua-zmq/build /C/src/lua-zmq/build/CMakeFiles/lua-zmq.dir/DependInfo.cmake --color=make[2]: Leaving directory /c/src/lua-zmq/build' make -f CMakeFiles/lua-zmq.dir/build.make CMakeFiles/lua-zmq.dir/build make[2]: Entering directory/c/src/lua-zmq/build'
"/c/Program Files (x86)/CMake 2.8/bin/cmake.exe" -E cmake_progress_report /C/src
/lua-zmq/build/CMakeFiles 1
[100%] Building C object CMakeFiles/lua-zmq.dir/src/pre_generated-zmq.nobj.c.obj

/C/MinGW/bin/gcc.exe -Dlua_zmq_EXPORTS @CMakeFiles/lua-zmq.dir/includes_C.rsp -Ic:/zeromq/include -o CMakeFiles/lua-zmq.dir/src/pre_generated-zmq.nobj.c.obj -c /C/src/lua-zmq/src/pre_generated-zmq.nobj.c
c:/src/lua-zmq/src/pre_generated-zmq.nobj.c:194:2: error: unknown type name 'bool'
c:/src/lua-zmq/src/pre_generated-zmq.nobj.c:797:3: error: unknown type name 'bool'
c:/src/lua-zmq/src/pre_generated-zmq.nobj.c:6598:134: error: 'false' undeclared
here (not in a function)
make[2]: *** [CMakeFiles/lua-zmq.dir/src/pre_generated-zmq.nobj.c.obj] Error 1
make[2]: Leaving directory /c/src/lua-zmq/build' make[1]: *** [CMakeFiles/lua-zmq.dir/all] Error 2 make[1]: Leaving directory/c/src/lua-zmq/build'
make: *** [all] Error 2

...which is less than sweet. :)

I've tried it all in the default directory and in /usr/local/ and it makes no difference. If this helps, I ran it in interactive mode and copied the settings:

Andrew Starks@WIN-E28PFBCKACQ /c/src/lua-zmq/build
$ cmake -i -G "MSYS Makefiles" -D ZMQ_PATH=c:/zeromq ..
Would you like to see advanced options? [No]:y
Please wait while cmake processes CMakeLists.txt files....

Variable Name: CMAKE_AR
Description: Path to a program.
Current Value: C:/MinGW/bin/ar.exe
New Value (Enter to keep current value):

Variable Name: CMAKE_BUILD_TYPE
Description: Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAK
E_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_COLOR_MAKEFILE
Description: Enable/Disable color output during build.
Current Value: ON
New Value (Enter to keep current value):

Variable Name: CMAKE_C_COMPILER
Description: C compiler.
Current Value: C:/MinGW/bin/gcc.exe
New Value (Enter to keep current value):

Variable Name: CMAKE_C_FLAGS
Description: Flags used by the compiler during all build types.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_C_FLAGS_DEBUG
Description: Flags used by the compiler during debug builds.
Current Value: -g
New Value (Enter to keep current value):

Variable Name: CMAKE_C_FLAGS_MINSIZEREL
Description: Flags used by the compiler during release minsize builds.
Current Value: -Os -DNDEBUG
New Value (Enter to keep current value):

Variable Name: CMAKE_C_FLAGS_RELEASE
Description: Flags used by the compiler during release builds (/MD /Ob1 /Oi /Ot
/Oy /Gs will produce slightly less optimized but smaller files).
Current Value: -O3 -DNDEBUG
New Value (Enter to keep current value):

Variable Name: CMAKE_C_FLAGS_RELWITHDEBINFO
Description: Flags used by the compiler during Release with Debug Info builds.
Current Value: -O2 -g
New Value (Enter to keep current value):

Variable Name: CMAKE_C_STANDARD_LIBRARIES
Description: Libraries linked by defalut with all C applications.
Current Value: -lkernel32 -luser32 -lgdi32 -lwinspool -lshell32 -lole32 -loleaut
32 -luuid -lcomdlg32 -ladvapi32
New Value (Enter to keep current value):

Variable Name: CMAKE_EXE_LINKER_FLAGS
Description: Flags used by the linker.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_EXE_LINKER_FLAGS_DEBUG
Description: Flags used by the linker during debug builds.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_EXE_LINKER_FLAGS_MINSIZEREL
Description: Flags used by the linker during release minsize builds.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_EXE_LINKER_FLAGS_RELEASE
Description: Flags used by the linker during release builds.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_EXE_LINKER_FLAGS_RELWITHDEBINFO
Description: Flags used by the linker during Release with Debug Info builds.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_GNUtoMS
Description: Convert GNU import libraries to MS format (requires Visual Studio)
Current Value: OFF
New Value (Enter to keep current value):

Variable Name: CMAKE_INSTALL_PREFIX
Description: Install path prefix, prepended onto install directories.
Current Value: /usr/local
New Value (Enter to keep current value):

Variable Name: CMAKE_LINKER
Description: Path to a program.
Current Value: C:/MinGW/bin/ld.exe
New Value (Enter to keep current value):

Variable Name: CMAKE_MAKE_PROGRAM
Description: Path to a program.
Current Value: C:/MinGW/msys/1.0/bin/make.exe
New Value (Enter to keep current value):

Variable Name: CMAKE_MODULE_LINKER_FLAGS
Description: Flags used by the linker during the creation of modules.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_MODULE_LINKER_FLAGS_DEBUG
Description: Flags used by the linker during debug builds.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_MODULE_LINKER_FLAGS_MINSIZEREL
Description: Flags used by the linker during release minsize builds.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_MODULE_LINKER_FLAGS_RELEASE
Description: Flags used by the linker during release builds.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_MODULE_LINKER_FLAGS_RELWITHDEBINFO
Description: Flags used by the linker during Release with Debug Info builds.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_NM
Description: Path to a program.
Current Value: C:/MinGW/bin/nm.exe
New Value (Enter to keep current value):

Variable Name: CMAKE_OBJCOPY
Description: Path to a program.
Current Value: C:/MinGW/bin/objcopy.exe
New Value (Enter to keep current value):

Variable Name: CMAKE_OBJDUMP
Description: Path to a program.
Current Value: C:/MinGW/bin/objdump.exe
New Value (Enter to keep current value):

Variable Name: CMAKE_RANLIB
Description: Path to a program.
Current Value: C:/MinGW/bin/ranlib.exe
New Value (Enter to keep current value):

Variable Name: CMAKE_RC_COMPILER
Description: RC compiler.
Current Value: C:/MinGW/bin/windres.exe
New Value (Enter to keep current value):

Variable Name: CMAKE_RC_FLAGS
Description: Flags for Fortran compiler.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_SHARED_LINKER_FLAGS
Description: Flags used by the linker during the creation of dll's.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_SHARED_LINKER_FLAGS_DEBUG
Description: Flags used by the linker during debug builds.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_SHARED_LINKER_FLAGS_MINSIZEREL
Description: Flags used by the linker during release minsize builds.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_SHARED_LINKER_FLAGS_RELEASE
Description: Flags used by the linker during release builds.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_SHARED_LINKER_FLAGS_RELWITHDEBINFO
Description: Flags used by the linker during Release with Debug Info builds.
Current Value:
New Value (Enter to keep current value):

Variable Name: CMAKE_SKIP_RPATH
Description: If set, runtime paths are not added when using shared libraries.
Current Value: NO
New Value (Enter to keep current value):

Variable Name: CMAKE_STRIP
Description: Path to a program.
Current Value: C:/MinGW/bin/strip.exe
New Value (Enter to keep current value):

Variable Name: CMAKE_USE_RELATIVE_PATHS
Description: If true, cmake will use relative paths in makefiles and projects.
Current Value: OFF
New Value (Enter to keep current value):

Variable Name: CMAKE_VERBOSE_MAKEFILE
Description: If this value is on, makefiles will be generated without the .SILEN
T directive, and all commands will be echoed to the console during the make. Th
is is useful for debugging only. With Visual Studio IDE projects all commands ar
e done without /nologo.
Current Value: FALSE
New Value (Enter to keep current value): TRUE

Variable Name: INSTALL_CMOD
Description: Directory to install Lua binary modules (configure lua via LUA_CPAT
H)
Current Value: /usr/local/lib/lua/5.1
New Value (Enter to keep current value):

Variable Name: INSTALL_LMOD
Description: Directory to install Lua source modules (configure lua via LUA_PATH
)
Current Value: /usr/local/share/lua/5.1
New Value (Enter to keep current value):

Variable Name: LUA_INCLUDE_DIR
Description: Path to a file.
Current Value: C:/MinGW/msys/1.0/local/bin
New Value (Enter to keep current value):

Variable Name: LUA_LIBRARIES
Description: Lua Libraries
Current Value: C:/MinGW/msys/1.0/local/bin/lua51.dll
New Value (Enter to keep current value):

Variable Name: LUA_LIBRARY
Description: Path to a library.
Current Value: C:/MinGW/msys/1.0/local/bin/lua51.dll
New Value (Enter to keep current value):

Variable Name: LUA_NATIVE_OBJECTS_PATH
Description: Directory to LuaNativeObjects bindings generator.
Current Value: LuaNativeObjects
New Value (Enter to keep current value):

Variable Name: USE_PRE_GENERATED_BINDINGS
Description: Set this to FALSE to re-generate bindings using LuaNativeObjects
Current Value: TRUE
New Value (Enter to keep current value):

Variable Name: ZMQ_PATH
Description: Directory to libzmq. (by default use pkg-config to detect path)
Current Value: c:/zeromq
New Value (Enter to keep current value):

Please wait while cmake processes CMakeLists.txt files....

CMake complete, run make to build project.

Andrew Starks@WIN-E28PFBCKACQ /c/src/lua-zmq/build
$ ls
CMakeCache.txt CMakeFiles Makefile cmake_install.cmake

Andrew Starks@WIN-E28PFBCKACQ /c/src/lua-zmq/build
$ make

Any other info that I can provide, I'd be happy to do so.

FYI:

The instructions break is lua is not installed. Perhaps that is an assumed condition because LuaJIT without Lua is somehow incomplete? Either way, for completeness, it would be nice if the instructions assumed a bare bones install, provided that it currently starts with the installation of LuaJIT.

Thank you so much!

The latest code should compile now without the errors about a missing 'bool' type.

lua-zmq needs the .h header files that define Lua's public C API. LuaJIT should include a copy of these files, they are the same for both Lua & LuaJIT. LuaJIT puts it's copy of the files in /usr/include/luajit-2.0/. The CMake build script for lua-zmq corrently only looks for those headers as they would be installed with the standard Lua VM. For now just copy the .h files from /usr/include/luajit-2.0 to /usr/include/.

Thank you so much for your reply. I did as you said and copied all of the .h (and .hpp and then for fun, the Lua51.dll) into the usr/include directory from the /usr/local/include and /usr/local/bin directory. (at this point, I plan to go back when this is hashed out and delete everything that is not needed and report my findings).

Unfortunately, no joy. I believe that I'm getting the same error. Forgive me for posting all of the error codes, if it wasn't necessary:

Andrew Starks@WIN-E28PFBCKACQ /c/src/lua-zmq/build
$ make clean
make -f CMakeFiles/Makefile2 clean
make[1]: Entering directory /c/src/lua-zmq/build' make -f CMakeFiles/lua-zmq.dir/build.make CMakeFiles/lua-zmq.dir/clean make[2]: Entering directory/c/src/lua-zmq/build'
"/c/Program Files (x86)/CMake 2.8/bin/cmake.exe" -P CMakeFiles/lua-zmq.dir/cmake_clean.cmake
make[2]: Leaving directory /c/src/lua-zmq/build' make[1]: Leaving directory/c/src/lua-zmq/build'

Andrew Starks@WIN-E28PFBCKACQ /c/src/lua-zmq/build
$ cmake -G "MSYS Makefiles" -D ZMQ_PATH=c:/zeromq ..
-- Configuring done
-- Generating done
-- Build files have been written to: C:/src/lua-zmq/build

Andrew Starks@WIN-E28PFBCKACQ /c/src/lua-zmq/build
$ make
"/c/Program Files (x86)/CMake 2.8/bin/cmake.exe" -H/C/src/lua-zmq -B/C/src/lua-zmq/build --check-build-system CMakeFiles/Makefile.cmake 0
"/c/Program Files (x86)/CMake 2.8/bin/cmake.exe" -E cmake_progress_start /C/src/lua-zmq/build/CMakeFiles /C/src/lua-zmq/build/CMakeFiles/progress.marks
make -f CMakeFiles/Makefile2 all
make[1]: Entering directory /c/src/lua-zmq/build' make -f CMakeFiles/lua-zmq.dir/build.make CMakeFiles/lua-zmq.dir/depend make[2]: Entering directory/c/src/lua-zmq/build'
"/c/Program Files (x86)/CMake 2.8/bin/cmake.exe" -E cmake_depends "MSYS Makefiles" /C/src/lua-zmq /C/src/lua-zmq /C/src/lua-zmq/build /C/src/lua-zmq/build /C/sr
c/lua-zmq/build/CMakeFiles/lua-zmq.dir/DependInfo.cmake --color=
make[2]: Leaving directory /c/src/lua-zmq/build' make -f CMakeFiles/lua-zmq.dir/build.make CMakeFiles/lua-zmq.dir/build make[2]: Entering directory/c/src/lua-zmq/build'
"/c/Program Files (x86)/CMake 2.8/bin/cmake.exe" -E cmake_progress_report /C/src/lua-zmq/build/CMakeFiles 1
[100%] Building C object CMakeFiles/lua-zmq.dir/src/pre_generated-zmq.nobj.c.obj
/C/MinGW/bin/gcc.exe -Dlua_zmq_EXPORTS @CMakeFiles/lua-zmq.dir/includes_C.rsp -Ic:/zeromq/include -o CMakeFiles/lua-zmq.dir/src/pre_generated-zmq.nobj.c.o
bj -c /C/src/lua-zmq/src/pre_generated-zmq.nobj.c
c:/src/lua-zmq/src/pre_generated-zmq.nobj.c:194:2: error: unknown type name 'bool'
c:/src/lua-zmq/src/pre_generated-zmq.nobj.c:797:3: error: unknown type name 'bool'
c:/src/lua-zmq/src/pre_generated-zmq.nobj.c:6598:134: error: 'false' undeclared here (not in a function)
make[2]: *** [CMakeFiles/lua-zmq.dir/src/pre_generated-zmq.nobj.c.obj] Error 1
make[2]: Leaving directory /c/src/lua-zmq/build' make[1]: *** [CMakeFiles/lua-zmq.dir/all] Error 2 make[1]: Leaving directory/c/src/lua-zmq/build'
make: *** [all] Error 2


Is there something else that I can post that would be more helpful? I greatly appreciate your assistance.

Also, I believe that these are my environment variables, if this helps (I'm somewhat of a newbie, my main environment is a Mac and mingw/Windows/bash is not something I use daily):

LUA_DEV="/usr/local/lib/lua/5.1"
LUA_INCLUDE_DIR="/usr/local/include"
LUA_PATH="/usr/local/bin"

Also, do you suspect that there could be a 64bit/32bit issue going on? Perhaps I compiled one thing 64bit and another 32bit? I don't want to go digging there if that doesn't sound plausible...

Sorry I forgot to push the changes to the public repository. Please try again.

See this commit for the changes made f50970f.

Closer, I think. It appears to have gotten further. I wish that I could help more than just pointing out that the build fails. :) Here is the error that i received:

Andrew Starks@WIN-E28PFBCKACQ /c/src/lua-zmq
$ mkdir build

Andrew Starks@WIN-E28PFBCKACQ /c/src/lua-zmq
$ cd build

Andrew Starks@WIN-E28PFBCKACQ /c/src/lua-zmq/build
$ cmake -G "MSYS Makefiles" -D ZMQ_PATH=c:/zeromq ..
-- The C compiler identification is GNU
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found Lua51: C:/MinGW/msys/1.0/local/bin/lua51.dll
-- Configuring done
-- Generating done
-- Build files have been written to: C:/src/lua-zmq/build

Andrew Starks@WIN-E28PFBCKACQ /c/src/lua-zmq/build
$ make
Scanning dependencies of target lua-zmq
[100%] Building C object CMakeFiles/lua-zmq.dir/src/pre_generated-zmq.nobj.c.obj
c:/src/lua-zmq/src/pre_generated-zmq.nobj.c:6604:49: error: 'false' undeclared here (not in a function)
c:/src/lua-zmq/src/pre_generated-zmq.nobj.c: In function 'luaopen_zmq':
c:/src/lua-zmq/src/pre_generated-zmq.nobj.c:6671:2: warning: passing argument 4 of 'obj_type_register_constants' makes integer from pointer without a cast [enab
led by default]
c:/src/lua-zmq/src/pre_generated-zmq.nobj.c:796:13: note: expected 'int' but argument is of type 'const struct reg_sub_module '
make[2]: *
* [CMakeFiles/lua-zmq.dir/src/pre_generated-zmq.nobj.c.obj] Error 1
make[1]: *** [CMakeFiles/lua-zmq.dir/all] Error 2
make: *** [all] Error 2

Again, I cannot thank you enough for looking at this.

Oops, I missed two usages of 'false' in the C code. Pushed fix.

Okay, so that got me to the linker, but we're not home free, yet. :) It appears that lua.h is not being found by something, so I may not have everything in the correct, magical locations. Or, there is a compiler flag missing, or...or...

Anyway, here is the output from "make":

CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x47): undefined reference to lua_pushstring' CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x5a): undefined reference tolua_rawget'
CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x6d): undefined reference to lua_type' CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x84): undefined reference tolua_toboolean'
CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x9a): undefined reference to lua_settop' CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0xb5): undefined reference tolua_settop'
CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0xd8): undefined reference to luaL_loadbuffer' CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x104): undefined reference tolua_pcall'
CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x127): undefined reference to lua_isstring' CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x146): undefined reference tolua_tolstring'
CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x16f): undefined reference to lua_settop' CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x189): undefined reference tolua_toboolean'
CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x19f): undefined reference to lua_settop' CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x1b2): undefined reference tolua_pushstring'
CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x1c4): undefined reference to lua_pushboolean' CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x1d7): undefined reference tolua_rawset'
CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x209): undefined reference to lua_pushstring' CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x21e): undefined reference tolua_pushlightuserdata'
CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x230): undefined reference to lua_settable' CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x276): undefined reference toluaL_loadbuffer'
CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x292): undefined reference to lua_pushvalue' CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x2a4): undefined reference tolua_pushvalue'
CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x2b6): undefined reference to lua_remove' CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x2c9): undefined reference tolua_pushvalue'
CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x2ec): undefined reference to lua_pcall' CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x30f): undefined reference tolua_isstring'
CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x32e): undefined reference to lua_tolstring' CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x357): undefined reference tolua_settop'
CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x378): undefined reference to lua_touserdata' CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x39b): undefined reference toluaL_typerror'
CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x3ad): undefined reference to lua_objlen' CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x3d8): undefined reference toluaL_error'
CMakeFiles/lua-zmq.dir/objects.a(pre_generated-zmq.nobj.c.obj):pre_generated-zmq.nobj.c:(.text+0x3f5): undefined reference to `lua_pushlightuserdata'

this goes on and on for hundreds of lines...

Hopefully I'm not being too much of a pain. :)

The problem is not with the header files since they are only used during the compile step and not during the linking step. The problem is that the lua-zmq module needs to be linked against the lua51.dll on windows. On most posix systems Lua C modules shouldn't be linked with the Lua shared library (lua.so).

I just got Windows 7 up and running under vmware so I can work on finding a fix for this.

ok, I got it to build, but I had to dissable the FFI-bindings to make it work. For the windows plantform I had disabled FFI support for now, until I can find a solution to make it work.

You might have to set these CMake variables for it to compile:
LUA_INCLUDE_DIR="C:/luajit2/include/luajit-2.0/"
LUA_LIBRARY="C:/luajit2/bin/lua51.dll"

and these to so "make install" will work:
INSTALL_CMOD="C:/luajit2/bin/"
INSTALL_CMOD="C:/luajit2/bin/lua/"

I will also email you a zip of LuaJIT2,zeromq,lua-zmq,lua-llthreads that I compiled.

I never said thank you.... "Thank you!" I really appreciate your work on this!

There is now a build of Luajit 2.0.0-beta10(1a3e5e15) + lua-zmq 2.2.0 + lua-llthreads for Windows to download here:
https://github.com/Neopallium/lua-zmq/downloads

The build process with MingW is very ackward and error prone, I tried to go through it after recognizing that there is no description how to do it with the MS compilers.
Can't you please provide a Makefile for the MS compilers. e.g VisualStudio2010 ? It would make much easier
(e.g. as LuaJIT itself provides a build for MSVC)

Thanks for your support!