How do I run a program compiled in cygwin from a program that is running in a Windows CMD shell?

Ted Byers
Thu Sep 15 17:46:00 GMT 2011

LMH <lmh_users-groups <at>> writes:
> I am a bit confused as to the role of perl here.


I have an installation of Apache's httpd server; directly from the Apache 
website, not the one available through cygwin (in fact, there'd be no point 
since that apache install is on a different machine).  And I run a number of 
cgi programs written in perl.  That is one role for perl in this setup.  

The other for perl is for my I have a stripped down, basic HTTP Server written 
in perl.  I know, I can probably develop the same thing using boost's asio 
library, but in this case, perl and the http server package are so simple to 
use, I opted for it.  But I developed it using Activestate's Perl 
distribution.  In fact, though I know perl is installed in in my cygwin 
environment, I never bothered with it because Activestate's perl package 
manager has made it so simple to install the hundreds of perl packages that I 
use.  I shudder at the thought of trying to install the same suite of packages 
using cpan from the bash commandline.

> I have compiled under 
> cygwin g++ for a long time now and don't run into problems. Are you 
> using the -mno-cygwin flag in your compile rules? I have two processes, 
> where one is a child of the the processed that gets launched, but both 
> are in c. Maybe it is better to address your issue in the c part of the 
> application, possibly create a little c launcher app that will create 
> the behavior you need.
What, exactly, does '-mno-cygwin' do?

BTW: With gcc v 4.5.3, using 'G++ -mno-cygwin' followed by the other 
commandline arguements needed to compile something results in an error where 
it complains '-mno-cygwin' is no longer valid (I forget the exact wording, but 
that is the gist of the error message I got).

I tried something like:

g++ -mno-cygwin -o qlt.exe -I/usr/local/include qlt.cpp -quantlib -

But that resulted in the error I describe just above.  I probably did 
something wrong with this if tht flag is still available in gcc v 4.5.3, but 
then the only place I found anything related to that flag with in a couple 
posts in newsgroups where the OP was dealing with similar issues, but I 
haven't fund the documentation for it.

I have a number of C++ programs that use QuantLib (a C++ quantitative finance 

> Whether you run your c widget from win cmd, bash, call if from perl 
> python, etc, shouldn't really make any difference.
That, actually, is what I am trying to learn.  I now know that etc/profile is 
the file that changes the path to include cygwin/bin, but I couldn't figure 
out how to use bash to launch my program so that is knows about that change 
(i.e. so the child program sees an environment that it would see if executed 
within a bash session I'd launched.  But if the program can be compiled so 
that it doesn't need that modified environment, so much the better.

Thanks again,


Problem reports:
Unsubscribe info:

More information about the Cygwin mailing list