Compile OF without rtaudio on Linux?


#1

Hi, I wonder if it’s possible to compile OF without using librtaudio on Ubuntu.

My app won’t use any sound related classes.

In my case, is it possible to somehow exclude rtaudio from compilation?


#2

There’s no simple way. You’ll have to remove the files in the audio section of the openFrameworks library that refer to rtAudio…and possibly remove the linking step.However then you won’t be able to use audio again.


#3

Hi,
I’ve done some similar stuff in the past. I think that the best way to go is to use somo preprocesor define and exclude all the sound related code from the core and also remove the linking library. This way, if you want to use sound again you can simply change the preprocessor define. It is not a straight forwards way though. you’ll have to find which files to exclude and which not.


#4

Also the compiler removes any symbols that are not being used when creating a binary in release mode so probably the difference would not be noticeable if you are trying to optimize the size of the final executable


#5

Would the TARGET_NO_SOUND flag be sufficient?

It includes the following headers in ofMain.h

#include "ofSoundStream.h"
#include "ofSoundPlayer.h"
#include "ofSoundBuffer.h"

#6

oh yeah sure, i’d completely forgot about that. but it also removes fmod not only rtaudio


#7

That’s what I exactly wanted. Thank you!


#8

Well well, you learn something every day!


#9

i added this a while ago to be able to remove fmod from binaries for licensing reasons under linux but had completely forgot about it. It only works out of the box with makefiles i think, qtcreator will remove the code but still try to link the libraries