Thread: system calls with cygwin

  1. #1
    Registered User
    Join Date
    Jul 2010

    system calls with cygwin

    I'm having some difficulty with the use of system calls.

    I cannot get any system calls to work on any other machine besides my development workstation.

    All the machines that I have tried this on are running windows XP.

    I thought it was a cygwin dll dependency but I literally copied the entire contents of the cygwing\bin directory into the into the directory with this program and nothing...

    int main(int argc, char** argv) 
        int error;
        error =  system( "notepad.exe" );
        printf( "ERROR: %d \n", error);
        return (EXIT_SUCCESS);

    This program shows the system call having an error 127 every time on any other system but mine.

    Any Ideas?

  2. #2
    Registered User
    Join Date
    Jul 2010


    It seems that the original cygwin1.dll from my development machine makes the system call fail. If I install cygwin locally then use the dll from that install the system calls work.

    Does cygwin build customs dlls for every installation?

  3. #3
    Registered User hk_mp5kpdw's Avatar
    Join Date
    Jan 2002
    Northern Virginia/Washington DC Metropolitan Area
    Is it possible to build a statically linked version? That would eliminate the need for each target machine to possess the necessary dlls for the program to run.
    "Owners of dogs will have noticed that, if you provide them with food and water and shelter and affection, they will think you are god. Whereas owners of cats are compelled to realize that, if you provide them with food and water and shelter and affection, they draw the conclusion that they are gods."
    -Christopher Hitchens

  4. #4
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    1) Cygwin does no such thing.
    2) It's not the system call that fails. Your program doesn't even launch.
    3) You cannot compile cygwin programs statically. cygwin1.dll must be a dynamic library because of the way Cygwin works.
    4) I suspect that you did something wrong in copying your cygwin1.dll to the other systems.
    All the buzzt!

    "There is not now, nor has there ever been, nor will there ever be, any programming language in which it is the least bit difficult to write bad code."
    - Flon's Law

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to model a system?
    By ovid in forum C++ Programming
    Replies: 1
    Last Post: 03-05-2010, 09:18 AM
  2. System calls
    By Sn0wcra5h in forum C Programming
    Replies: 10
    Last Post: 02-19-2010, 05:12 AM
  3. System calls (open, close, write)
    By ollie88r in forum C Programming
    Replies: 7
    Last Post: 11-09-2009, 06:16 PM
  4. write and read system calls
    By nacho4d in forum C Programming
    Replies: 4
    Last Post: 01-28-2008, 10:59 AM
  5. System Calls && Variables
    By Okiesmokie in forum C++ Programming
    Replies: 6
    Last Post: 03-06-2002, 09:10 PM