Back to Threads
Avatar
Jan 23

Your Go CGO Project BROKE? (macOS "windows.h" Solution Inside!) - OpenSIPS Trunking Solutions

Overview

I'm not very familiar with mac os x, but on arch linux all i had.

Your Go CGO Project BROKE? (macOS "windows.h" Solution Inside!) - OpenSIPS Trunking Solutions

Some dll is possibly failing to load. Read also: This Simple Trick Stops Sour Noodle Leaks—Guaranteed!

Your Go CGO Project BROKE? (macOS "windows.h" Solution Inside!) - OpenSIPS Trunking Solutions

The request/proposal via this github issue is to ask for testing golang versions with mingws on ws 2019 as it does not exist today. Read also: Unidentified Ginger Leak: Prepare For A Mind-Blowing Revelation

Your Go CGO Project BROKE? (macOS "windows.h" Solution Inside!) - OpenSIPS Trunking Solutions

Sqlite3 macwindows google fatal error:

Your Go CGO Project BROKE? (macOS "windows.h" Solution Inside!) - OpenSIPS Trunking Solutions

'windows. h' file not found.

You are trying to use the ms platform sdk (psdk) with the gcc compiler.

Gcc (mingw) ships with it's own win api implementation.

Use that and remove.

Basically, a dll is built with go, which is filling a output buffer.

Dll is loaded by c++ code.

On windows 10 it crashes and on ubuntu 20. 04 it follows the course.

The go portion of code also.

That means, any program that uses cgo libraries like sqlite3 will.

You first have to find and install a c/c++ cross compiler that targets windows.

Then set the cc/cxx enviromental variables to point to the correct compiler.

Link, typically invoked as go tool link, reads the go archive or object for a package main, along with its dependencies, and combines them into an executable binary.