Menu

Access violation with gsl_rng_alloc()

vpillar
2010-01-21
2012-09-26
  • vpillar

    vpillar - 2010-01-21

    The function gsl_rng_alloc() from GSL, called from a program compiled with Dev
    C++, gives an access violation error when my program is executed under WIndows
    (Vista). The error seems to be in Dev C++ and not in the GSL, since the
    program runs fine in another system when compiled using XCode.
    Is there a new version of Dev C++ in which this problem is solved? Any other
    advice? Please explain it clearly, since I am new to Dev C++.

     
  • cpns

    cpns - 2010-01-21

    The error seems to be in Dev C++ and not in the GSL

    I doubt that, Dev-C++ is merely an IDE and is used for editing, building and
    launching your code, but has no bearing on the execution of it. The compiler
    used by Dev-C++ is MinGW/GCC; this is responsible for code generation from
    your source; it is highly unlikely that it generated incorrect code from
    correct source. After all, it is essentially the same GCC compiler that XCode
    uses, only built for Windows.

    The most likely cause of an access violation is an error in _your _code;
    apply Occam's Razor, and don't
    go looking for complex answers to simple problems; apart from an error in your
    code being teh most likly explanation, it is also the only one you will be
    able to do a thing about, so blaming your
    tools
    is
    unlikely to help.

    the program runs fine in another system when compiled using XCode.

    A program apparently running fine on another system is no proof of
    correctness. For example, the behaviour of a system when you overrun a buffer
    is undefined; that means anything can happen, including apparently
    nothing
    . You most likely have a bug that was simply latent in another
    environment.

     
  • cpns

    cpns - 2010-01-21

    Is there a new version of Dev C++ in which this problem is solved?

    As I said, you are blaming the wrong thing, but Dev-C++ uses MinGW/GCC, that
    is a project hosted at http://www.mingw.org, where you
    may obtain a newer version. Dev-C++ itself is no longer maintained.

    To find your code error, you should use a debugger. Unfortunately Dev-C++
    integrated debugger interface sucks and is hardly worth the effort. For that
    reason you would be far better off using VC++ 2008 Express; it is free, up-to-
    date, has greater functionality than Dev-C++, is less buggy, and has a best-
    in-class debugger.

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.