Can't compile on Debian wheezy with libyajl2

Post Reply
User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Can't compile on Debian wheezy with libyajl2

Post by Rakon »

Trying to compile the most recent (as of the time of this post) snapshot from Mudlet's git branch.

I've compiled Mudlet before and have all the necessary libraries that I am aware of. The only items that have changed since my last attempt at compilation is the libyajl1 to libyajl2 in Wheezy. I cannot downgrade to libyajl1 because apparently, the package no longer 'exists' in the branch, and the Sid package is not available for x64 or x32. Strangeness all around, unless I'm doing something utterly wrong...

Following is the line that the compile gets hung up on, which leads me to believe the source of the issues is the libyajl change.

libyajl ver - libyajl-dev_2.0.4-2_amd64 and libyajl2_amd64

Code: Select all


g++ -c -m64 -pipe -g -O3 -Wno-deprecated -Wno-unused-parameter -D_REENTRANT -Wall -W -DQT_WEBKIT -DQT_PHONON_LIB -DQT_XML_LIB -DQT_OPENGL_LIB -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++-64 -I. -I/usr/include/qt4/QtUiTools -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtNetwork -I/usr/include/qt4/QtGui -I/usr/include/qt4/QtOpenGL -I/usr/include/qt4/QtXml -I/usr/include/phonon -I/usr/include/qt4 -I. -I/usr/include/lua5.1 -Iirc/include -I/usr/include/qt4/phonon_compat -I/usr/X11R6/include -Itmp -I. -o tmp/TLuaInterpreter.o TLuaInterpreter.cpp
In file included from TTrigger.h:37:0,
                 from TLuaInterpreter.cpp:30:
Host.h:53:23: warning: extra tokens at end of #include directive [enabled by default]
In file included from Host.h:37:0,
                 from TTrigger.h:37,
                 from TLuaInterpreter.cpp:30:
