Linking in Linux (Fedora, Eclipse)


25-03-2010 18:42:45

I've been trying for the past day or two to link OgreOggSound into my project in Eclipse in a Linux environment, but haven't had any luck. I realized that one issue was that I was using capitalization whereas the actual .a file is all lowercase (OgreOggSound vs ogreoggsound) but while that corrected ~8 errors, now I have 96 more. ALL of them right now are "undefined reference to" and then some variable name (or function, in a few cases--boost::thread::join()).

I haven't been using Linux that long, and I had never used .a files before, so I'm not really sure how to go about recompiling (if that is necessary) to a new .a file. But if anyone has any help to offer I'd really appreciate it.


25-03-2010 21:30:38

Hi There,

Unfortunately I'm unfamiliar with LINUX and its filesystem, I never managed to get the lib to compile in an IDE like eclipse, I tried Eclipse and CodeBlocks, I did however manage to compile from a terminal window without problem using cmake.

I don't have access to a LINUX machine at present so I don't know for certain that it compiles correctly, although as far as I'm aware other people have gotten it to and I did make a few changes to fix a few compile issues recently. As far using the lib in a project, I haven't a clue how to set that up, hopefully somebody with experience can help you out soon.

What are some of the error messages??


26-03-2010 14:04:12

Thanks for the reply. As of right now I have 96 errors.

The first is
"make: ***[ProjectName] Error 1".

The following two are
"more undefined references to 'alcGetEnumValue' follow
more undefined references to 'alSourcef' follow"

EVERYTHING (93) after those 3 are:

"undefined reference to 'something'"

Where something varies to things such as: 'alBufferData', 'alcCaptureCloseDevice', 'alcCaptureOpenDevice', 'alcCaptureSamples', 'alcCaptureStart', 'alcCaptureStop', and various others. (Like I said, 93 of them and I'm assuming they all somewhat fall under the same reasoning. The location varies to different files as well, listing the various .cpp files that seem to exist as a part of the OgreOggSound library. I tried using CMake, but being not particularly familiar with cmake or cmake-gui, I don't think it is running properly, as when I run a make on the build directory, it fails to build properly.

EDIT: I have also noted that CMake seems to be looking for the Ogre directory. Again, being unfamiliar with CMake, I don't know how to redirect its search to point it at my Ogre build (or source?)


26-03-2010 21:19:08

If you use CMAKE and a terminal window then follow the instructions for compiling OGRE source on LINUX from the wiki first, then everything you need should already be installed, except maybe OpenAL soft.

As for within an IDE, the lib uses a few environment variables for various paths, OGRE / BOOST / OPENAL so it looks like they aren't set up correctly within the IDE, thats where I'm not much use, as I never managed to fathom how to set that up either and have since got a new pc and am yet to install a flavour of LINUX on it.


02-04-2010 04:58:34

@TuxBobble: Those messages are very clear, your build system can't find the OpenAL headers. I don't know how to set up Eclipse either. I use Code::Blocks on Linux. But the steps are basicaly the same on any IDE and build system.

First make sure you have OpenAL library and header. Either install them from your package manager (both the binary and the development packages) or donwload the sources from the openal-soft website and compile yourself;

Second, add "openal" to your linker settings (it's -lopenal for gcc on the command line);

Third, add the include path (that's the directory where the header files are) to your compiler's search directories and the library path to the linker's search directories;

Do the same for boost_thread-mt, boost_date_time-mt, ogg, vorbis and vorbisfile.

Hope that helps