problems compiling Mudlet from source code

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

Re: problems compiling Mudlet from source code

Post by Vadi »

Perhaps you're using Qt 4.8. Mudlets sources need to be updated: https://bugs.launchpad.net/ubuntu/+sour ... bug/934992

azinulbizar
Posts: 13
Joined: Fri Aug 10, 2012 11:25 pm

Re: problems compiling Mudlet from source code

Post by azinulbizar »

I'm receiving some errors during the build:

I'm using Slackware 13.37 x86_64

qmake && make && make install

In file included from TCommandLine.h:32:0,
from TConsole.h:37,
from TConsole.cpp:24:
Host.h:53:23: warning: extra tokens at end of #include directive
In file included from TLabel.h:25:0,
from TConsole.h:43,
from TConsole.cpp:24:
mudlet.h:48:23: fatal error: phonon: No such file or directory
compilation terminated.
make: *** [tmp/TConsole.o] Error 1


I've installed the lua slackpkg, and phonon-4.4.3-x86_64-1.txz. It _should_ already come with this distro, but I reinstalled anyway. Probably something silly because I don't really know that much about what I'm doing :p

Any help is appreciated.

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

Re: problems compiling Mudlet from source code

Post by Vadi »

I'm not familiar with Slackware at all so it'd be great for someone who's compiled Mudlet on it to pitch in. It could be that Slackware has their phonon includes named differently?

azinulbizar
Posts: 13
Joined: Fri Aug 10, 2012 11:25 pm

Re: problems compiling Mudlet from source code

Post by azinulbizar »

I abandoned compiling this for slack. I went ahead and just found the correct version (7.8 as is required) of libpcre and moved it to the slackware lib folder. Pre-packaged installer works just fine now.


Side note: I was originally getting version mismatches due to having an updated copy of libpcre.so.0.0 or whatever, and symlinking this to libpcre.so.3. Downloading libpcre 7.8 and linking (ln -s /usr/lib/libpcre.so.0.0 /usr/lib/libpcre.so.3) worked just fine. Can now use ./run-mudlet.sh.

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

Re: problems compiling Mudlet from source code

Post by Vadi »

Great!

boo
Posts: 3
Joined: Thu Nov 01, 2012 11:48 pm

Re: problems compiling Mudlet from source code

Post by boo »

azinulbizar wrote: In file included from TCommandLine.h:32:0,
from TConsole.h:37,
from TConsole.cpp:24:
Host.h:53:23: warning: extra tokens at end of #include directive
In file included from TLabel.h:25:0,
from TConsole.h:43,
from TConsole.cpp:24:
mudlet.h:48:23: fatal error: phonon: No such file or directory
compilation terminated.
make: *** [tmp/TConsole.o] Error 1
I realize the person I'm quoting worked around this, but I will explain (or at least elaborate. I imagine you already realize these facts, but just to be specific) this in a minute. Earlier today I was trying to compile this (on my fedora 17 box) and this is one of the issues I ran into. Of course, there were others including yajl (I assume the mudlet version is using a different API for yajl than what I have available). The reason I was looking to build this was two reasons:
1 - I was thinking of building an rpm for it.
2 - I've been working on a complete rewrite of a mud I've been the main programmer for, for years, and I wanted to play with this (I normally just use tintin++).

Anyway, the reason there is that error is because there's a conflict with the header file locations and the #include directive.

Three kinds of #include s in C and generally only two are used (in fact, of all the source I've ever looked at or worked on, I have never seen the third way that I recall. Considering it's a macro that expands and that itself is part of C I would guess that's why it's not used).
When the FILE (keyword) is between double quotes, it will search relative to the current directory.
When it (the file) is between angle brackets, it checks the default locations of the compiler. For instance:

$ echo 'int main() { return 0; }' > tmp.c ; gcc -v tmp.c
will show, among other things, this (where the first entry is arch-vendor-os specific):
/usr/lib/gcc/x86_64-redhat-linux/4.7.2/include
/usr/local/include
/usr/include

The third option is a computed directive by way of C macros.

Now, the phonon header files are in their own directory, much like many other libraries are. It is (as I mention below) possible that it was just one file before, but I sure do not know.

