getlogin_r and getutxent equivalent in mingw for windows - windows

I am porting my old code from *ix to Windows (on mingw).
A part of the old code contains functionality which gets information about users who logged in from the terminal - using getlogin_r and getutxent functions provided at *ix.
I am not able to find equivalent in MINGW.
Can somebody please help me to find the equivalent in Mingw for windows programming?

Take a look at gnulib, it supports MinGW too (but not all modules are available there).
getutxent: not available on MinGW
("This function is missing on some platforms: Mac OS X 10.3, FreeBSD 6.0, OpenBSD 3.8, Minix 3.1.8, mingw, MSVC 9, BeOS.")
getlogin_r: available on MinGW
("Portability problems fixed by Gnulib: This function is missing on some platforms: NetBSD 3.0, Minix 3.1.8, mingw, MSVC 9.")
As an alternative you can emulate them with Win API.
How to get the username in MinGW?
LoadUserProfile function / PROFILEINFO structure
NetUserGetLocalGroups function
Windows Shell documentation

Related

Graphic Interface not available when running simulation

I'm getting this error when running the configure file:
configure: error: Cannot build Qt apps, probably due to missing or too
old Qt packages. Make sure Qt development packages are installed and
newer than Qt 5.4. You can disable Qtenv by setting the WITH_QTENV
variable to "no" in configure.user
I've installed Qt5 and also added the path to the paths file.
My Qt version is 5.15.0 and my MacOS is Catalina (10.15.5 (19F101)).
Probably qmake is not able to build the Qt interfaces but I couldn't make it do it.
I think you're misunderstanding for OS support bit. macOS (After High Sierra version) is only use 64bit (x86_64). If you want to know your macOS support bit information, you can execute "uname -a" command in terminal.
i386: 32bit
x86_64: 64bit
I hope this has been useful. :D
It seems that my OS version is 32 bits and Qt5 is 64 bits. Since some of the binaries come in the 64 bits flavor, I was not able to use it with omnet++ 5.6.
I installed omnet++ version 5.0, but the program wouldn't run.
So I went back to omnet++ 5.6 and instead of using Qt, I compiled with tcl/tk and that worked for me.

Compile with gcc on Macos 10.14.5 that will support earlier versions of Mac

I have a c ++ code that I wrote that uses almost nothing, which is not the language itself (except using osascript).
After compiling it on my operating system version (10.14.5) with the following flags:
D_DEBUG, Os, Wall, Wextra
I found that it was not running on older operating systems (in 10.13 for example - it raises an error that it can only run on 10.14 or later)
What are the right flags to use to tell GCC, that I want to support as many MacOs versions as possible?
You will need a versioning flag: -mmacosx-version-min=10.9
And let the compiler know where the SDK is: -isysroot= =/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.9.sdk
The older SDKs are available in older xcode bundles, or via https://github.com/phracker/MacOSX-SDKs/releases. You need to decompress the SDK and place the folder inside the xcode bundle, as shown in the sysroot flag above.
Apple sayeth: You must target your compile for the oldest version of OS X on which you want to run the executable. In addition, you should install and use the cross-development SDK for that version of OS X. For more information, see SDK Compatibility Guide

Python 3.5 64bit on Windows 8.1 64bit, The only way to install TensorFlow binaries on Windows does not work

Is it possible to install Python 3.5.x on Windows 8.1?
The primary goal is to install TensorFlow directly on my Windows.
It is not working. More specifically when using a 64 bit windows, and naturally trying the 64bits Python. The AMD name in the installation file is confusing, since my laptop is an Intel. But that is the only 64 bit option so I select that.
I try to set up via binaries. In the middle of installation a GUI tells me installation failed:
BTW, I have done my best to remove any remaining Python 32 bits from my system.
Gooogling "python supported windows versions" brings up Using Python on Windows — Python 3.5.3 documentation1:
3.1.1. Supported Versions
As specified in PEP 11, a Python release only supports a Windows
platform while Microsoft considers the platform under extended
support. This means that Python 3.5 supports Windows Vista and newer.
If you require Windows XP support then please install Python 3.4.
1Or rather, https://docs.python.org/3/using/windows.html from which you can switch to the 3.5's version of the article with the drop-down list in the upper-left corner
After running windows update, I finally managed to install python 3.5 64 bits and then tensorflow on my windows 8.1.

What is an "X11 platform" and can it run on windows?

I'm trying to get GtkPlug and GtkSocket to work on Windows 8, using the currently supported GTK3+ windows bundle.
I see in the documentation this note:
The GtkPlug and GtkSocket widgets are only available when GTK+ is
compiled for the X11 platform and GDK_WINDOWING_X11 is defined. They
can only be used on a GdkX11Display. To use GtkPlug and GtkSocket, you
need to include the gtk/gtkx.h header.
What is an X11 platform, and can it be run on windows?
X11 is the graphics platform used by Linux and other Unix-style OSes. It is available for Windows through the Cygwin package but binaries compiled under Cygwin will not run on Windows without Cygwin installed so you probably don't want to go down that path. The documentation is essentially saying "this feature is only available on Linux."

Best Linux distro for cross-compiling to SUA

I'm very interested in using Linux / GCC for cross-compiling to Microsoft SUA (Subsystem for Unix Applications) format (I have SUA 6.1 as part of Windows 7, 64-bits). Using SUA to natively compile programs and their dependencies is a hassle given the general lacklustre support by MS, no real package manager, etc. What is the best way to do this using Linux? I am open to other approaches, but personally envision Linux as part of the solution. If there are better cross-compilers for the job I'd like to know- seems that I'd have to opt for an older distro (according to GNU webpage, SUA support ended with GCC 3.3)
Gentoo has a Prefix target for Interix. You can try this but I'm not sure if it's up-to-date. It is basically a Gentoo installation (with package manager) inside your Interix system.
The Prefix solution should be easier to maintain that cross-compiling.
You can use "mingw" as an alternative compiler for windows to compile Linux applications.

Resources