Jump to content

Compillation error on linux with gcc 4.3.2 in DevIL header IL/il.h


Recommended Posts

Hello

I thought I'd check out the game after seeing it on stumble upon :-) it looks promising so far

I ran in to just a few problems building on Linux. First I hit the precompiled header/annonymous namespace GCC bug when building woth GCC 4.1.2 (I didn't notice the warning, and option to disable PCH, in the build wiki till later).

Building with GCC 4.3.2 got around this but I then ran in to some compile errors in the bundled DevIL library headers.

First of all AtlasUI could not find the DevIL headers. I fixed this by hacking the premake script


Index: build/premake/premake.lua
===================================================================
--- build/premake/premake.lua (revision 7024)
+++ build/premake/premake.lua (working copy)
@@ -746,7 +746,8 @@
{ -- include
"..",
"CustomControls",
- "Misc"
+ "Misc",
+ "../../../../libraries/devil/include"
},{ -- extern_libs
"boost",
"devil",

After this I hit a compile error in the bundled DevIL headers


ColourTesterImageCtrl.cpp
In file included from ../../../source/tools/atlas/AtlasUI/ColourTester/ColourTesterImageCtrl.cpp:34:
../../../source/tools/atlas/AtlasUI/../../../../libraries/devil/include/IL/il.h:491: error: ‘<anonymous>’ has incomplete type
../../../source/tools/atlas/AtlasUI/../../../../libraries/devil/include/IL/il.h:491: error: invalid use of ‘ILvoid’

This has been reported previously and fixed upstream. However until the upstream fix is bought in the following substitution should do the trick


sed 's|(ILvoid)|()|g' -i libraries/devil/include/IL/il{,u}.h

Subsequently I installed a newer DevIL (version 1.7.7) system wide - I see that the build system will choose the headers from this (and I presume link against the system wide library?) in preference to the bundled ones and doing this gets around having to hack the premake file and headers.

Having sorted all that out I got a successful build!

I couldn't see an option to raise a trac ticket for the premake patch but feel free to add it in if it's an appropriate fix.

Cheers

Seb.

Edited by seb
Link to comment
Share on other sites

Hello

I thought I'd check out the game after seeing it on stumble upon :-) it looks promising so far

Thanks :)
First I hit the precompiled header/annonymous namespace GCC bug when building woth GCC 4.1.2 (I didn't notice the warning, and option to disable PCH, in the build wiki till later).
Hmm, is there some way we could modify the wiki to make that note more noticable?
I couldn't see an option to raise a trac ticket for the premake patch but feel free to add it in if it's an appropriate fix.
I think you have to register on Trac, and then there should be a 'new ticket' button to report issues.

I think the libdevil sources included are meant for windows.

Yep - the idea is that for almost all external libraries we use, Linux/OS X users should install standard system-wide versions of the libraries. (That ensures they're up to date with e.g. security fixes, and the sharing saves disk space and memory, and they're much more likely to build successfully from the standard packages, etc). The 'libraries' directory is (mostly) provided just for Windows users, and includes the headers and precompiled Win32 .lib files, because Windows doesn't have an easy way to install system-wide libraries and we have to provide them all ourselves.

So I think we don't need to make any changes, and if you stick with the system-wide version of DevIL then it should all work fine :D

(Actually, I'm ignoring that we have a tweaked version of DevIL's source, which fixes a few bugs and does much better (though not great) DXTC compression. The bug-fixes really ought to be propagated upstream (if they're not fixed in the standard version already), and we ought to use something like NVIDIA's new open source library for DXTC compression. None of that matters unless you're using the game's Texture Converter tool to create DDS files, though.)

Link to comment
Share on other sites

Thanks espes, Ykkrosh

As you say Ykkrosh, system-wide libraries are a nicer option if available.

I'm not quite sure if the behaviour of the build system is quite right in this particular case. If it identifies the OS as Linux, and can't find an installed libdevil it should either fail early (hopefully the link errors would be obvious enough :-) ), or if it does decide to use the bundled version then this should work successfully - at the moment AtlasUI won't find the devil headers.

I think a change is still required: either to prevent bundled libraries from being used on non-windows systems or to make sure they will work if selected. Though the fact that DevIL has been slightly branched does complicate matters a bit.

Link to comment
Share on other sites

The way things are set up now, non-windows builds always use the system-installed DevIL library and never the one in the tree (and like you have noticed, the version in the tree doesn't work on linux).

If the code can't find the system-installed devil headers it will just fail to compile (which seems to be the original problem). To fix that, you might need to change the definition of devil in extern_libs.lua - if you have devil installed in a non-standard location for instance. (We currently add no include paths for devil, but if it's required and if devil comes with a config-program we could use that to set the proper cflags)

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...