Thread: Conio.h dun gone broked on me.

  1. #1
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079

    Conio.h dun gone broked on me.

    Anyone ever have a header all the sudden produce an error when you attempt to compile even though you never touched it? I swear, this program was compiling 40 minutes ago.

    Conio.h is giving me this compile error:

    Code:
    92 C:\Dev-Cpp\include\conio.h [Warning] `__cdecl__' attribute only applies to function types
    Anyone happen to know what it means and how to fix it?
    Sent from my iPadŽ

  2. #2
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,057
    Post line 92 (and surrounding lines) of conio.h.

    Maybe you renamed the file? It was a .cpp file, and now it's a .c file?
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Perhaps stop using that old fossil header file and find more modern ways of solving the same problem?

    Problems with conio.h are only going one way in future and that's worse - it's an obsolete header file.
    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.

  4. #4
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    That's really beyond the point. That's like me asking why my front bicycle wheel randomly disappeared and you telling me I should be driving a car. Just finding a more modern way doesn't answer why this changed for no reason, and without understanding why it happened, I may find myself with the same problem in modern methods and libraries.

    Anyway, here are the two problem lines:
    Code:
    extern   int _RTLENTRY _directvideo;    // Line 92
    
    #endif  /* __DPMI16__ || !_Windows */
    
    extern   int _RTLENTRY _wscroll;    // Line 96
    Sent from my iPadŽ

  5. #5
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    That's not the problem - the problem is your wheels are made of stone, not what they're attached to.
    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.

  6. #6
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    my guess is that you makde some project setting changes that either caused _windows to be undefined or __DPMI16__ to be defined.

  7. #7
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Quote Originally Posted by Salem
    That's not the problem - the problem is your wheels are made of stone, not what they're attached to.
    ...if these stone wheels are working one minute and then the next minute they aren't... is it because they're made of stone that the problem occured?

    Things shouldn't just stop working for no reason, no matter how old it is. I'm saying I compiled some code and it worked... then 20 minutes later, without changing the header I compiled the same code and it didn't work.

    If this can happen to something antiquated like conio.h for no apparent reason, then what's to say that it couldn't happen with newer libraries?

    Quote Originally Posted by Ancient Dragon
    my guess is that you makde some project setting changes that either caused _windows to be undefined or __DPMI16__ to be defined.
    I didn't change anything, but I'll check to see if anything was changed. Thanks for your reply.
    Sent from my iPadŽ

  8. #8
    Skunkmeister Stoned_Coder's Avatar
    Join Date
    Aug 2001
    Posts
    2,572
    what does _RTLENTRY expand to? Is the expansion conditional on anything else?
    Free the weed!! Class B to class C is not good enough!!
    And the FAQ is here :- http://faq.cprogramming.com/cgi-bin/smartfaq.cgi

  9. #9
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    I wish I could answer, that, but the truth is, I don't know. Check to see if you have conio.h with your compiler. If it isn't the same, I could post the whole thing here.

    What I do know now is that the problem only involves the use of the gotoxy() fuction, because conio will compile if that function isn't in the program. Second, I know that if I include windows.h in my program, it will also compile fine.

    If you don't have conio.h or perhaps a different version of it. I attached my version.
    Last edited by SlyMaelstrom; 10-13-2005 at 02:20 PM.
    Sent from my iPadŽ

  10. #10
    Registered User
    Join Date
    Aug 2005
    Posts
    1,267
    computer programs and files don't just change for no reason -- its always human error that causes such problems as you described. You had to change something, even unknowly. you can always download and reinstall the compiler again to correct this, and possibly other similar errors.

    you might also check to see if you have an antivirus program running. Sometimes Norton Antivirus will cause problems with Visual Studio VC++ 6.0 by causing the IDE to think the file is already in use by some other program when saving it. I usually turn off Norton or make sure I retry saving it when that error occurs.

  11. #11
    Devil's Advocate SlyMaelstrom's Avatar
    Join Date
    May 2004
    Location
    Out of scope
    Posts
    4,079
    Nah, I didn't change the header file. I even went through the trouble of taking the exact header file from a disk that I had and replacing it with the one giving me the error. I had the same problem.

    I know there is no reason for anything to have changed by itself. I'm sure that wasn't the case anyway. I just know that I didn't change anything in conio.h, so the error is somewhere else. I may reinstall the compiler, if that doesn't work, than I don't know.

    Thanks, though.
    Sent from my iPadŽ

  12. #12
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,660
    Of course there's no chance the problem couldn't be in your code right?
    That's totally unthinkable
    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.

  13. #13
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,895
    That doesn't look like a MinGW header. Any chance you first compiled it with DJGPP and now are trying to use MinGW?

    Let me elaborate: my installation of Dev-C++ (4.9.9.0, with MinGW GCC 3.3) has a very small conio.h: a mere 60 lines or so. This means that although your header resides in C:\Dev-Cpp\include, it most likely didn't come with the Dev-C++ installation, or the included MinGW GCC.
    This means the header you're using comes either from Borland Turbo C++ (its conio.h is famous for gotoxy) or from DJGPP, a DOS GCC port.
    Either way, it's very unlikely that it'll work with MinGW, which I still assume is what your Dev-C++ is using.

    So I have to assume that
    a) your earlier compilation was with a different conio.h or
    b) your earlier compilation was with a different compiler or
    c) your earlier compilation for some reason didn't compile this file (timestamps?)
    Last edited by CornedBee; 10-14-2005 at 02:42 AM.
    All the buzzt!
    CornedBee

    "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. conio.h not working in *nix
    By wise_ron in forum C Programming
    Replies: 2
    Last Post: 05-04-2006, 01:54 PM
  2. conio.h in Visual C++ ?
    By Born_2B_Alone in forum Windows Programming
    Replies: 3
    Last Post: 09-22-2004, 07:32 PM
  3. Getting textcolor in conio.h to work with Win32
    By MMD_Lynx in forum C Programming
    Replies: 5
    Last Post: 09-02-2004, 01:32 PM
  4. conio.h
    By Jaguar in forum Linux Programming
    Replies: 10
    Last Post: 10-17-2002, 01:12 AM
  5. Conio.h file problems
    By Unregistered in forum C++ Programming
    Replies: 4
    Last Post: 05-23-2002, 01:44 PM