ofxLiveApp: addon for live coding

Addon for live coding. Combines two libraries for support OSX and Windows both.

The main idea is that you run the application, make changes and save the source files, then these changes are automatically applied to your running application. This is a fully automatic process

https://github.com/gumilastik/ofxLiveApp

3 Likes

That sounds very cool :slight_smile: Since Jet-Live supports Linux, would it be hard to add one more platform? :slight_smile:

Hey @gumilastik! this looks quite promising. :slight_smile:
Thanks for sharing and welcome to the OF community.
I’ll try it out soon.
cheers

hey @gumilastik, nice!
i am getting:

xcodebuild -project example.xcodeproj | xcpretty -r json-compilation-database --output compile_commands.json
▸ Building example/example [(Release)]
▸ Check Dependencies
▸ Running script ‘Run Script’
▸ Building openFrameworksLib/openFrameworks [Release]
▸ Check Dependencies
▸ Build Succeeded
▸ Compiling main.cpp

:x: /Users/user/Documents/of_v0.10.1_osx_release/addons/ofxLiveApp/src/ofxLiveApp.h:32:18: use of undeclared identifier ‘ILiveListener’

    std::unique_ptr<ILiveListener> listener;
                    ^

:x: /Users/user/Documents/of_v0.10.1_osx_release/addons/ofxLiveApp/example/src/main.cpp:11:2: no matching function for call to ‘ofRunApp’

    ofRunApp(new ofApp());
    ^~~~~~~~

▸ Compiling ofApp.cpp

:x: /Users/user/Documents/of_v0.10.1_osx_release/addons/ofxLiveApp/src/ofxLiveApp.h:32:18: use of undeclared identifier ‘ILiveListener’

    std::unique_ptr<ILiveListener> listener;
 ^

▸ Compiling Particle.cpp
▸ Compiling ofxLiveApp.cpp
** BUILD FAILED **

The following build commands failed:
CompileC build/example.build/Release/example.build/Objects-normal/x86_64/main.o src/main.cpp normal x86_64 c++ com.apple.compilers.llvm.clang.1_0.compiler
(1 failure)

any tip around? i am in macOS Sierra and OF 0.10.1…
Should I install jet-live maybe?

I installed xpretty already:
sudo gem install xcpretty

when compiled with Project Generator I am getting this:
/Users/user/Documents/of_v0.10.1_osx_release/addons/ofxLiveApp/src/ofxLiveApp.h:32:18: Use of undeclared identifier 'ILiveListener'

Yeah, It seems that I fixed the problem. Could you check osx version again?

I think I’m close of having it run on Linux. The jet-live example works fine. I’m struggling with converting this line from addon_config.mk:

ADDON_LDFLAGS += -Wl,-export_dynamic -Wl,-flat_namespace -Wl,-search_paths_first -Wl,-headerpad_max_install_names -ldl

into something that QBS likes. This for instance doesn’t work:

    of.linkerFlags: [
        '-Wl,-export_dynamic',
        '-Wl,-flat_namespace',
        '-Wl,-search_paths_first',
        '-Wl,-headerpad_max_install_names',
        '-ldl']      // flags passed to the linker

e:-1: error: unrecognized option '-Wl,-export_dynamic'

Any ideas?

update: I see one should not use -Wl. Looking for the right syntax.

hey, now it compiles, but i am getting this:

[I] : Initializing...
[I] : Load CUs: done
[W] : Cannot open depfile: /Users/user/Documents/of_v0.10.1_osx_release/addons/ofxLiveApp/example/build/example.build/Release/example.build/Objects-normal/x86_64/ofxLiveApp.d
[I] : Load dependencies: done
[I] : Setup file watcher: done
[I] : Load symbols: done
[E] : Cannot open /Users/user/Documents/of_v0.10.1_osx_release/addons/ofxLiveApp/example/build/example.build/Release/example.build/Objects-normal/x86_64/ofxLiveApp.o
[E] : Cannot open /Users/user/Documents/of_v0.10.1_osx_release/addons/ofxLiveApp/example/build/example.build/Release/example.build/Objects-normal/x86_64/ofApp.o
[E] : Cannot open /Users/user/Documents/of_v0.10.1_osx_release/addons/ofxLiveApp/example/build/example.build/Release/example.build/Objects-normal/x86_64/main.o
[I] : Load exported symbols: done
[I] : Ready
reinit

