OpenSceneGraph Forum Forum Index OpenSceneGraph Forum
Official forum which mirrors the existent OSG mailing lists. Messages posted here are forwarded to the mailing list and vice versa.
 
   FAQFAQ    SearchSearch    MemberlistMemberlist    RulesRules    UsergroupsUsergroups    RegisterRegister 
 Mail2Forum SettingsMail2Forum Settings  ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
   AlbumAlbum  OpenSceneGraph IRC ChatOpenSceneGraph IRC Chat   SmartFeedSmartFeed 

Problem building osg application with osgAudio support


 
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General [3rdparty]
View previous topic :: View next topic  
Author Message
mikaxr27
Newbie


Joined: 31 Jan 2014
Posts: 11

PostPosted: Fri Jan 31, 2014 4:06 pm    Post subject:
Problem building osg application with osgAudio support
Reply with quote

Dear Forum-Members,

I successfully built osgAudio (both on Linux and Windows), and I am able to run the example files (at least, most of them). But I just can't manage to build my osg application with osgAudio support. I am new to C++ and CMake, so this is supposedly a rather trivial question not specifically related to osgAudio but to osg-Nodekits/CMake in general.

I included the directories of the osgAudio header files in 'CmakeLists.txt',
and set the paths to the libraries ('OSGAUDIO_INCLUDE_DIR' and 'OSGAUDIO_LIBRARY') manually, but when building I get errors like "'osgAudio' is not a namespace-name".

I am stuck, could someone point out to me what I need to include in
my 'CMakeLists.txt' - file? Maybe there also is a 'FindosgAudio.cmake' file I have been missing (I found one on the web and copied it to my cmake-folder, which did not achieve anything).


Thank you very much!
PS: I am new to this forum, so, hello to all.

Cheers,
Michael
Back to top
View user's profile Send private message
mikaxr27
Newbie


Joined: 31 Jan 2014
Posts: 11

PostPosted: Thu Mar 06, 2014 8:37 am    Post subject:
Problem building osg application with osgAudio support
Reply with quote

Dear Forum-Members,

I successfully built osgAudio (both on Linux and Windows), and I am able to run the example files (at least, most of them). But I just can't manage to build my osg application with osgAudio support. I am new to C++ and CMake, so this is supposedly a rather trivial question not specifically related to osgAudio but to osg-Nodekits/CMake in general.

I included the directories of the osgAudio header files in 'CmakeLists.txt',
and set the paths to the libraries ('OSGAUDIO_INCLUDE_DIR' and 'OSGAUDIO_LIBRARY') manually, but when building I get errors like "'osgAudio' is not a namespace-name".

I am stuck, could someone point out to me what I need to include in
my 'CMakeLists.txt' - file? Maybe there also is a 'FindosgAudio.cmake' file I have been missing (I found one on the web and copied it to my cmake-folder, which did not achieve anything).


Thank you very much!
PS: I am new to this forum, so, hello to all.

Cheers,
Michael

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=58116#58116







------------------
Post generated by Mail2Forum
Back to top
View user's profile Send private message
Chris Hanson
Guest





PostPosted: Thu Mar 06, 2014 3:35 pm    Post subject:
Problem building osg application with osgAudio support
Reply with quote

Are you actually including the osgAudio header file?


On Fri, Jan 31, 2014 at 9:06 AM, Michael Nolde < (
Only registered users can see emails on this board!
Get registred or enter the forums!
)> wrote:
Quote:
Dear Forum-Members,

I successfully built osgAudio (both on Linux and Windows), and I am able to run the example files (at least, most of them). But I just can't manage to build my osg application with osgAudio support. I am new to C++ and CMake, so this is supposedly a rather trivial question not specifically related to osgAudio but to osg-Nodekits/CMake in general.

I included the directories of the osgAudio header files in 'CmakeLists.txt',
and set the paths to the libraries ('OSGAUDIO_INCLUDE_DIR' and 'OSGAUDIO_LIBRARY') manually, but when building I get errors like "'osgAudio' is not a namespace-name".

I am stuck, could someone point out to me what I need to include in
my 'CMakeLists.txt' - file? Maybe there also is a 'FindosgAudio.cmake' file I have been missing (I found one on the web and copied it to my cmake-folder, which did not achieve anything).


Thank you very much!
PS: I am new to this forum, so, hello to all.

Cheers,
Michael

------------------
Read this topic online here:
http://forum.openscenegraph.org/viewtopic.php?p=58116#58116





_______________________________________________
osg-users mailing list
(
Only registered users can see emails on this board!
Get registred or enter the forums!
)
http://lists.openscenegraph.org/listinfo.cgi/osg-users-openscenegraph.org




--
Chris 'Xenon' Hanson, omo sanza lettere. http://www.alphapixel.com/
Training &bull; Consulting &bull; Contracting
3D &bull; Scene Graphs (Open Scene Graph/OSG) &bull; OpenGL 2 &bull; OpenGL 3 &bull; OpenGL 4 &bull; GLSL &bull; OpenGL ES 1 &bull; OpenGL ES 2 &bull; OpenCL
Digital Imaging &bull; GIS &bull; GPS &bull; osgEarth &bull; Terrain &bull; Telemetry &bull; Cryptography &bull; Digital Audio &bull; LIDAR &bull; Kinect &bull; Embedded &bull; Mobile &bull; iPhone/iPad/iOS &bull; Android
@alphapixel facebook.com/alphapixel (775) 623-PIXL [7495]

