Error on Ubuntu/Linux but not Windows :O!

This is a discussion on Error on Ubuntu/Linux but not Windows :O! within the C++ Programming forums, part of the General Programming Boards category; Hello again! Well, I've now moved to Ubuntu x64, but still I'm working with my team on a Windows/DirectX project, ...

  1. #1
    Hail to the king, baby. Akkernight's Avatar
    Join Date
    Oct 2008
    Location
    Faroe Islands
    Posts
    717

    Error on Ubuntu/Linux but not Windows :O!

    Hello again!

    Well, I've now moved to Ubuntu x64, but still I'm working with my team on a Windows/DirectX project, so I use MingW32.
    Now, Elysia (Who uses Windows) Doesn't get these errors I get, I'm worried MingW32 doesn't have the same std:: functions, but I don't know, and that's why I'm asking these boards... So, grant me thy knowledge o' great cboard! xP
    Thanks in advance!
    Currently research OpenGL

  2. #2
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    My knowledge says: User Error.

    But, seriously, what are you going on about? You need to post, at the very least, an error, a code segment that works-in-windows-but-not-linux, or... something. Otherwise, it's a claim with no proof.
    That, and MinGW's stable compiler is gcc/g++ 3.4.5. If you're in Linux, I should honestly hope you're using something newer. Much newer. The difference in versions, could, at the very least, explain what you're seeing. (More likely however, is that it is you who is at fault...)
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  3. #3
    Hail to the king, baby. Akkernight's Avatar
    Join Date
    Oct 2008
    Location
    Faroe Islands
    Posts
    717
    Woops! I was supposed to post that xD
    And if I use GCC with the MingW compiler I get LOADS of cstdio.h errors, which I guess mean that there are the same definitions of stuff in GCC as MingW, but I don't know, anyways!
    Code:
    Error.h|10|error: no matching function for call to ‘std::exception::exception(const char*)’|
    Currently research OpenGL

  4. #4
    Hail to the king, baby. Akkernight's Avatar
    Join Date
    Oct 2008
    Location
    Faroe Islands
    Posts
    717
    Ok, fixed by using
    Code:
     std::runtime_error
    instead of
    Code:
     std::exception
    Currently research OpenGL

  5. #5
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    LOADS of cstdio.h errors
    stdio.h or cstdio. Either way, you probably shouldn't get errors from here.

    Code:
    Error.h|10|error: no matching function for call to ‘std::exception::exception(const char*)’|
    There is no such constructor. exception is essentially a base class. (It has only a copy ctor, assignment, destructor, and what()) Using std::runtime_error is probably good for small stuff, for larger stuff you might want to think about your own classes, derived from std::exception.
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  6. #6
    Hail to the king, baby. Akkernight's Avatar
    Join Date
    Oct 2008
    Location
    Faroe Islands
    Posts
    717
    The thing is, std::exception works for Windows Visual Studio xP I don't want to be forced to go back to Windows, I kinda like Ubuntu xD
    Currently research OpenGL

  7. #7
    int x = *((int *) NULL); Cactus_Hugger's Avatar
    Join Date
    Jul 2003
    Location
    Banks of the River Styx
    Posts
    902
    Wow, and I thought that g++'s headers were hard to read...

    Just reading headers, it would appear that VC++ might let you call exception(const char *). I don't use VC++ that much, but it would appear that (at least VS 8) comes with a non-standard <exception> header. I might have to test when/if I ever reboot to Windows.

    Your solution of using runtime_error (or some other exception class - the STL provides a few) is a good one - stick with it. Additionally, it should work with VC++.
    long time; /* know C? */
    Unprecedented performance: Nothing ever ran this slow before.
    Any sufficiently advanced bug is indistinguishable from a feature.
    Real Programmers confuse Halloween and Christmas, because dec 25 == oct 31.
    The best way to accelerate an IBM is at 9.8 m/s/s.
    recursion (re - cur' - zhun) n. 1. (see recursion)

  8. #8
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,449
    Dang it, Microsoft! They truly and really need to point out what headers are Microsoft-specific! -_-
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #9
    Cat without Hat CornedBee's Avatar
    Join Date
    Apr 2003
    Posts
    8,893
    Well, the header is standard, but its contents aren't.
    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

  10. #10
    C++まいる!Cをこわせ! Elysia's Avatar
    Join Date
    Oct 2007
    Posts
    22,449
    They failed to mention that, too...
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Windows 98/2000 programming in Windows XP
    By Bill83 in forum Windows Programming
    Replies: 3
    Last Post: 07-22-2005, 02:16 PM
  2. Dialog Box Problems
    By Morgul in forum Windows Programming
    Replies: 21
    Last Post: 05-31-2005, 05:48 PM
  3. dual boot Win XP, win 2000
    By Micko in forum Tech Board
    Replies: 6
    Last Post: 05-30-2005, 02:55 PM
  4. SDL and Windows
    By nickname_changed in forum Windows Programming
    Replies: 14
    Last Post: 10-24-2003, 12:19 AM
  5. IE 6 status bar
    By DavidP in forum Tech Board
    Replies: 15
    Last Post: 10-23-2002, 05:31 PM

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