so, when editing code, i am no getting changes on particles changes

Hi! Anyone managed to get the addon working on Linux?

https://github.com/gumilastik/ofxLiveApp/tree/master/libs/jet doesn’t provide linux libs but they are trivial to produce:

git clone https://github.com/ddovod/jet-live.git && cd jet-live
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=Debug .. && make
./example/example

That example works and builds the libs. It runs a simple command-line program in which you can type hello, then without stopping you edit example/src/SimpleCommandInterpreter.cpp and replace Hello with hello, then type reload in the running program to load the updated function, after which it recognizes the hello command. All good there.

Then I copy libs and headers to ofxLiveApp (creating missing folders first as needed):

$ cp jet-live/build/*.a ofxLiveApp/libs/jet/lib/linux/
$ cp jet-live/build/*.so ofxLiveApp/libs/jet/lib/linux/

$ cp jet-live/src/jet/live/*.hpp ofxLiveApp/libs/jet/live/
$ cp jet-live/src/jet/live/events/*.hpp ofxLiveApp/libs/jet/live/events/
$ cp jet-live/src/jet/live/_linux/*.hpp ofxLiveApp/libs/jet/live/_linux/

In ofxLiveApp I replace every mention of TARGET_OSX with TARGET_LINUX.

When compiling, I get the following linker error:

/usr/bin/ld: /tmp/build-example-Desktop-Debug/Debug/example.c3499c27/91fef50b4c5e1c50/ofxLiveApp.cpp.o: in function `ofxLiveApp':
/home/fp/src/openFrameworks/addons/ofxLiveApp/src/ofxLiveApp.cpp:74: undefined reference to `jet::Live::isInitialized() const'
/usr/bin/ld: /home/fp/src/openFrameworks/addons/ofxLiveApp/src/ofxLiveApp.cpp:76: undefined reference to `jet::Live::update()'
/usr/bin/ld: /home/fp/src/openFrameworks/addons/ofxLiveApp/src/ofxLiveApp.cpp:79: undefined reference to `jet::Live::update()'
/usr/bin/ld: /tmp/build-example-Desktop-Debug/Debug/example.c3499c27/91fef50b4c5e1c50/ofxLiveApp.cpp.o: in function `ofxLiveApp::__sync(ofEventArgs&)':
/home/fp/src/openFrameworks/addons/ofxLiveApp/src/ofxLiveApp.cpp:102: undefined reference to `jet::Live::update()'
/usr/bin/ld: /home/fp/src/openFrameworks/addons/ofxLiveApp/src/ofxLiveApp.cpp:103: undefined reference to `jet::Live::getStatus() const'
/usr/bin/ld: /home/fp/src/openFrameworks/addons/ofxLiveApp/src/ofxLiveApp.cpp:105: undefined reference to `jet::Live::tryReload()'
/usr/bin/ld: /tmp/build-example-Desktop-Debug/Debug/example.c3499c27/91fef50b4c5e1c50/ofxLiveApp.cpp.o: in function `std::unique_ptr<jet::Live, std::default_delete<jet::Live> > jet::make_unique<jet::Live, std::unique_ptr<jet::ILiveListener, std::default_delete<jet::ILiveListener> >, jet::LiveConfig&>(std::unique_ptr<jet::ILiveListener, std::default_delete<jet::ILiveListener> >&&, jet::LiveConfig&)':
/home/fp/src/openFrameworks/addons/ofxLiveApp/libs/jet/live/Utility.hpp:23: undefined reference to `jet::Live::Live(std::unique_ptr<jet::ILiveListener, std::default_delete<jet::ILiveListener> >&&, jet::LiveConfig const&)'
/usr/bin/ld: /tmp/build-example-Desktop-Debug/Debug/example.c3499c27/91fef50b4c5e1c50/ofxLiveApp.cpp.o: in function `std::default_delete<jet::Live>::operator()(jet::Live*) const':
/usr/bin/../lib64/gcc/x86_64-pc-linux-gnu/9.2.0/../../../../include/c++/9.2.0/bits/unique_ptr.h:81: undefined reference to `jet::Live::~Live()'
clang-9: error: linker command failed with exit code 1 (use -v to see invocation)

Any ideas?