How to make a program compile by Cygwin executable in Windows ?

Discussion in 'C Programming' started by Abby, Jul 1, 2003.

  1. Abby

    Abby Guest

    I'm now using Cygwin as my compiler for C code. I use Dev-c++ as my
    editor.
    The reason why I chose Cygwin compiler instead of the compiler that
    came with Dev-C++ is that I believe it uses the same environment as in
    Linux, so that I don't have to write different sourcecode for both OS.
    Eventhough, I don't understand about Linux much, and I'm still a
    beginner in programming, I still have to make my program compatible
    with both OS (Windows and Linux).

    The thing is, I couldn't run my program in other Windows PC. It will
    report that it need cygwin1.dll ... Anybody knows how to get through
    this problem? Please, please, please ... let me know. Thank you.
     
    Abby, Jul 1, 2003
    #1
    1. Advertising

  2. Abby

    Andy Zhang Guest

    "Abby" <> wrote in message
    news:...
    > I'm now using Cygwin as my compiler for C code. I use Dev-c++ as my
    > editor.
    > The reason why I chose Cygwin compiler instead of the compiler that
    > came with Dev-C++ is that I believe it uses the same environment as in
    > Linux, so that I don't have to write different sourcecode for both OS.
    > Eventhough, I don't understand about Linux much, and I'm still a
    > beginner in programming, I still have to make my program compatible
    > with both OS (Windows and Linux).
    >
    > The thing is, I couldn't run my program in other Windows PC. It will
    > report that it need cygwin1.dll ... Anybody knows how to get through
    > this problem? Please, please, please ... let me know. Thank you.


    Cygwin executables need the Cygwin library to, in a sense, convert unix
    system calls to win32 API calls. You need to recompile the program for
    Windows. Alternatively, you could distribute your program with the Cygwin
    DLL.

    --
    Andy Zhang
     
    Andy Zhang, Jul 1, 2003
    #2
    1. Advertising

  3. Abby

    Abby Guest

    "Andy Zhang" <> wrote in message news:<JDnMa.36670$>...
    > "Abby" <> wrote in message
    > news:...
    > > I'm now using Cygwin as my compiler for C code. I use Dev-c++ as my
    > > editor.
    > > The reason why I chose Cygwin compiler instead of the compiler that
    > > came with Dev-C++ is that I believe it uses the same environment as in
    > > Linux, so that I don't have to write different sourcecode for both OS.
    > > Eventhough, I don't understand about Linux much, and I'm still a
    > > beginner in programming, I still have to make my program compatible
    > > with both OS (Windows and Linux).
    > >
    > > The thing is, I couldn't run my program in other Windows PC. It will
    > > report that it need cygwin1.dll ... Anybody knows how to get through
    > > this problem? Please, please, please ... let me know. Thank you.

    >
    > Cygwin executables need the Cygwin library to, in a sense, convert unix
    > system calls to win32 API calls. You need to recompile the program for
    > Windows. Alternatively, you could distribute your program with the Cygwin
    > DLL.


    Can you tell me how to distribute my program with Cygwin DLL? Thank you.
     
    Abby, Jul 2, 2003
    #3
  4. Abby

    Tom St Denis Guest

    Re: How to make a program compile by Cygwin executable in Windows?

    Abby wrote:
    > "Andy Zhang" <> wrote in message news:<JDnMa.36670$>...
    >
    >>"Abby" <> wrote in message
    >>news:...
    >>
    >>>I'm now using Cygwin as my compiler for C code. I use Dev-c++ as my
    >>>editor.
    >>>The reason why I chose Cygwin compiler instead of the compiler that
    >>>came with Dev-C++ is that I believe it uses the same environment as in
    >>>Linux, so that I don't have to write different sourcecode for both OS.
    >>>Eventhough, I don't understand about Linux much, and I'm still a
    >>>beginner in programming, I still have to make my program compatible
    >>>with both OS (Windows and Linux).
    >>>
    >>>The thing is, I couldn't run my program in other Windows PC. It will
    >>>report that it need cygwin1.dll ... Anybody knows how to get through
    >>>this problem? Please, please, please ... let me know. Thank you.

    >>
    >>Cygwin executables need the Cygwin library to, in a sense, convert unix
    >>system calls to win32 API calls. You need to recompile the program for
    >>Windows. Alternatively, you could distribute your program with the Cygwin
    >>DLL.

    >
    >
    > Can you tell me how to distribute my program with Cygwin DLL? Thank you.


    Copy cygwin1.dll from the cygwin/bin dir. I dunno what the license is
    regarding that though.

    A good way to test if you have all the dlls you need is to set the path
    to empty, e.g.

    set PATH=

    then run you app. If the additional dlls are required and they are not
    in the dir where you run the app from windows will report an error.

    Alternatively, you could compile as "-mno-cygwin" or use mingw if you
    don't need the unix like behaviour.

    Tom
     
    Tom St Denis, Jul 2, 2003
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Suresh
    Replies:
    2
    Views:
    16,609
    Suresh
    Jun 1, 2006
  2. Ruslan Spivak
    Replies:
    0
    Views:
    413
    Ruslan Spivak
    Jul 15, 2003
  3. =?ISO-8859-1?Q?Gerhard_H=E4ring?=

    Re: how to compile python program to linux executable

    =?ISO-8859-1?Q?Gerhard_H=E4ring?=, Jul 15, 2003, in forum: Python
    Replies:
    0
    Views:
    504
    =?ISO-8859-1?Q?Gerhard_H=E4ring?=
    Jul 15, 2003
  4. sreekant
    Replies:
    0
    Views:
    410
    sreekant
    Jul 18, 2003
  5. Replies:
    0
    Views:
    471
Loading...

Share This Page