------------------
Post generated by Mail2Forum
Back to top
mikaxr27
Newbie


Joined: 31 Jan 2014
Posts: 11

PostPosted: Fri Mar 14, 2014 7:25 pm    Post subject:
trouble when including the header files
Reply with quote

Hi,

when I include the header files from osgAudio example 'simple.cpp', I get the error "al.h: No such file or directory" when compiling. The added lines are:
#include <osgAudio/Source.h>
#include <osgAudio/Sample.h>
I am however able to compile the osgAudio examples, so this file seems to be somewhere.
I would guess it has something to do with my CMakeLists.txt file.

I attach the terminal output:

mic@ukzfg-s16:~/Code/cpp_openscenegraph/adv$ sh build.sh
-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: /usr/bin/c++
-- Check for working CXX compiler: /usr/bin/c++ -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
-- Found osg: /usr/lib/libosg.so
-- Found OpenThreads: /usr/lib/libOpenThreads.so
-- Found osgDB: /usr/lib/libosgDB.so
-- Found osgUtil: /usr/lib/libosgUtil.so
-- Found osgViewer: /usr/lib/libosgViewer.so
-- Found osgWidget: /usr/lib/libosgWidget.so
-- Found osgAnimation: /usr/lib/libosgAnimation.so
-- Found osgGA: /usr/lib/libosgGA.so
-- Configuring done
-- Generating done
-- Build files have been written to: /home/mic/Code/cpp_openscenegraph/adv
Scanning dependencies of target MyProject
[ 33%] Building CXX object CMakeFiles/MyProject.dir/AnimtkViewer.cpp.o
In file included from /usr/local/include/openalpp/SoundData.h:33:0,
from /usr/local/include/openalpp/Stream.h:31,
from /usr/local/include/openalpp/Source.h:29,
from /usr/local/include/osgAudio/BackendOpenALpp/SourceOpenALpp.h:35,
from /usr/local/include/osgAudio/Source.h:35,
from /home/mic/Code/cpp_openscenegraph/adv/AnimtkViewer.cpp:37:
/usr/local/include/openalpp/AudioBase.h:31:16: fatal error: al.h: No such file or directory
#include <al.h>
^
compilation terminated.
make[2]: *** [CMakeFiles/MyProject.dir/AnimtkViewer.cpp.o] Error 1
make[1]: *** [CMakeFiles/MyProject.dir/all] Error 2
make: *** [all] Error 2



Thank you very much!

Cheers,
Michael
Back to top
View user's profile Send private message
mikaxr27
Newbie


Joined: 31 Jan 2014
Posts: 11

PostPosted: Mon Mar 17, 2014 5:07 pm    Post subject:
problem solved (compiling with osgAudio support)
Reply with quote

Hi there,

I finally managed it. The way to go was to create a
'FindosgAudio'-file in the cmake/Modules folder by hand.
For those interested, here's the summary of what I did:

- compiled osgAudio with OpenAL-support (make/make install)
- copied 'libosgAudio.so' from osgAudio-Build-dir to '/usr/lib/'
- copied '/usr/include/AL/al.h' to '/usr/include/al.h'
- copied '/usr/include/AL/alc.h' to '/usr/include/alc.h'
- copied 'FindosgViewer.cmake' in the cmake/Modules folder, renamed it to 'FindosgAudio.cmake', and changed all the 'osgViewer'-Entries to 'osgAudio'

in the CMakeLists.txt of my osg projekt, I added:
find_package( osgAudio )
config_project( MyProject OSGAUDIO )

#this is the 'config-project'-macro:
macro( config_project PROJNAME LIBNAME )
include_directories( ${${LIBNAME}_INCLUDE_DIR} )
target_link_libraries( ${PROJNAME} ${${LIBNAME}_LIBRARY} )
endmacro()

In my osg project cpp, I included the osgAudio header files:
#include <osgAudio/Source.h>
#include <osgAudio/Sample.h>
using namespace osgAudio;

That's it, now compiling and linking of the osg application works with osgAudio support.


Hope this might be of help for somebody,
cheers, Michael

...


Thank you!

Cheers,
Michael
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    OpenSceneGraph Forum Forum Index -> General [3rdparty] All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You cannot download files in this forum

Similar Topics
Topic Author Forum Replies Posted
No new posts obj plugin does not support diffuse a... Ralf Habacker General 1 Tue Sep 19, 2017 6:21 am View latest post
No new posts Problem blending multiple render passes antiro42 General 5 Sat Sep 09, 2017 9:44 am View latest post
No new posts osgText::Text problem robertosfield General 5 Thu Aug 17, 2017 12:23 pm View latest post
No new posts Problem to load images robertosfield General 10 Mon Aug 07, 2017 10:36 pm View latest post
No new posts Multi layer effect rendering problem ... not3not4 General 0 Wed Jul 19, 2017 9:44 am View latest post


Board Security Anti Bot Question MOD - phpBB MOD against Spam Bots
Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP