c++makefileopenframeworks

How to build openFrameworks as a shard library on macOS


I'm trying to build OF as a shared library (.so) in macOS.

I added the following to my app's config.make file.

APPNAME = myApp.so

PROJECT_LDFLAGS = -rdynamic -shared -undefined dynamic_lookup

PROJECT_OPTIMIZATION_CFLAGS_RELEASE = -O3

But when I build the project using make, it actually generates an Application file myApp.so.app which is not a shared library.

How can I properly build OF as a shared library in macOS?


Solution

  • I could successfully build OF as a shared library with the following:

    APPNAME = myApp.so
    PROJECT_CFLAGS = -Wall
    PROJECT_LDFLAGS = -dynamiclib -Wl,-undefined -Wl,dynamic_lookup
    PROJECT_OPTIMIZATION_CFLAGS_RELEASE = -O3