Compiling on windows

Darmir
Posts: 226
Joined: Sun May 01, 2011 6:51 pm
Contact:

Re: Compiling on windows

Post by Darmir »

I am making a big progress of getting the latest version head of the mudlet code to compile on windows. I am now down to 16 errors and they are located in the lua_yajl.c file.
They are
  1. lua_yajl1.c:224: error: 'yajl_parser_config' was not declared in this scope
  2. lua_yajl1.c:224: error: expected ';' before 'cfg
  3. lua_yajl1.c:235: error: 'cfg' was not declared in this scope
  4. lua_yajl1.c:241: error: 'cfg' was not declared in this scope
  5. lua_yajl1.c:246: error: 'cfg' was not declared in this scope
  6. lua_yajl1.c:443: error: 'yajl_status_insufficient_data' was not declared in this scope
  7. lua_yajl1.c:464: error: 'yajl_parse_complete' was not declared in this scope
  8. lua_yajl1.c:497: error: 'yajl_parser_config' was not declared in this scope
  9. lua_yajl1.c:497: error: expected ';' before 'cfg'
  10. lua_yajl1.c:503: error: 'cfg' was not declared in this scope
  11. lua_yajl1.c:509: error: 'cfg' was not declared in this scope
  12. lua_yajl1.c:515: error: 'cfg' was not declared in this scope
  13. lua_yajl1.c:853: error: expected ';' before 'cfg'
  14. lua_yajl1.c:894: error: 'cfg' was not declared in this scope
  15. lua_yajl1.c:910: error: 'cfg' was not declared in this scope
  16. lua_yajl1.c:910: error: 'yajl_gen_alloc2' was not declared in this scope
I will write up an updated guide for windows compile instructions when I get these errors fixed.

Darmir
Posts: 226
Joined: Sun May 01, 2011 6:51 pm
Contact:

Re: Compiling on windows

Post by Darmir »

Weird, The yajl_parser_config Struct doesn't exist in the yajl_parse.h that is why I am getting the error. I can't even find it in yajl git repository.
I figured it out I have the wrong version of yajl. I needed to get 1.0.12 and I had the new 2.0.1 version. :D

Now for some reason when I click the build button to run the program it doesn't show up. :( It does say that it is built and compiled.

Darmir
Posts: 226
Joined: Sun May 01, 2011 6:51 pm
Contact:

Re: Compiling on windows

Post by Darmir »

Okay. I got past the yajl library now I only get two errors, but they don't give my any real information. They are:
  1. :-1: error: cannot find -llua51
  2. :-1: error: collect2: ld returned 1 exit status

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Compiling on windows

Post by Vadi »

It means the linker couldn't find the Lua library to link to.

Darmir
Posts: 226
Joined: Sun May 01, 2011 6:51 pm
Contact:

Re: Compiling on windows

Post by Darmir »

Vadi,
Can you help me understand the makefile here.
Code: [show] | [select all] lua
LIBLUA = -llua5.1
!exists(/usr/lib/liblua5.1.a):LIBLUA = -llua

# automatically link to LuaJIT if it exists
exists(/usr/local/lib/libluajit-5.1.a):LIBLUA = -L/usr/local/lib -lluajit-5.1

unix:LIBS += -lpcre \
    $$LIBLUA \
    -lhunspell \
    -lyajl \
    -lzzip

win32:LIBS += -L"c:\mudlet2_package" \
    -llua51 \
    -lpcre \
    -lhunspell \
    -lyajl

unix:INCLUDEPATH += /usr/include/lua5.1

win32:INCLUDEPATH += "c:\mudlet_package_MINGW\Lua_src\include" \
    "c:\mudlet_package_MINGW\zlib-1.2.5" \
    "c:\mudlet_package_MINGW\boost_1_45_0" \
    "c:\mudlet_package_MINGW\pcre-8.0-lib\include" \
    #"C:\mudlet_package_MSVC\lloyd-yajl-f4b2b1a\yajl-2.0.1\include" \
    "c:\mudlet2_package\src\yajl1-src\src\include" \
    "C:\mudlet_package_MINGW\hunspell-1.3.1\src"
I have created a directory under C: called mudlet2_package and then created the library structure for instance: C:\mudlet2_packet\zlib-1.2.5. Is that correct? I am getting confused with the INCLUDEPATH structure and the LIBS structure. Is _MINGW part of the directory name or is it a variable in the makefile?

User avatar
Vadi
Posts: 5042
Joined: Sat Mar 14, 2009 3:13 pm

Re: Compiling on windows

Post by Vadi »

It's part of the directory name

Darmir
Posts: 226
Joined: Sun May 01, 2011 6:51 pm
Contact:

Re: Compiling on windows

Post by Darmir »

Heiko,
Can you also clean up the make file for Windows compiles. I would suggest making the include library structures NOT version specific and move them away from putting the "mudlet_package_MINGW" directory from under the C: drive, not a very good place to put it.
For instance change:
Code: [show] | [select all] lua
"c:\mudlet_package_MINGW\zlib-1.2.5" \
to
Code: [show] | [select all] lua
"c:\mudlet_package_MINGW\zlib" \
Not sure if you can change from the root directory system. Would be too hard to have the same for every user I guess.
Last edited by Darmir on Tue Sep 20, 2011 10:43 pm, edited 1 time in total.

Lucky24
Posts: 52
Joined: Sun Sep 12, 2010 1:50 am

Re: Compiling on windows

Post by Lucky24 »

Did you ever get the latest snapshot to compile in windows? I'd love to see some updated instructions...

Post Reply