TimerUnit.h: In constructor ‘TimerUnit::TimerUnit(Host*)’:
TimerUnit.h:81:27: warning: ‘TimerUnit::mMaxID’ will be initialized after [-Wreorder]
TimerUnit.h:65:27: warning:   ‘int TimerUnit::statsActiveTriggers’ [-Wreorder]
TimerUnit.h:41:27: warning:   when initialized here [-Wreorder]
In file included from TLuaInterpreter.cpp:44:0:
lua_yajl1.c: In function ‘int js_to_string(lua_State*)’:
lua_yajl1.c:79:38: error: cannot convert ‘unsigned int*’ to ‘size_t* {aka long unsigned int*}’ for argument ‘3’ to ‘yajl_gen_status yajl_gen_get_buf(yajl_gen, const unsigned char**, size_t*)’
lua_yajl1.c: At global scope:
lua_yajl1.c:220:1: error: invalid conversion from ‘int (*)(void*, const char*, unsigned int)’ to ‘int (*)(void*, const char*, size_t) {aka int (*)(void*, const char*, long unsigned int)}’ [-fpermissive]
lua_yajl1.c:220:1: error: invalid conversion from ‘int (*)(void*, const unsigned char*, unsigned int)’ to ‘int (*)(void*, const unsigned char*, size_t) {aka int (*)(void*, const unsigned char*, long unsigned int)}’ [-fpermissive]
lua_yajl1.c:220:1: error: invalid conversion from ‘int (*)(void*, const unsigned char*, unsigned int)’ to ‘int (*)(void*, const unsigned char*, size_t) {aka int (*)(void*, const unsigned char*, long unsigned int)}’ [-fpermissive]
lua_yajl1.c: In function ‘int js_to_value(lua_State*)’:
lua_yajl1.c:224:5: error: ‘yajl_parser_config’ was not declared in this scope
lua_yajl1.c:224:26: error: expected ‘;’ before ‘cfg’
lua_yajl1.c:235:13: error: ‘cfg’ was not declared in this scope
lua_yajl1.c:241:13: error: ‘cfg’ was not declared in this scope
lua_yajl1.c:246:50: error: ‘cfg’ was not declared in this scope
lua_yajl1.c: At global scope:
lua_yajl1.c:421:1: error: invalid conversion from ‘int (*)(void*, const char*, unsigned int)’ to ‘int (*)(void*, const char*, size_t) {aka int (*)(void*, const char*, long unsigned int)}’ [-fpermissive]
lua_yajl1.c:421:1: error: invalid conversion from ‘int (*)(void*, const unsigned char*, unsigned int)’ to ‘int (*)(void*, const unsigned char*, size_t) {aka int (*)(void*, const unsigned char*, long unsigned int)}’ [-fpermissive]
lua_yajl1.c:421:1: error: invalid conversion from ‘int (*)(void*, const unsigned char*, unsigned int)’ to ‘int (*)(void*, const unsigned char*, size_t) {aka int (*)(void*, const unsigned char*, long unsigned int)}’ [-fpermissive]
In file included from TLuaInterpreter.cpp:44:0:
lua_yajl1.c: In function ‘void js_parser_assert(lua_State*, yajl_status, yajl_handle_t**, const unsigned char*, unsigned int, int, const char*, int)’:
lua_yajl1.c:443:10: error: ‘yajl_status_insufficient_data’ was not declared in this scope
lua_yajl1.c: In function ‘int js_parser_parse(lua_State*)’:
lua_yajl1.c:464:53: error: ‘yajl_parse_complete’ was not declared in this scope
lua_yajl1.c: In function ‘int js_parser(lua_State*)’:
lua_yajl1.c:497:5: error: ‘yajl_parser_config’ was not declared in this scope
lua_yajl1.c:497:24: error: expected ‘;’ before ‘cfg’
lua_yajl1.c:503:9: error: ‘cfg’ was not declared in this scope
lua_yajl1.c:509:9: error: ‘cfg’ was not declared in this scope
lua_yajl1.c:515:49: error: ‘cfg’ was not declared in this scope
lua_yajl1.c: In function ‘int js_generator(lua_State*)’:
lua_yajl1.c:853:21: error: expected ‘;’ before ‘cfg’
lua_yajl1.c:853:38: warning: statement is a reference, not call, to function ‘yajl_gen_config’ [-Waddress]
lua_yajl1.c:853:38: warning: statement has no effect [-Wunused-value]
lua_yajl1.c:885:18: error: invalid conversion from ‘void (*)(void*, const char*, unsigned int)’ to ‘yajl_print_t {aka void (*)(void*, const char*, long unsigned int)}’ [-fpermissive]
lua_yajl1.c:894:9: error: ‘cfg’ was not declared in this scope
lua_yajl1.c:910:39: error: ‘cfg’ was not declared in this scope
lua_yajl1.c:910:53: error: ‘yajl_gen_alloc2’ was not declared in this scope
TLuaInterpreter.cpp: In static member function ‘static int TLuaInterpreter::setMainWindowSize(lua_State*)’:
TLuaInterpreter.cpp:2385:12: warning: unused variable ‘pHost’ [-Wunused-variable]
TLuaInterpreter.cpp: In static member function ‘static int TLuaInterpreter::hasSpecialExitLock(lua_State*)’:
TLuaInterpreter.cpp:3313:10: warning: unused variable ‘b’ [-Wunused-variable]
TLuaInterpreter.cpp: In static member function ‘static int TLuaInterpreter::setAppStyleSheet(lua_State*)’:
TLuaInterpreter.cpp:3841:1: warning: no return statement in function returning non-void [-Wreturn-type]
TLuaInterpreter.cpp: In static member function ‘static int TLuaInterpreter::tempButton(lua_State*)’:
TLuaInterpreter.cpp:5003:9: warning: unused variable ‘childID’ [-Wunused-variable]
TLuaInterpreter.cpp: In static member function ‘static int TLuaInterpreter::tempButtonToolbar(lua_State*)’:
TLuaInterpreter.cpp:5072:9: warning: unused variable ‘childID’ [-Wunused-variable]
TLuaInterpreter.cpp: In static member function ‘static int TLuaInterpreter::setMapVar(lua_State*)’:
TLuaInterpreter.cpp:6292:9: warning: unused variable ‘value’ [-Wunused-variable]
TLuaInterpreter.cpp: In static member function ‘static int TLuaInterpreter::sendIrc(lua_State*)’:
TLuaInterpreter.cpp:8333:59: warning: ‘bool Irc::Session::cmdMessage(const QString&, const QString&)’ is deprecated (declared at irc/include/ircsession.h:145) [-Wdeprecated-declarations]
TLuaInterpreter.cpp:8329:12: warning: unused variable ‘pHost’ [-Wunused-variable]
make: *** [tmp/TLuaInterpreter.o] Error 1

The reason I tried to recompile at this time, was due to it being while since last compile and because for some reason, the Mudlet triggers/alias/etc editor dialog does not refresh properly when clicking a new item. Instead, I have to click another item or in another input box on the editor before it refreshes properly. Suffice to say, this is highly annoying, and irritating method to perform everytime I want to change an item.

What should I do in order to get mudlet to compile properly with libyajl2?

Aico
Posts: 27
Joined: Wed Jan 20, 2010 3:46 pm

Re: Can't compile on Debian wheezy with libyajl2

Post by Aico »

From the error, it is complaining because the pointer types are wrong. To fix it, in line 78 of lua_yajl1.c you need to change the code from:
Code: [show] | [select all] lua
unsigned int len;
to
Code: [show] | [select all] lua
size_t len;
You might also need to cast it back in line 81 to:
Code: [show] | [select all] lua
lua_pushlstring(L, (char*)buf, (unsigned int)len);
But it should not be required.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Can't compile on Debian wheezy with libyajl2

Post by Heiko »

I made Mudlet work with yajl2 a long time ago. You need following changes in the code:
src.pro line 109: change lua_yajl1.c to lua_yajl.c
TLuaInterpreter.cpp:
41 //#ifdef Q_OS_WIN32
42 #include "lua_yajl.c"
43 //#else
44 // #include "lua_yajl1.c"
45 //#endif

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: Can't compile on Debian wheezy with libyajl2

