It is impossible to use the code from the example

I use libreoffice sdk + Qt creator c++.
I took the example of DocumentLoader.cxx code in my function in Qt project.
I include in .pro file libs

INCLUDEPATH += $$(OO_SDK_HOME)\include
LIBS += -L$$(OO_SDK_HOME)\lib -licppu
LIBS += -L$$(OO_SDK_HOME)\lib -licppuhelper
LIBS += -L$$(OO_SDK_HOME)\lib -lipurpenvhelper
LIBS += -L$$(OO_SDK_HOME)\lib -lisal
LIBS += -L$$(OO_SDK_HOME)\lib -lisalhelper

but arise error
undefined reference to `cppu::defaultBootstrap_InitialComponentContext()’

how to fix it ?

Please read here on how to set up the SDK:

http://api.libreoffice.org/docs/install.html

In short:

  • you should build your code within the SDK environment, which is a special shell (with environment variables properly set up)
  • you can use any editor to modify the code (qt creator, vim, emacs, etc) but don’t expect that IDE features like code completion works
  • you can do your own setup of the SDK with a manually crafted .pro file, but then you’re on your own

Hope this helps. :slight_smile: