Jump to content

How To Use Different Enet Path


Recommended Posts

Hi there,

My distribution has only Enet 1.3

So I compiled Enet 1.2 and placed it to /opt/enet12

Before compiling 0AD, I changed source/lib/external_libs/enet.h:30 like #include "/opt/enet12/include/enet/enet.h"

So there is no compilation error about enet and 0ad. But

ldd pyrogenesis

says that pyrogenesis needs /usr/lib/libenet.so.1. So, this is a Enet 1.3 library.

What should I do to use /opt/enet12/lib/libenet.so.1 instead of /usr/lib/libenet.so.1

Regards.

Link to comment
Share on other sites

(What distro is this? I thought most still had 1.2, or had it under a name "enet-old" or similar.)

If you have the library in a non-standard location, I think the only way to make it work is to edit build/premake/extern_libs.lua, around line 115 where it says tinsert(package.links, "enet"), and add a new line like

tinsert(package.libpaths, libraries_dir.."/opt/enet12/lib")

then run update-workspaces.sh and make again. I think that should take precedence over /usr/lib and make it compile with the right version. I'm not sure whether it'll still use the old when running, though - in that case you might have to run it like 'LD_LIBRARY_PATH=/opt/enet12/lib ./pyrogenesis' to make it look in the right place.

(It would be nice if we had a better way to handle this situation, but I don't know what would work :()

Link to comment
Share on other sites

I use Pardus GNU/Linux and I prepare an unofficial PiSi(*) repository for Pardus.

Unfortunately enet-old or similar one is not available for Pardus and I prepared enet12 package. Since other applications may use Enet 1.3, I want to keep it and I installed Enet 1.2 to a non-standart directory (/opt/enet12)

Your solution works. But instead of

tinsert(package.libpaths, libraries_dir.."/opt/enet12/lib")

,

I used

tinsert(package.libpaths, "/opt/enet12/lib")

Because, if I use previous one, something like "-L"../../../libraries//opt/enet12/lib"" is added to pyrogenesis.make. Since I changed, only "-L"/opt/enet12/lib"" is added and I think the right one is that.

After compiling, "ldd pyrogenesis" says that

libenet.so.0 => not found

So I used

LD_LIBRARY_PATH=/opt/enet12/lib ./pyrogenesis

and it works.

(*) PiSi is Pardus's package management system.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...