how to use <Windows.h> c++

maromaro

New Member
Joined
Mar 31, 2020
Messages
4
Reaction score
3
Credits
0
Hello can someone help me please, i wrote some code in my win10 machine including Windows.h (API) an i did use some functions from it, but now i want to compile it in my Linux machine, But i don't know how, i tried using winegcc but i don't know what i need or what flags to use and the compiler can't find the Windows header file.
 


Steps to Use :
1. sudo apt-get install g++-mingw-w64 (for minGW)
2. Then copy libgcc_s_sjlj-1.dll (To the project Dir)
in my case : cp /usr/lib/gcc/i686-w64-mingw32/7.3-win32/libgcc_s_sjlj-1.dll .
-Then copy libstdc++-6.dll (To the project Dir)
in my case : cp /usr/lib/gcc/i686-w64-mingw32/7.3-win32/libstdc++-6.dll .
3.Download w32api zip from te web site then unzip it in the working Dir.
4. COMPILE!!!!
ex : /usr/bin/i686-w64-mingw32-g++ -I w32api/include/ -L w32api/lib/ main.cpp
 
So it works, correct? And produces a compiled object that is a Windows-like thing, except that it's Linux, also correct?
 
Steps to Use :
1. sudo apt-get install g++-mingw-w64 (for minGW)
2. Then copy libgcc_s_sjlj-1.dll (To the project Dir)
in my case : cp /usr/lib/gcc/i686-w64-mingw32/7.3-win32/libgcc_s_sjlj-1.dll .
-Then copy libstdc++-6.dll (To the project Dir)
in my case : cp /usr/lib/gcc/i686-w64-mingw32/7.3-win32/libstdc++-6.dll .
3.Download w32api zip from te web site then unzip it in the working Dir.
4. COMPILE!!!!
ex : /usr/bin/i686-w64-mingw32-g++ -I w32api/include/ -L w32api/lib/ main.cpp
thank you very much mr. maromaro .
i got new version of mingw and change that path to - cp /usr/lib/gcc/i686-w64-mingw32/12-win32/libstdc++-6.dll
and i got w32api file from - https://cdimage.debian.org/mirror/cygwin/x86_64/release/w32api-runtime/
w32api-runtime-11.0.1-1.tar.xz

i am extract these tar files on my project files in debian 12. "Home/My projects" folder
and go to - "My projects/w32api-runtime-11.0.1-1/usr/lib " and write that location my c++ programs
then it's work . before i haven't compile that c++ files from "vs code" editor now it's works.
 
Jeez.

Have I woken up in an alternate universe this morning.......where Linux.org has morphed into "Windows.org"? I'm sure things were normal when I turned in last night.....


Mike.
facepalm-small.gif
 
@ruwank
@MikeWalsh
You guys are replying to 4 years old thread lol.

But Windows.h is very useful header even under Linux, because it let's bad guys attack hostile OS bahahhah
 
Jeez.

Have I woken up in an alternate universe this morning.......where Linux.org has morphed into "Windows.org"? I'm sure things were normal when I turned in last night.....


Mike.
facepalm-small.gif

I often think that myself...when did Linux.org become a windoze Forum.
1716771142073.gif


Maybe it's because Linux.org is friendly and more helpful...might be time to switch to Linux and ditch windoze for good.
1716771586034.gif
 

Members online


Top