C shell development - Using windows.h on linux?

Hey folks!
I just need to write tiny little shell so I chose C & libssh, target windows os, preferably doing it from linux because windows is a crappy pile of ****, even their flagship VS doesnt fully support C99 and libssh uses things like threading from C11. Im not pro with C and I cant find any intel about using windows.h on linux, and it can be very difficult cause these header files contains very specific code for windows . I need here some hint on simply how should I approach this task. To be a bit more precise - I will be ok with code itself since the most of it is in libssh modules already, I just need a way to get one stable env where I can include libssh and some windows headers without any errors, already tried doing it on win with vcpkg and /VS/CLion/cmake/mingw and its all sucks with C there, 1000 errors before you even begin and 0 up to date documentation and support.

Have you tried using MinGW (on Windows or Linux) to compile?

Yeah I have tried so many things this entire night to make this work and still got nothing, mingw says it cant find my installed libssh.h and msys2 is even funnier with :

The C compiler


is not able to compile a simple test program.

It fails with the following output:
Change Dir: C:/Users/username/CLionProjects/libssh_w64/cmake-build-debug/CMakeFiles/CMakeTmp

Run Build Command(s):C:/msys64/mingw64/bin/g++.exe cmTC_50535/fast 
g++.exe: error: cmTC_50535/fast: No such file or directory
g++.exe: fatal error: no input files
compilation terminated.

And I was simply following the official CLion howto on msys2 :rofl:

Have you specified the location of your libssh files?

Yeah but I fkd up something else here, got too much garbage in path and all in wrong order, cleaning up my path vars helped and now probably some things like git wont work but at least gcc from msys2 finally works as it was supposed to. Goddamn it really took me all night and I was 100% positive on trying to use this header from linux instead, one cant simply stop loving windows. Cheers!

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.