What is Libreoffice SDK? Why do I need it.
https://api.libreoffice.org/examples/examples.html#Cpp_examples
Installing the SDK
The instructions for installing the SDK are given in https://api.libreoffice.org/docs/install.html.
1) If you have the Libreoffice source code, you can install sdk with --enable-odk option in autogen.input file . Then make check, make, ./autogen.sh. (https://wiki.documentfoundation.org/Development/lode). Now the SDK path will be c:/cygwin/home/$user/lode/dev/core/instdir/sdk
2. If you don't have the source code or don''t want to go through the build process again, then sdk can be installed from https://www.libreoffice.org/download/download-libreoffice/. In this case the sdk will be installed in C:\Program Files\LibreOffice\sdk. You will have to follow the path cygwin/cygdrive/c/Program\ Files/Libreoffice/sdk/examples from cygwin shell.
The steps listed below are for installing the LibreOffice SDK
Configuring the SDK in Libreoffice on windows 11
Once you are in SDK folder as mentioned above:-
The configure script for windows is ./setsdkenv_windows.bat in the SDK folder. Execute ./setsdkenv_windows.bat. The configure script requests the following information in order to prepare a working SDK environment.
a) Enter the Office Software Development Kit directory: [C:\cygwin\home\deepika\lode\dev\core\instdir\sdk or C:\Program Files\LibreOffice\sdk]
b) Enter the Office base installation directory [C:\Program Files\LibreOffice].
c) Enter GNU make (3.79.1 or higher) tools directory []: [C:\UnxUtils\usr\local\wbin]
(Cygwin make is installed in Cygwin under C:\cygwin\home\$user\lode\opt\bin). We can install GNU make from http://sourceforge.net/projects/unxutils. Its mentioned on the website that https://api.libreoffice.org/docs/install.html that Cygwin make does not work well with the SDK. Also mingw is also mentioned. (todo:// expore this option)
(Reference: https://wiki.documentfoundation.org/Documentation/DevGuide/Writing_UNO_Components )
The following paths are passed to the configure script based on this installation.
Make = C:\UnxUtils\usr\local\wbin
d) Enter a zip (2.3 or higher) tools directory = C:\UnxUtils\usr\local\wbin
e) Enter a cat (2.0 or higher) tools directory []=C:\UnxUtils\usr\local\wbin
f) Enter a sed (2.0 or higher) tools directory [] = C:\UnxUtils\usr\local\wbin
g) Enter the directory of the C++ compiler (optional) []:C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\bin\Hostx64\x64
The processor architecture can be read from This PC/Properties. It can get confusing, so can be verified from the file c:/cygwin/home/$user/lode/dev/core/config.log, if you have the Libreoffice source code installed. The required executable is c1.exe (todo://).
h) Enter JAVA SDK (1.6 or higher) installation directory (optional) []: C:\Progra~1\Eclips~1\jdk-17.0.8.101-hotspot
i) location of c# and VB.NET : skipped
Default output directory is the "c:\libreoffice24.2_sdk". You can verify that the folder has been created.
j) Automatic deployment of UNO components (YES/NO) [YES]:yes
Now, There is no need to configure this again for using Libreoffice SDK. If you want to configure again, the option
./setsdkenv_windows.bat --force-configure can be used.
/*********************************************************************/
* SDK environment is prepared for Windows
*
* SDK = c:\progra~1\Libreoffice\sdk
* Office = c:\progra~1\Libreoffice
* Make = C:\UnxUtils\usr\local\wbin
* Zip = C:\UnxUtils\usr\local\wbin
* cat = C:\UnxUtils\usr\local\wbin
* sed = C:\UnxUtils\usr\local\wbin
* C++ Compiler = C:\Progra~1\Micros~3\2022\Community\VC\Tools\MSVC\14.37.32822\bin\Hostx64\x64
* C# and VB.NET compilers =
* Java = C:\Progra~1\Eclips~1\jdk-17.0.8.101-hotspot
* Special Output directory = c:\libreoffice7.6_sdk
* Auto deployment = YES
/****************************************************************************/
-->only a path without spaces is allowed because of a limitation of gnu make.
-->Now the important point here is that we have to use "GNU make" rather than "Cygwin make" for SDK examples. ("Cygwin make" does not work well with Libreoffice sdk as mentioned above). In my case the path for GNU make is C:\UnxUtils\usr\local\wbin\make.
-->Go to sdk/examples/cpp/DocumentLoader/ from windows command (CMD) and issue the command C:\UnxUtils\usr\local\wbin\make
but I get the error, ../../../settings/settings.mk:22: /settings/dk.mk: No such file or directory
make: *** No rule to make target '/settings/dk.mk'. Stop.
-->The problem is already filed and discussed in Bugzilla as Bug 155956 - LibreOffice SDK setsdkenv_windows.bat assumes wrong position of VCVARS32.bat
connection. The example use the defaultBootstrap_InitialComponentContext method and provides the additional office types via the UNO environment variable -env:URE_MORE_TYPES=...SET URE_BOOTSTRAP = vnd.sun.star.pathname:C:\Progra~1\LibreOffice \program \ fundamental.ini
-->Before you can run this example you have to start your office in listening mode.
from lode/dev/core/instdir/program/soffice "--accept=socket, port=2083,urp;"or"c:\ProgramFiles\LibreOffice\program"\soffice --accept=socket,host=localhost,port=2083;urp;StarOffice.ServiceManager/****ge: "UNO URL contains bad parameter key" ArgumentPosition: 0 warn:desktop.offacc:2732:12428:desktop/source/offacc/acceptor.cxx:124: com.sun.star.lang.IllegalArgumentException message: "UNO URL contains bad parameter key" ArgumentPosition: 0 warn:desktop.offacc:2732:12428:desktop/source/offacc/acceptor.cxx:124: com.sun.star.lang.IllegalArgumentException message: "UNO URL contains bad parameter key" ArgumentPosition: 0/-->Now if i go to sdk/examples/DevelopersGuide/FirstSteps/cxx and execute C:\UnxUtils\usr\local\wbin\make, i get the same error as above.
mkdir c:\libreoffice24.2_sdk\WINexample.out\miscmkdir: cannot create directory 'c:\\libreoffice24.2_sdk\\WINexample.out\\misc': No such file or directorymake: [../../../../settings/stdtarget.mk:32: c:/libreoffice24.2_sdk/WINexample.out/misc/oosdk_cpp_types.flag] Error 1 (ignored)del c:\libreoffice24.2_sdk\WINexample.out\misc\oosdk_cpp_types.flagmake: del: No such file or directorymake: [../../../../settings/stdtarget.mk:33: c:/libreoffice24.2_sdk/WINexample.out/misc/oosdk_cpp_types.flag] Error 127 (ignored)"C:\cygwin\home\deepika\lode\dev\core\instdir\sdk/bin/cppumaker" -Gc -Oc:/libreoffice24.2_sdk/WINexample.out/inc "C:/Program Files/LibreOffice/program/types.rdb" "C:/Program Files/LibreOffice/program/types/offapi.rdb"echo flagged > c:/libreoffice24.2_sdk/WINexample.out/misc/oosdk_cpp_types.flag/bin/sh: line 1: c:/libreoffice24.2_sdk/WINexample.out/misc/oosdk_cpp_types.flag: No such file or directorymake: *** [../../../../settings/stdtarget.mk:35: c:/libreoffice24.2_sdk/WINexample.out/misc/oosdk_cpp_types.flag] Error 1
Essentially,
So i will try compiling the sdk with cmake or qmake, rather than GNU make in the next article.
https://dev.blog.documentfoundation.org/2022/02/10/working-with-libreoffice-sdk-examples/
/**********************
make
mkdir c:\libreoffice24.2_sdk\WINexample.out\obj\Draw
mkdir: cannot create directory 'c:\\libreoffice24.2_sdk\\WINexample.out\\obj\\Draw': No such file or directory
make: [Makefile:48: c:/libreoffice24.2_sdk/WINexample.out/obj/Draw/Draw.obj] Error 1 (ignored)
cl -c -MD -Zm500 -Zc:wchar_t- -wd4251 -wd4275 -wd4290 -wd4675 -wd4786 -wd4800 -GR -EHa -I. -Ic:/libreoffice24.2_sdk/WINexample.out/inc -Ic:/libreoffice24.2_sdk/WINexample.out/inc/examples -I../../../include -Ic:/libreoffice24.2_sdk/WINexample.out/inc/Draw -DWIN32 -DWNT -D_DLL -DCPPU_ENV=mscx -Foc:\libreoffice24.2_sdk\WINexample.out\obj\Draw\Draw.obj Draw.cxx
Microsoft (R) C/C++ Optimizing Compiler Version 19.37.32822 for x64
Copyright (C) Microsoft Corporation. All rights reserved.
Draw.cxx
Draw.cxx(20): fatal error C1083: Cannot open include file: 'iostream': No such file or directory
make: *** [Makefile:49: c:/libreoffice24.2_sdk/WINexample.out/obj/Draw/Draw.obj] Error 2
/**************************/
Comments
Post a Comment