gcc and process.h

This is a discussion on gcc and process.h within the C Programming forums, part of the General Programming Boards category; I'm trying to pause the program, before it clears the screen. The gcc compiler does not like this. Code: for(x=0;x<1000000;x++) ...

  1. #1
    essence of digital xddxogm3's Avatar
    Join Date
    Sep 2003
    Posts
    589

    Question gcc and process.h

    I'm trying to pause the program, before it clears the screen.
    The gcc compiler does not like this.

    Code:
    for(x=0;x<1000000;x++)
          ;
    system("cls")
    how do you get gcc to recognize the process.h header?
    below is my error
    project1B.c:9:21: process.h: No such file or directory
    "Hence to fight and conquer in all your battles is not supreme excellence;
    supreme excellence consists in breaking the enemy's resistance without fighting."
    Art of War Sun Tzu

  2. #2
    Welcome to the real world
    Join Date
    Feb 2004
    Posts
    50
    Please post your code as to how you are includint the header.

    It should be:

    #include <process.h>

    you might be doing something else maybe?

  3. #3
    essence of digital xddxogm3's Avatar
    Join Date
    Sep 2003
    Posts
    589
    here is my other post on my broke program.
    errored program
    my code is attached
    I did include <process.h>, but it didn't auto load the header.
    I know the math header needs to be loaded with a switch like
    gcc -lm somefile.c
    I'm just wondering with the library switch (if any) is used for the process.h
    Attached Files Attached Files
    Last edited by xviddivxoggmp3; 03-16-2004 at 09:06 PM.
    "Hence to fight and conquer in all your battles is not supreme excellence;
    supreme excellence consists in breaking the enemy's resistance without fighting."
    Art of War Sun Tzu

  4. #4
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,592
    Because system() is in stdlib.h, not process.h
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  5. #5
    essence of digital xddxogm3's Avatar
    Join Date
    Sep 2003
    Posts
    589

    Question system("cls")

    Code:
    system("cls")
    is this a dos specific command?
    what do we use in linux?
    "Hence to fight and conquer in all your battles is not supreme excellence;
    supreme excellence consists in breaking the enemy's resistance without fighting."
    Art of War Sun Tzu

  6. #6
    Obsessed with C chrismiceli's Avatar
    Join Date
    Jan 2003
    Posts
    501
    It is dos specific, in linux, the command is system("clear");
    Help populate a c/c++ help irc channel
    server: irc://irc.efnet.net
    channel: #c

  7. #7
    essence of digital xddxogm3's Avatar
    Join Date
    Sep 2003
    Posts
    589
    it works now.
    thanks.
    i tried the system clear in my program earlier, but it didn't work.
    i guess since i tried it last i fixed something.
    hehehehehe

    [edit1]
    why does the system("clear"); only move the screen up so many lines, but doesn't actually clear it?
    [/edit1]
    Last edited by xviddivxoggmp3; 03-18-2004 at 12:15 PM.
    "Hence to fight and conquer in all your battles is not supreme excellence;
    supreme excellence consists in breaking the enemy's resistance without fighting."
    Art of War Sun Tzu

  8. #8
    Obsessed with C chrismiceli's Avatar
    Join Date
    Jan 2003
    Posts
    501
    According to the clear man pages
    DESCRIPTION
    clear clears your screen if this is possible. It looks in the environ-
    ment for the terminal type and then in the terminfo database to figure
    out how to clear the screen.
    I guess if it can clear it the real way it would, but if not, just put a few blank lines on the screen
    Help populate a c/c++ help irc channel
    server: irc://irc.efnet.net
    channel: #c

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Process.h
    By Sebastiani in forum C Programming
    Replies: 2
    Last Post: 04-18-2002, 07:28 PM
  2. Process.h ???
    By carnt in forum C Programming
    Replies: 4
    Last Post: 03-07-2002, 02:05 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21