Advertisement
metalx1000

Cross compiling for Windows on Linux - Notes

Jul 20th, 2014
1,813
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1. ###########################Cross Compiling for Windows on Linux###############
  2.  
  3. #shell program for Linux
  4. gcc main.c -o main
  5.  
  6. #shell program for Windows -- search apt for mingw
  7. i586-mingw32msvc-gcc main.c -o main.exe
  8.  
  9. #GUI for Windows
  10. i586-mingw32msvc-gcc main_gui_win.c -o winhello.exe
  11.  
  12. #GUI for Windows no shell window
  13. i586-mingw32msvc-gcc main_gui_win.c -o winhello.exe -mwindows
  14.  
  15. #same can be done to main Shell programs run with out window
  16. i586-mingw32msvc-gcc main.c -o main.exe -mwindows
  17.  
  18. #Embeding Icon into exe for Windows
  19. echo "id ICON res/icon.ico" > main.rc
  20. i586-mingw32msvc-windres -o res/icon.o main.rc #create resouces object
  21. i586-mingw32msvc-gcc main_gui_win.c res/icon.o -o winhello.exe -mwindows
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement