Can I use cgo with Windows SDK? - go

I've just tried tdm-gcc and it works, but is it possible to use cgo with Windows SDK?

Yes, cgo is supported on Windows.
There are still some open issues you might want to take a look at, though. I believe there are also some fixes in place since go1, so you may need to work from closer to tip (I can't recall if they're in go1.0.3 or not).

Related

IDE use a VM compiler?

I'm starting to work on my master thesis at the moment and I have a (maybe) specific question...
I want to stay on windows OS and run a Linux VM via VirtualBox combined with Vagrant. No Problem. I like the feature to reset the VM via vagrant easily.
The next target is using features like auto-completing or similar while developing in C++. This would help me to work with unknown includes/libraries.
Is it possible to access the filesystem/compiler of the VM while using an IDE (like clion) installed on windows? Without explicit loading of the gui und running the IDE on it? Kinda like working with cygwin? I don't want to use cygwin because it doesn't support c++11 standard (or is there a way???)
Maybe you know an alternative way. I would be glad for all hints solving my problem.
I don't know much about cygwin, though I would be surprised if they cannot get recent versions of gcc. But for certain, you can use MSYS2 to get very recent versions of gcc and many other linux packages, which will support C++11.
It's a matter of opinion how best to do cross-platform development, but an alternative worth mentioning is to use cmake for your project. When you want to code in windows, it can make MSVC 2015 project files for you -- when you want to compile in linux, it can find the dependencies and generate a makefile for you to use. IIUC, cmake is the most widely used cross-platform build system right now, besides gnu make itself. (I'm pretty sure it's more popular than "autotools" nowadays, and its definitely more popular than scons.) The advantage is that you avoid the need to maintain multiple platform-specific project files that essentially say the same thing with different formatting.

Using windows.pas with Lazarus on OS X

I was wondering if it's possible somehow to use windows.pas on OS X with Lazarus?
I need to use special library in my project, and one of key-files uses windows.pas :( Any ideas?
Windows.pas only works on Windows. You will have to edit the library to put an IFDEF around it in the uses clause, and then provide alternatives for any functionality that is then broken. Or contact the library author and see if there is already a non-Windows version available.
You certainly cannot use Windows.pas under OSX. Because Windows.pas exposes the functionality of the Win32 library.
If you need to execute Win32 code on OSX pretty much your only option is Wine.
A more plausible solution is that you find an alternative to this "special" library to which you refer.
Windows.pas is mostly a wrapper around different DLLs contained in the Windows operating system. As it is unlikely that you will find those DLLs in OSX I guess you are out of luck.
You could check the library's source code and try to identify the constants, procedures and functions that are used in windows.pas. If it is not too much code you could try to modify the library so that it uses corresponding Carbon functions instead.
While the various answers are correct, and the vast bulk of unit windows is not portable, some functionality IS abstracted. Structures like interlockedincrement, Rect and ColorRef, and some message related functionality. Have a look at types and lcltype and the system unit interface of FPC.
A lot of Delphi code still uses Windows for that functionality, while e.g. unit types already exists since D6.
Some other things are abstracted, but not using the same (windows unit) calls. Better explain what exactly you need in a separate post.

Debugging Go (golang) code in Windows

What is the best method of debugging go code in Windows?
https://stackoverflow.com/a/5514122/201618 states the GBD cannot be used as
Windows and ARM binaries do not contain DWARF debugging information and, as such, cannot be inspected with GDB.
https://stackoverflow.com/a/3405768/201618 implies that the best thing to do is just use fmt.Println
Is there a better current option? Is there a better planned future option?
In addition to GDB you can use Zeus. Also, take a look to comparison of IDEs for Google Go.
LiteIDE (https://github.com/visualfc/liteide) includes a build of GDB that works on Windows. When I experimented with Goclipse, I was able to point it to that GDB executable and debug applications just fine.
Delve supports windows and can be installed with the following command:
go get github.com/derekparker/delve/cmd/dlv
It has integration with code editors and IDEs such as VS code, Atom and IDEA. No Sublime Text support is available yet though!

Is there an open source equivalent of Linux' /lib/ld-linux.so for Windows?

Is there an open source program for Windows that offers the same functionality as Linux' /lib/ld‑linux.so.2?
You might want to look at the ReactOS project.
They should have everything to load DLLs, and it is open-source.
The loader is a core part of the OS on Windows; there's no open-source alternative I'm aware of, and I'm not sure it'd be possible to do it correctly in any case - you have to handle the minefield of assumptions that kernel32/ntdll have regarding address space layout, support SxS, ASLR, hotpatching, and more.
Open-source linkers are common (e.g., gnu tools), but I gather that's not what you're after.
The Enhanced Dynamic Linking Library for MinGW under MS-Windows may be helpful. Take a look especially at the bottom for the edll solution.
You mean using dynamic libraries? In Windows that's automatic when you use LoadLibrary on a .DLL.

Windows demangling library

I'm looking for an open source library to do Windows executable symbol name demangling. Does such a thing exist or must I use the Microsoft libraries?
Uow, this guy seems to have nailed it.
Not a library as such, but I'd look at Wine, specifically the debugger. I'm not sure but seems like a likely place to find code for that.
I agree that DbgHelp.dll should be the way to approach this.

Resources