Precompiled headers in node-gyp (linux) - g++

Looking for information about precompiled headers, I found this post for windows, this for xcode. But I didn't find an example for linux.
How can I make use of precompiled headers for compilation speedup?

Related

Kotlin Native libcurl example on Windows

I'm trying to learn how Kotlin Native works with this tutorial from JetBrains: https://kotlinlang.org/docs/tutorials/native/interop-with-c.html
But these tutorials are only fro macOS and Linux. Sometimes i use a windows computer and i want to know how it works there.
How can i add the libcurl library in windows and how can i add it to the libcurl.def file?
It isn't explained anywhere.
You need to install MSYS2, then in MSYS2 console install libcurl:
$ pacman -S mingw-w64-x86_64-curl
See https://github.com/JetBrains/kotlin-native/pull/1499
A more detailed step-by-step explanation on how to use dynamically built libcurl (aka DLL) with Kotlin/Native.
https://jonnyzzz.com/blog/2018/10/29/kn-libcurl-windows/
I do not think it is covered somewhere right now. The idea is still the same, and you should be able to make it work. The first step is to download and build libcurl locally from https://curl.haxx.se/libcurl/. There are instructions and documentation on how to build it. I do recommend to pick the Windows own implementation for SSL.
Once you are done with building you will have both the includes and the library. Note, on Windows, you will always have a static library. Even if you build curl as a dynamic library (DLL), you will have a generated static library that you use for linking. DLL is easier to build and use. A true static library is better because you will have no dependencies in your Kotlin/Native program binary. At that point, the tutorial instructions should work.
For Windows, if you need only basic HTTP communication, you can also try WinINet API which is a part of Windows and so no dependency is necessary. No hassle with the libcurl library.
See my example of how to use WinInet API with Kotlin MPP: https://github.com/localazy/kotlin-mpp-wininet
For macOS and Linux, instead of going through the hassle with libcurl manually, just use ktor clients: https://ktor.io/clients/index.html
I'm studying Kotlin too and it took many hours until I realize how to handle def file, includes and static library.
I made an example of how to use static library (curl with gzip and SSL support compiled with mingw) on kotlin-native. This way you dont need to dll files to be supplied with your app
https://github.com/carlosrafp/Libcurl-Kotlin-Native-standalone
On libcurl.def file you can see:
headers = curl/curl.h // path to curl header
libraryPaths = src/nativeInterop/cinterop // path to your static library
staticLibraries = libcurl.a // the static library
linkerOpts.mingw = -lws2_32 -lwldap32 // linking dependences
I based on the nice post of jonnyzzz:
https://jonnyzzz.com/blog/2018/10/29/kn-libcurl-windows/

Undefined symbols for architecture x86_64 for mac

I used podofo library for mac application development, while building demo app i am getting following errors.
The error messages seem to indicate that you are working with static libraries (.a libraires). So, when building your demo app, you need to link with all the librairies needed, including the ones needed by freetype and fontconfig. These are bz2, z, crypto (from the openssl distribution) and others...
If Podofo is built with cmake, you can look at the CMakeCache.txt file. It contains the path where each library Podofo depends on was found on your system.
The bz2 library is not listed in the CMakeCache.txt. It is there by default, so you may just add
-lbz2
to the "Other Linker Flags" in your Xcode project build settings.

how to use sqlite3 in Xcode 5.1.1?

how can I utilise the sqlite3.h from sqlite.org in my programs written in xCode 5.1.1?
One of the ways I was thinking was to download the precompiled binaries for Max OSX, http://www.sqlite.org, and then link them somehow to my files in my xCode-project.
How can I link these binaries to my project or xCode so that I can call upon the different sqlite3-functions?
Any help is much appreciated. I have OSX version 10.9.4.
The recommended way to use SQLite is to compile it statically into your program, i.e., just add the sqlite3.c file to your other source files.

How can i use libshout library for os x project in XCode

there is library called libshout which provides functionality for connecting to icecast server. Could anyone tell how to include it to xcode project for os x application? Or how to compile it and include to the project.
Thank you for any help.
The answer is, that it is possible to install libshout by homebrew for example, then it will be in /usr/local/Cellar/ along with other libraries it needs: libogg, libvorbis, speex, theora. Then you can add all those libraries to xcode project (.h and .a fies or all files..) with libshout, then just include shout.h header to you source file and you can use it.

How to build gstreamer-sharp with monodevelop/xamarin?

i'm developer of AudioCuesheetEditor, an application for editing audio cuesheets. The new Version should be able to play back sound, so I would like to use gstreamer as backend. I investigated a bit in gstreamer and found out, that I need to use version 1.x with gstreamer-sharp 0.99.x binding. No problem, downloaded gstreamer-sharp 0.99.0, opened the solution with monodevelop (on linux) or xamarin (on windows) and tried to build the dll, but that didn't work. I get the error "namespace Gst.GLib" not found.
I'm developing with xamarin/monodevelop and need to have a portable app (working with mono/.net).
Can anyone help me, get gstreamer-sharp build?
Thanks in advance!
gstreamer-sharp is currently not supported on Windows, however you can compile the managed parts on linux and compile the glue on Windows using Visual Studio:
Install gtk-sharp 3.0 from https://github.com/mono/gtk-sharp
Compile gstreamer-sharp using ./autogen.sh && make
Take the compiled glib-sharp and gstreamer-sharp binary and all .c files from sources/glue/
Download and install gstreamer binaries from http://gstreamer.freedesktop.org/data/pkg/windows/1.2.2/ and install the development and binary packages for the architecture you want to compile for. You can use gstreamer 1.0 or 1.2.
Use the Visual Studio template from the gstreamer-devel package and change the project type to library. Add the c files taken from the sources/glue folder and compile the glue library. The library should be called libgstreamersharpglue-1.0.0.dll
Put the managed parts together with the native symbols.
EDIT:
Compiling the glue is now easier on Windows! Someone set up a project which can compile the glue using Visual Studio on Windows. I have a fork which has binaries at https://github.com/xDarkice/libgstreamersharpglue
gstreamer-sharp uses autotools for its build system, you cannot build it with an IDE. Please do the autotools dance:
./autogen.sh --prefix=/the/prefix/where/you/want/to/install
make
sudo make install