execlp function / digital mars compiler

This is a discussion on execlp function / digital mars compiler within the C++ Programming forums, part of the General Programming Boards category; Hey there. I am trying to get the following code to execute another file. This code is for showing a ...

  1. #1
    Registered User
    Join Date
    Aug 2009
    Posts
    3

    Question execlp function / digital mars compiler

    Hey there.

    I am trying to get the following code to execute another file. This code is for showing a software license. The license is divided into several files that are to be shown on the screen one after another. At the end, when everything is said and done, the user is suppose to be able to agree and confirm. After the final confirmation the function known as 'execlp' should be run. I am using Digital Mars to do this and it gives me the error of having an undeclared identifier.

    The code below is suppose to be standard and for some
    reason it will not work in Digital Mars and I am using it in a switch case menu. Please download the attachment to see the whole program.

    Help. Thanks.

    Claydan7



    int execlp(
    const char *testing,
    const char *arg0,
    const char *arg1,
    NULL);
    Attached Files Attached Files

  2. #2
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    execlp is in the posix standard, not the C standard. If you are not on an OS that supports the posix standard (hint: DOS is not such an OS), then execlp is not available.

  3. #3
    Jack of many languages Dino's Avatar
    Join Date
    Nov 2007
    Location
    Katy, Texas
    Posts
    2,309
    I'm lazy. Can you post the error you are getting?
    Mac and Windows cross platform programmer. Ruby lover.

    Quote of the Day
    12/20: Mario F.:I never was, am not, and never will be, one to shut up in the face of something I think is fundamentally wrong.

    Amen brother!

  4. #4
    Registered User
    Join Date
    Aug 2009
    Posts
    3

    Cool Tabstop and Dino

    Tabstop,

    I hear you. I read up on some stuff and I saw information about POSIX and so on and in a traditional sense you're right. However, execlp is in some things that I have found which have absolutely nothing to do with POSIX. Thank you for taking time to respond. I said all that to say, execlp is usable even in MS Visual Studio C++. I have discovered that all operating systems support execlp. Beyond that, I actually found my problem. Before I used Digital Mars, I used a shorthand line of code for that function in MS Visual Studio and it was the following: " execlp("testing",NULL); ". That line successfully executed another executable file known as " testing.exe ". Man, you would never guess what I was missing to create the same effect in Digital Mars Compiler. Are you ready.....
    I was missing an underscore!!!!

    Now the same line reads: " _execlp("testing",NULL); ".


    Dino, don't worry about it, I got it bro. I thought what you said was funny though. I got a kick out it. I can just imagine facial expressions accompanying it.

    Thanks guys.


    Claydan7

  5. #5
    and the Hat of Guessing tabstop's Avatar
    Join Date
    Nov 2007
    Posts
    14,185
    Quote Originally Posted by claydan7 View Post
    Tabstop,

    I hear you. I read up on some stuff and I saw information about POSIX and so on and in a traditional sense you're right. However, execlp is in some things that I have found which have absolutely nothing to do with POSIX. Thank you for taking time to respond. I said all that to say, execlp is usable even in MS Visual Studio C++. I have discovered that all operating systems support execlp. Beyond that, I actually found my problem. Before I used Digital Mars, I used a shorthand line of code for that function in MS Visual Studio and it was the following: " execlp("testing",NULL); ". That line successfully executed another executable file known as " testing.exe ". Man, you would never guess what I was missing to create the same effect in Digital Mars Compiler. Are you ready.....
    I was missing an underscore!!!!

    Now the same line reads: " _execlp("testing",NULL); ".
    Hey you're right. For some reason I thought the MSCRT was missing the whole exec familly; I guess they're just missing fork, then?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Undefined Reference Compiling Error
    By AlakaAlaki in forum C++ Programming
    Replies: 1
    Last Post: 06-27-2008, 12:45 PM
  2. dmc (digital mars compiler)
    By NeonBlack in forum C++ Programming
    Replies: 7
    Last Post: 12-01-2007, 03:04 PM
  3. Replies: 28
    Last Post: 07-17-2006, 12:35 AM
  4. Replies: 5
    Last Post: 02-08-2003, 07:42 PM
  5. Anyone reccomend Digital Mars compiler?
    By joshuaman in forum C++ Programming
    Replies: 7
    Last Post: 06-20-2002, 12:22 AM

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