locked
<stdlib.h> problem RRS feed

  • Question

  • Hi all.

    My problem is this...

    I am using Visual Studio.net 2003. Im creating a program that uses a dynamic array of structures. but when i include the header file <stdlib.h>, i get the following error:

    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\include\stdlib.h(256) : error C2381: 'exit' : redefinition; __declspec(noreturn) differs
    c:\Program Files\Microsoft Visual Studio .NET 2003\Vc7\PlatformSDK\Include\gl\glut.h(146) : see declaration of 'exit'
    c:\Documents and Settings\Daniel Travers\Desktop\latesttest\latesttestsrc.cpp(301) : error C3861: 'exit': identifier not found, even with argument-dependent lookup


    any ideas?

    thanks in advance for your replies.
    Thursday, January 26, 2006 6:41 PM

Answers

  • You have two difinitions of exit. You need to use only one of them. To know exactly where you are definning exit, use the /P compiler option to generate a preprocessed version of the file in question.

    Thanks,
    Ayman Shoukry
    VC++ Team
    Thursday, January 26, 2006 6:54 PM

All replies

  • You have two difinitions of exit. You need to use only one of them. To know exactly where you are definning exit, use the /P compiler option to generate a preprocessed version of the file in question.

    Thanks,
    Ayman Shoukry
    VC++ Team
    Thursday, January 26, 2006 6:54 PM
  • hi, thanks for your reply. i am using ms visual studio.net 2003 and am relatively new to its environment. could you explain the steps i need to carry out in detail please?

    thanks again in advance. i really appreciate it.
    Thursday, January 26, 2006 7:11 PM