Dave
Dave

Reputation: 1659

Building a Windows Console App In Cygwin 1.7.16 Targeted to Cygwin 1.5.24

I have a Windows console app that is pure standard C++. I am building it in Cygwin 1.7.16 (running on Windows 7) for target Cygwin 1.5.24 (running on Windows XP SP 2).

My build command is: g++ -o mgen_stats.exe -I ../include ../src/*.cpp

On the target, my path includes /usr/bin, which is where cygwin1.dll lives.

When I run the application with no arguments on the target in a Cygwin 1.5.24 shell, I immediately get the command prompt back. I should see the application's usage printed out.

Some immutable constraints I'm working under:

I would be just as happy for my application to be a native Windows application (i.e. run it in a DOS shell rather than a Cygwin 1.5.24 shell). To this end, I tried using g++ build flag -mno-cygwin. g++ tells me that flag -mno-cygwin has been removed. It then suggests that I "use a mingw-targeted cross-compiler". I do not know how to tell if I have the mingw-gcc, mingw64-i686-gcc, and mingw64-x86_64-gcc packages (which, according to the Cygwin FAQ, contain the suggested cross-compilers), and if I do have them, I do not know what the names of the compiler executables are.

Can anybody help me get this app built such that it will run successfully under either a DOS or Cygwin 1.5.24 shell on my Windows XP SP 2 target?

Thank you in advance.

Upvotes: 1

Views: 453

Answers (1)

Rufflewind
Rufflewind

Reputation: 8956

The MinGW packages (like any other Cygwin package) can be installed on Cygwin using the "setup.exe" that Cygwin provides on its website. If you do have them installed, you'll find the compilers as i686-w64-mingw32-g++ or x86_64-w64-mingw32-g++.

Alternatively, you can also install the MinGW packages directly (without using Cygwin).

Upvotes: 1

Related Questions