liblzo2 compilation issue

Got a problem with OpenTTD? Find some help here.

Moderator: OpenTTD Developers

User avatar
Paploo
Engineer
Engineer
Posts: 21
Joined: 10 Jan 2010 03:19
Location: Spokane, WA, USA

Re: liblzo2 compilation issue

Post by Paploo »

Hai wrote:I got an error complaining the lzo1x.h could not be found during compilation with lzo2 enabled.

I edited crashlog.cpp and saveload/saveload.cpp and changed the include statement to

#include </opt/local/include/lzo/lzo1x.h>

from

#include <lzo/lzo1x.h>

to reflect the location of where macports installed lzo2 headers.
This change is only helpful for you, but would break it for anyone getting the library/headers from somewhere else. A better way to do this would be to give configure the option for changing the headers path. Use CFLAGS and pass in the correct gcc option after it (-B is what it is methinks, but it has been awhile).

By the way, you can use LDFLAGS and the linker's -I option to add libraries to the search paths.

It seems like it would behoove you to read through some documentation on gcc so that you can solve the problems without making a mess of either your system or your code. All the symbolic linking and source code monkeying is unnecessary and permanently affects your system. :)

I hope this helps!
Hai
Engineer
Engineer
Posts: 16
Joined: 10 Feb 2010 03:02

Re: liblzo2 compilation issue

Post by Hai »

Paploo wrote: Use CFLAGS and pass in the correct gcc option after it (-B is what it is methinks, but it has been awhile).

By the way, you can use LDFLAGS and the linker's -I option to add libraries to the search paths.
Want to give me an example? I'm not used to all this manual stuff, normally just use XCode and press the build button and presto I've got an iPhone app.

Otherwise the most I do with command line stuff is
./configure
make
make install

And that's only after I can't get a package using apt-get :-)
User avatar
John
Tycoon
Tycoon
Posts: 3402
Joined: 05 May 2003 18:44
Location: Cotswolds, UK
Contact:

Re: liblzo2 compilation issue

Post by John »

Paploo wrote:
John wrote:Finally, when I was trying macports I installed the liblzo2 +universal variant (along side the darwin 8 version)- and the ./configure error switched to a "disabled" error for liblzo2.
Have any of you tried compiling the liblzo2 lib from source?
No I hadn't. I just tried it, and you know what? It bloody well worked as well....

Thanks for that.

For reference for everyone else, going to http://www.oberhumer.com/opensource/lzo/download/ to download the lzo source, compiling it yourself and installing it (read the INSTALL file for a full description of make commands to use) works wonders.

Also allowed me to uninstall Fink, marvellous. :)
User avatar
Paploo
Engineer
Engineer
Posts: 21
Joined: 10 Jan 2010 03:19
Location: Spokane, WA, USA

Re: liblzo2 compilation issue

Post by Paploo »

John wrote:
Paploo wrote: Have any of you tried compiling the liblzo2 lib from source?
No I hadn't. I just tried it, and you know what? It bloody well worked as well....

Thanks for that.
No problem; glad I was able to help :)
pvz
Engineer
Engineer
Posts: 3
Joined: 27 Dec 2007 19:23

Re: liblzo2 compilation issue

Post by pvz »

./configure --with-liblzo2=/opt/local/lib/liblzo2.a --CFLAGS=-I/opt/local/include

This will make OpenTTD SVN build on OS X with Macports-installed liblzo2.
Per von Zweigbergk
pv2b on IRC and OpenTTD.
Chakotay
Engineer
Engineer
Posts: 1
Joined: 01 Mar 2010 10:10

Re: liblzo2 compilation issue

Post by Chakotay »

I had to additionally apply LDFLAGS to satisfy the linker with me:
(using the fink installation on Mac OS X 10.6)

./configure --with-liblzo2=/sw/lib/liblzo2.a --CFLAGS=-I/sw/include --LDFLAGS=-L/sw/lib
nicolunacba
Engineer
Engineer
Posts: 1
Joined: 11 May 2010 14:41

Re: liblzo2 compilation issue

Post by nicolunacba »

Err, I am new in the forum. I was reading this and I want to say I am using OS X and I am compiling every new version of OpenTTD. I am not having any problems ;D.

I hate DarwinPorts. They only causes problems :S. So, please, download and compile the liblzo2 from its source: http://www.oberhumer.com/opensource/lzo ... .03.tar.gz (./configure; make; sudo make install ... easy like that ).

So, well, I miss the OS X build, but I can play =). Regards all.
User avatar
planetmaker
OpenTTD Developer
OpenTTD Developer
Posts: 9432
Joined: 07 Nov 2007 22:44
Location: Sol d

Re: liblzo2 compilation issue

Post by planetmaker »

nicolunacba wrote:I hate DarwinPorts. They only causes problems :S.
They work usually quite nicely. And it all works as it should in new(er) versions. Even irrespective of liblzo version thanks to work-arounds within OpenTTD itself.
chadwickboggs
Engineer
Engineer
Posts: 1
Joined: 12 Sep 2013 22:51

Re: liblzo2 compilation issue

Post by chadwickboggs »

I still get "configure: error: Could not find lzo2 library - please install liblzo2-dev" even thought I have lzo2 installed from MacPorts.

Can somebody please post slightly clearer more explicit instructions if possible as I love lrz and not having its latest on OS-X is a significant issue for me.
Post Reply

Return to “OpenTTD Problems”

Who is online

Users browsing this forum: No registered users and 8 guests