Open wildskyf opened 9 years ago
結果你的也是有windows.h啊哈哈XD
對啊 之後要來改掉XDD 不然我現在也編不起來~~~
不過 windows.h 在 unix 裡面好像也沒有東西可以取代 不過用MinGW在unix上編譯似乎就可以
Cross-compiling from linux, especially if you're using a debian based distribution like Ubuntu, is a piece of cake! You just need to install minGW first...
sudo apt-get install mingw32
Then write code like you normally would, using standard libraries only (iostream, vector, string, cstdio/lib, etc.) Compiling on linux is the same as it always is:
g++ -s -o output main.cpp
and then to produce a Windows executable...
i586-mingw32msvc-g++ -s -o output.exe main.cpp
Don't worry about trying to remember the minGW compiler's long name. Typing i5, then hitting tab, and then typing g++ will fill it out for you. Remember that only the standard libraries are portable. If you try to build something using unistd.h, or if you wanted to functionality only available from windows.h, you're out of luck.
Note that executables produced by minGW will be fairly large (about half a megabyte if you use the -s flag). This is because all of the libraries that might be dynamically linked when built with g++ or in visual studio, are built into the executable. This means that the .exe minGW builds will run on all Windows systems without other dependencies, where executables built by visual studio typically don't work correctly without installing a run time on the client's system.
嗯... 還是用 windows 寫就好了XD
頭痛啊XDDD gotoxy 應該是還可以解決,但還是很麻煩啊…
請愛用Windows(誤 反正Win10快出了你可以去試玩看看XD
windows 一直雷我,我討厭他~~~~
不過 Win10 倒是會裝在虛擬機玩玩看XD
ref to ss840429/Tetris_Battle_V2
<windows.h>
should be removedgotoxy
with the other way