Post by Rakon »

Thanks for the reply Aico, and Heiko.

Unfortunatly, even after making both suggested changes, attempting the compile with lua_yajl1 (Aico's change) fails. a make dist-clean and running qmake, and then making the changes Heiko suggest -also- results in a failed build.

Error in question:

Code: Select all


In file included from TLuaInterpreter.cpp:42:0:
lua_yajl.c: In function ‘int js_generator_number(lua_State*)’:
lua_yajl.c:593:27: error: ‘_isnan’ was not declared in this scope
In file included from TLuaInterpreter.cpp:42:0:
lua_yajl.c: In function ‘int js_generator_value(lua_State*)’:
lua_yajl.c:779:29: warning: unused variable ‘len’ [-Wunused-variable]
lua_yajl.c:780:29: warning: unused variable ‘str’ [-Wunused-variable]
TLuaInterpreter.cpp: In static member function ‘static int TLuaInterpreter::setMainWindowSize(lua_State*)’:
TLuaInterpreter.cpp:2385:12: warning: unused variable ‘pHost’ [-Wunused-variable]
TLuaInterpreter.cpp: In static member function ‘static int TLuaInterpreter::hasSpecialExitLock(lua_State*)’:
TLuaInterpreter.cpp:3313:10: warning: unused variable ‘b’ [-Wunused-variable]
TLuaInterpreter.cpp: In static member function ‘static int TLuaInterpreter::setAppStyleSheet(lua_State*)’:
TLuaInterpreter.cpp:3841:1: warning: no return statement in function returning non-void [-Wreturn-type]
TLuaInterpreter.cpp: In static member function ‘static int TLuaInterpreter::tempButton(lua_State*)’:
TLuaInterpreter.cpp:5003:9: warning: unused variable ‘childID’ [-Wunused-variable]
TLuaInterpreter.cpp: In static member function ‘static int TLuaInterpreter::tempButtonToolbar(lua_State*)’:
TLuaInterpreter.cpp:5072:9: warning: unused variable ‘childID’ [-Wunused-variable]
TLuaInterpreter.cpp: In static member function ‘static int TLuaInterpreter::setMapVar(lua_State*)’:
TLuaInterpreter.cpp:6292:9: warning: unused variable ‘value’ [-Wunused-variable]
TLuaInterpreter.cpp: In static member function ‘static int TLuaInterpreter::sendIrc(lua_State*)’:
TLuaInterpreter.cpp:8333:59: warning: ‘bool Irc::Session::cmdMessage(const QString&, const QString&)’ is deprecated (declared at irc/include/ircsession.h:145) [-Wdeprecated-declarations]
TLuaInterpreter.cpp:8329:12: warning: unused variable ‘pHost’ [-Wunused-variable]
make: *** [tmp/TLuaInterpreter.o] Error 1

A little too much going on in the above for me understand what needs to be done to correct it. Any additional insights ??

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Can't compile on Debian wheezy with libyajl2

Post by Heiko »

According to your compiler output, you didn't do what I suggested. lua_yajl1.c must not be used, but lua_yajl.c.

User avatar
Rakon
Posts: 350
Joined: Tue Feb 16, 2010 7:41 pm
Contact:

Re: Can't compile on Debian wheezy with libyajl2

Post by Rakon »

Heiko wrote:According to your compiler output, you didn't do what I suggested. lua_yajl1.c must not be used, but lua_yajl.c.
I did exactly what you stated, after completely removing the mudlet git directory and re-issuing a git clone.

src.pro

Code: Select all

...
108    TMap.cpp \
109    lua_yajl.c \
110    TBuffer.cpp \
...
TLuaInterpreter.cpp

Code: Select all

41 //#ifdef Q_OS_WIN32
42 #include "lua_yajl.c"
43 //#else
44 //#include "lua_yajl1.c"
45 //#endif
Could you please let me know if these changes are exactly what you meant, and that Mudlet should compile properly after making them??

Please refer to my previous post regarding the exact compiler output after making those changes.

User avatar
Heiko
Site Admin
Posts: 1548
Joined: Wed Mar 11, 2009 6:26 pm

Re: Can't compile on Debian wheezy with libyajl2

Post by Heiko »

This was a reading error on my part, sorry.

You should look at the official Debian Wheezy and SID builds in order to find out what needs to be changed in our Makefile to make it compile: http://packages.debian.org/wheezy/mudlet

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

Re: Can't compile on Debian wheezy with libyajl2

Post by Vadi »

I think that if it is using lua_yajl.c, then it means it's using yajl2 when built on debian/ubuntu. I'm running into this error as well, and I'm specifically targetting yajl2.

Will post back once I figure this out.

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

Re: Can't compile on Debian wheezy with libyajl2

Post by Vadi »

I believe the original error was because yajl2 was being used in the source, while only yajl1 is available in Ubuntu 12.04. It's Ubuntu 12.10 that will have yajl2.

Post Reply