Need help with installing/setting SDK on Linux

classic Classic list List threaded Threaded
3 messages Options
Rodnyansky Pavel Rodnyansky Pavel
Reply | Threaded
Open this post in threaded view
|

Need help with installing/setting SDK on Linux

Hello everyone! I m pretty new with LibreOffice, I ve been struggling for few days trying to compile a simple c++ programm using SDK and no success yet.


Firstly, what i ve got to this point:
- My os is Ubuntu 16.04 LTS 64 bit
- I successfully installed LibreOffice and sdk from deb packages, both versions 5.2.3 x86-64
- Build headers with cppumaker
- My setsdk_env script up and running
- I compiled couple of basic included examples, but was unable to run them afterwards
- I m trying to compile simplest c++ application with basically couple of sdk headers on top using Qt/GCC_64 and getting a bunch of compiler errors

Here is my output:

/home/pavel/Programms/LibreOfficeTest/include/sal/types.h:293: error: #error ("unknown platform")

/home/pavel/Qt/5.7/gcc_64/include/QtCore/qcompilerdetection.h:223: error: expected constructor, destructor, or type conversion before ‘(’ token #    define Q_DECL_IMPORT     __declspec(dllimport)

etc etc...

I digged a little bit deeper and found this line in sal/config.h file
#if defined(SOLARIS) || defined(LINUX) || defined(NETBSD) || defined(FREEBSD) || \
    defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY) || defined(ANDROID)

All variables not defined. From the looks of it, my programm have no idea about its environment. If i understand correctly this variables can be defined from settings.mk file but i have no idea how to fix it.

setsdk_env output
 * SDK = /opt/libreoffice5.2/sdk
 * Office = /opt/libreoffice5.2
 * Make = /usr/bin
 * Zip = /usr/bin
 * cat = /bin
 * sed = /bin
 * C++ Compiler = /usr/bin
 * Java =
 * SDK Output directory = /home/pavel/libreoffice5.2_sdk
 * Auto deployment = YES


I would appreciate any tips and advises, i really need help at this point.

                                         
sberg sberg
Reply | Threaded
Open this post in threaded view
|

Re: Need help with installing/setting SDK on Linux

On 11/10/2016 12:14 PM, Rodnyansky Pavel wrote:
> *Firstly, what i ve got to this point:*
> - My os is Ubuntu 16.04 LTS 64 bit
> - I successfully installed LibreOffice and sdk from deb packages, both
> versions 5.2.3 x86-64
> - Build headers with cppumaker
> - My setsdk_env script up and running
> - I compiled couple of basic included examples, but was unable to run them
> afterwards

Can you be more specific?

> - I m trying to compile simplest c++ application with basically couple of
> sdk headers on top using Qt/GCC_64 and getting a bunch of compiler errors
>
> *Here is my output:*
>
> /home/pavel/Programms/LibreOfficeTest/include/sal/types.h:293: error: #error
> ("unknown platform")
>
> /home/pavel/Qt/5.7/gcc_64/include/QtCore/qcompilerdetection.h:223: error:
> expected constructor, destructor, or type conversion before ‘(’ token #
> define Q_DECL_IMPORT     __declspec(dllimport)
>
> etc etc...
>
> I digged a little bit deeper and found this line in sal/config.h file
> #if defined(SOLARIS) || defined(LINUX) || defined(NETBSD) ||
> defined(FREEBSD) || \
>     defined(AIX) || defined(OPENBSD) || defined(DRAGONFLY) ||
> defined(ANDROID)
>
> All variables not defined. From the looks of it, my programm have no idea
> about its environment. If i understand correctly this variables can be
> defined from settings.mk file but i have no idea how to fix it.

Unfortunately it's not enough to run from within a setsdkenv_unix shell,
you also need to set up some C++ compiler command line arguments.
Modelling your makefiles after the sdk's example/ makefiles (which
include the SDK's settings/*.mk) would give you that, but you should
also be able to get it working with a plain, handcrafted makefile.  LO's
git sources contain ure/source/uretest/Makefile.pln as an example of
doing that.  What's probably missing for you is defines

   -DCPPU_ENV=gcc3 -DLINUX -DUNX
_______________________________________________
LibreOffice mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/libreoffice
Rodnyansky Pavel Rodnyansky Pavel
Reply | Threaded
Open this post in threaded view
|

Re: Need help with installing/setting SDK on Linux


sberg wrote
Unfortunately it's not enough to run from within a setsdkenv_unix shell,
you also need to set up some C++ compiler command line arguments.
Modelling your makefiles after the sdk's example/ makefiles (which
include the SDK's settings/*.mk) would give you that, but you should
also be able to get it working with a plain, handcrafted makefile.  LO's
git sources contain ure/source/uretest/Makefile.pln as an example of
doing that.  What's probably missing for you is defines

   -DCPPU_ENV=gcc3 -DLINUX -DUNX
Adding  -DCPPU_ENV=gcc3 -DLINUX -DUNX  to DEFINES actually helped to get rid of "unknown platform" error. All other mistakes were because i accidently forgot to remove  a specific definition while porting from windows platform. After that i struggled for a bit with linker errors and finally was able to compile and launch my project. Thank you very much for a good answer, really saved me a lot of time. I would probably never figured it out by myself.