That means when a program has (in the above situation):
#include <phonon>

It won't include anything because that is a directory. Why does the error say 'mudlet.h:48:23: fatal error: phonon: No such file or directory' then ? That is the basic description of the errno ENOENT which is used for either or (remember in Unix and therefore Linux EVERYTHING is a file).

In Fedora 17 the current version of phonon-devel is 4.6.0 (release 3) and the files I found that need to be included (in mudlet.h):
phonon/phononnamespace.h
phonon/mediaobject.h

(each in brackets)
Note I did not finish compiling though and it seems that newer versions should not be used (I think I read that on this thread or somewhere on the site).

The only way it should work by just 'phonon' is if that is a file itself in the include directories. So I assume it is a version or packaging difference (maybe debian based distros do something different, as that's what mudlet is developed on ? I don't use either. I have only used debian itself and that was years ago). I find that a bit odd though because C header files in the system end with .h and C++ either have no extension (say, the C++ standard library headers) or some times .hxx or .hpp in the case of non-standard C++ libraries (possibly others as it's not a requirement). But as for why they got the error mentioned, it is most likely that. If they had a directory /usr/include/phonon (or /usr/local/include/phonon) then that would be why.

Perhaps this is more information than needed, but what I can I say/write? I am quite guilty of writing a lot.

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: problems compiling Mudlet from source code

Post by chris »

...so I can't tell if you have a problem or not.

boo
Posts: 3
Joined: Thu Nov 01, 2012 11:48 pm

Re: problems compiling Mudlet from source code

Post by boo »

Sorry for the confusion there. I was more responding to what I quoted (and the response to it from Vadi). I read it in pieces so I read the error, I knew why it was happening and then mentioned it without any other thoughts.

I did encounter some errors related to yajl.

I have yajl and yajl-devel but there's definite issues (name issues, prototype issues among others). Which version did the current release rely on?

Aside from that, I can't say because that's as far as I got before I had some other things to take care of.

No idea what time it is where you are but I'll be off for the night. Have a good day or night (and apologies on the confusion - I have an uncanny knack for doing that).

User avatar
chris
Posts: 493
Joined: Fri Jun 17, 2011 5:39 am

Re: problems compiling Mudlet from source code

Post by chris »

Alright,

Yajl you need to get from here:
https://github.com/lloyd/yajl/downloads

use the 1.0.9 version, as the api has changed in the latest. At some point I imagine we'll be updating mudlet to the yajl2.0

boo
Posts: 3
Joined: Thu Nov 01, 2012 11:48 pm

Re: problems compiling Mudlet from source code

Post by boo »

Okay, apparently I was sleeping yesterday at the computer. Dangerous time to do things as I've shown myself many times, but only realized that this morning. Today isn't much better (and I'll be off after writing this), but I did notice some things that will clarify my confusing post (and yes, it's compiled and linked and runs ok though see note below):

1 - I thought for some reason I was in the general forum (or more specifically: not in help). So, again, apologies on that part.
2 - I also realized something I should have realized to begin with: git being for revision control it would be possible that I have the most current revision. And naturally I did (but again, due to the above I missed it even in the COMPILE file which clearly shows the version as 2.0).
3 - Besides installing several *-devel packages I had to adjust a few things that seemed likely (some of the documented things for Arch Linux at the wiki: http://wiki.mudlet.org/w/Compiling_Mudlet ):
- lua_yajl.c becomes lua_yajl2.c (which is also linked to on the wiki). This meant I could keep yajl2 as long as I update the relevant source files.
- As for phonon: works fine as is, as long as I changed a few includes (one I had done yesterday, the other I didn't).
- update -lhunspell to -lunspell-1.3
- I think that was it for the wiki part.

There might have been some other updates but that is all I can think of at this time. Note when I say runs ok I don't actually have luazip (not in the fedora repos and I didn't bother to compile it myself, for the time being). It is a dependency, yes but I cheated a bit: -lz (which has inflate, too). I only did this as it's not something I will generally use and if that changes I'll fix that. This was nothing but a test (just to clarify that point, because I know full well it should not be done).

Post Reply