Archiver dans la catégorie ‘go-oo’
How to install the SDK and compile the C++ examples on MacOS Intel
This post is a MacOS oriented Hello-world based of this wiki page http://wiki.services.openoffice.org/wiki/SDKInstallation. You can have it in French also http://wiki.services.openoffice.org/wiki/FR/Documentation/Installation_du_SDK.

Good news, to start extending OpenOffice using UNO , like create components or extensions, you don’t necessary need to go trough a full build of the source code (I will talk later about the process) which take once start 6h30 on my MacBook Pro. Today, let’s be lazy.
- Requirements
- first you will need Xcode, that’s a standard dependency when you want to start working with C++ on a Mac, you can get it here : http://developer.apple.com/technology/xcode.html.
- A not so old version of OpenOffice. Idealy a 3.1 : http://openoffice.cict.fr/stable/3.1.0/OOo_3.1.0_MacOSXIntel_install_en-US.dmg. It’s better if OpenOffice is installed in /Applications.
- MacPort, or Fink, two packages manager for MacOS. By the way I think MacPort is better, but I got both. You need one of those to install missing programs if there is some, but you have to customize your path : http://guide.macports.org/#installing.shell.
NB : If you encounter some problem with missing program, dependencies, fell free to ask for help in comments.
- Get the SDK
http://openoffice.cict.fr/stable/3.1.0/OOo-SDK_3.1.0_MacOSXIntel_install_en-US.dmg and you can drag and drop anywhere, that does not matter. - Test the SDK
Open a terminal (Terminal.app or Iterm.app), look for the OpenOffice.org3.1_SDK folder :
cd <....>/OpenOffice.org3.1_SDK
#-- And set the environment. Follow the instruction, nothing special here, just some settings.
./setsdkenv_unix
#-- You will need to execute this command each time you want to work with the SDK.
#-- Now go to examples :
cd examples/cpp/DocumentLoader
#-- and build
make
#-- A few set of instruction will be displayed at the end of the build, Let's follow them. First start OpenOffice
soffice "-accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager" &
#-- and execute :
make DocumentLoader.runIf everything went fine, you should see a new document, with the content of OpenOffice.org3.1_SDK/examples/cpp/DocumentLoader/test.odt.
Just enjoy, you can now extend OpenOffice with the SDK. For more information, continue your reading on this page : http://wiki.services.openoffice.org/wiki/SDKInstallation.