Okay, libola links just fine, and I can drop in the headers:

#include <ola/DmxBuffer.h>
#include <ola/Logging.h>
#include <ola/client/StreamingClient.h>

But if I try to run after declaring an object, I get this error:

/usr/bin/ld: /root/Bela/projects/dmx-libola/build/render.o: undefined
reference to symbol '_ZN3ola11InitLoggingENS_9log_levelENS_10log_outputE'
//usr/lib/arm-linux-gnueabihf/libolacommon.so.0: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status
make: *** [/root/Bela/projects/dmx-libola/dmx-libola] Error 1

It doesn't matter which class from the library I declare in the code, I always get the libolacommon.so.0: error adding symbols error.

Sorry this isn't really Bela related, but I'm not as familiar with working out these linking issues.

Can you add "AT=" to the make options and then paste the output here again?
This will make the output more verbose, showing the invocation to the linker and this may help debugging the issue.

It may have something to do with the order in which you are linking in the libraries

that's pretty weird. Can you copy / paste the content of the "make parameters" box please?

right I think you are missing a ";" between the "AT=" and "LD_FLAGS="
you need to put something like
AT=;LD_FLAGS=-lola;
see here

Right, sorry this is my fault all the way through. It should be "LDLIBS=-lola" and not LDFLAGS.
This is because the libraries (e..g.: -lola) should always come last in the command line.
Apologies.
NOTE: I edited the posts above to have LDLIBS instead of LDFLAGS to avoid confusion for newcomers.

make help would have helped:

Usage: make [target] CL=[command line options] [PROJECT=[projectName] | EXAMPLE=[exampleName]]

PROJECT or EXAMPLE should be set for all targets except: help coreclean distclean stop nostartup connect idestart idestop idestartup idenostartup ideconnect scsynthstart scsynthstop scsynthconnect scsynthstartup scsynthnostartup update checkupdate updateunsafe

Targets: (default: Bela)
list: Makefile
 This Makefile is intended for use on the BeagleBone Black itself
 and not for cross-compiling
 available command line options:
 EXAMPLE=          name of the folder in examples/ to be copied to projects/ and built
 PROJECT=          name of the folder in projects/ to be built
 CL=               list of command line options to pass to the program when running
 CPPFLAGS=         list of additional flags passed to the C++ compiler
 CFLAGS=           list of additional flags passed to the C compiler
 COMPILER=         compiler to use (clang or gcc)
 LDFLAGS=          linker flags (e.g.: -L. )
 LDLIBS=           libs to link in (e.g.: -lm )
 AT=              used instead of @ to silence the output. Defaults AT=@, use AT= for a very verbose output

available targets:
help:               Show this help
Bela:               Builds the Bela program with all the optimizations
all:                Same as Bela
debug:              Same as Bela but with debug flags and no optimizations
syntax:             Only checks syntax
projectclean:       Remove the PROJECT's build objects & binary
clean:              Same as projectclean
coreclean:          Remove the core's build objects
distclean:          Restores the Bela folder to a pristine state: remove all the projects source and the built objects, including the core Bela objects.
distcleannoprompt:  Same as distclean, but does not prompt for confirmation. Use with care.
run:                Run PROJECT in the foreground
runide:             Run PROJECT for IDE (foreground, no buffering)
runscreen:          Run PROJECT in the background (detached screen)
runscreenfg:        Run PROJECT in a screen in the foreground (can detach with ctrl-a ctrl-d)
nostartup:          No Bela project runs at startup
startuploop:        Makes PROJECT run at startup and restarts it if it crashes
startup:            Makes PROJECT run at startup
stop:               Stops any Bela program that is currently running
connect:            Connects to the running Bela program (if any), can detach with ctrl-a ctrl-d.
idestart:           Starts the on-board IDE
idestop:            Stops the on-board IDE
idestartup:         Enables the IDE at startup
idenostartup:       Disables the IDE at startup
ideconnect:         Brings in the foreground the IDE that currently is running in a screen (if any), can detach with ctrl-a ctrl-d.
scsynthstart:       Starts scsynth
scsynthstop:        Stops scsynth
scsynthconnect:     Brings in the foreground the scsynth that currently is running in a screen (if any), can detach with ctrl-a ctrl-d.
scsynthstartup:     Enables scsynth at startup
scsynthnostartup:   Disables scsynth at startup
updateclean:        Cleans the $(UPDATES_DIR) folder
checkupdate:        Unzips the zip file in $(UPDATES_DIR) and checks that it contains a valid
updateunsafe:       Installs the update from $(UPDATES_DIR) in a more brick-friendly way
update:             Installs the update from $(UPDATES_DIR)

Good to know about [make help]. Unfortunately still seems to have the issue:

alt text

Don't know if this helps, but this error only happens when I try and use an ola object or function. For example:

alt text
If I comment out the InitLogging line, it builds and runs without issue.

Right, so the [documentation for the library](
http://opendmx.net/index.php/OLA_Client_API) suggests to use:

-lola -lolacommon -lprotobuf 

So try LDLIBS=-lola -lolacommon -lprotobuf;.

Even more interesting - because it applies to this whole set of problems - the appropriate way of getting the compiler/linker flags for any package installed with apt-get is something like:

$ pkg-config --cflags --libs libola
-I/usr/local/include  -L/usr/local/lib -lola -lolacommon -lprotobuf 

Excellent! It's linking now. And thanks for the explanation! I'll be looking for those flags in the docs for future libraries.

Hey giuliomoro,
Thanks again for all the help. We've got another hopefully less complicated question, how do you run a command line command upon boot? Need to connect with this:

ola_patch -d 10 -p 0 -u 1

It's all working, but we want it to know to find and connect the proper device on its own.

I think when you set a project to run on boot from the IDE, it will run with the command line options that are currently active.

7 days later
giuliomoro changed the title to [Solved] Anyone try DMX controls yet?? .
giuliomoro changed the title to Anyone try DMX controls yet?? .
24 days later

Wait I guess I answered the wrong question, I assumed that ola_patch was the name of your Bela program. Instead, I understand now it is a different program altogether (the hint was -p 0, which does not make sense with Bela!).

You can add any command that you want to be executed at startup to the /root/Bela_startup.sh script, which is already executed at boot.
Note: this file is automatically re-generated by the IDE when you select a project to run on boot (which is the reason why in it you will find the line "Do not edit"). It is - however - safe to edit manually and rely on its content as long as you do not reset the "run on boot" program from the IDE.

Also, as a side note, I finally put together some instructions on how to use an external library, on the Blog.