cm3 / screenshot-cmd

Automatically exported from code.google.com/p/screenshot-cmd

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[patch] Make screenshot.cpp can be compiled with MinGW-w64

GoogleCodeExporter opened this issue · comments

Currently, the screenshot.cpp in trunk is designed to be built with 32 bit 
Visual C++. The attached patch makes the code compatible with MinGW-w64 under 
both 32 bit and 64 bit environment.

I had built the code with MinGW-w64 under 64 bit Ubuntu Linux 12.04  
environment, and tested the executable with 32 bit Windows 7, 32 bit WINE, and 
64 bit WINE. Since I don't have Visual Studio available for testing, I am not 
sure about whether the patch breaks the code with Visual C++ or not -- although 
I tried to be very careful not to break anything that was working fine before.

To compile the code with MinGW-w64 for 32 bit environment, issue the following 
command:

  i686-w64-mingw32-g++ -Wall -O3 -static -o screenshot.exe screenshot.cpp -luser32 -lgdi32 -lgdiplus

For 64 bit environment, use the following command instead:

  x86_64-w64-mingw32-g++ -Wall -O3 -static -o screenshot.exe -DX86_64 screenshot.cpp -luser32 -lgdi32 -lgdiplus

Because there is no standard-conformable and portable way for determining the 
environment at compiling time, I leave the burden of declaring X86_64 macro to 
the builder.

Original issue reported on code.google.com by storm.sf...@gmail.com on 5 Nov 2013 at 8:17

Attachments: