wildskyf / car_racing

NTNU_CSIE_Final_Project
MIT License
1 stars 0 forks source link

Windows Only #1

Open wildskyf opened 9 years ago

wildskyf commented 9 years ago
wlogsky666 commented 9 years ago

結果你的也是有windows.h啊哈哈XD

wildskyf commented 9 years ago

對啊 之後要來改掉XDD 不然我現在也編不起來~~~

wlogsky666 commented 9 years ago

不過 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

wildskyf commented 9 years ago

頭痛啊XDDD gotoxy 應該是還可以解決,但還是很麻煩啊…

wlogsky666 commented 9 years ago

請愛用Windows(誤 反正Win10快出了你可以去試玩看看XD

wildskyf commented 9 years ago

windows 一直雷我,我討厭他~~~~

不過 Win10 倒是會裝在虛擬機玩玩看XD

wildskyf commented 9 years ago

ref to ss840429/Tetris_Battle_V2