You are not logged in.

#1 2014-04-21 08:28:55

jasterlaf
Member
Registered: 2014-04-21
Posts: 3

Desmume throwing instance std:bad_alloc

Is anyone else having trouble with desmume? I've tried the version in community and the svn in aur and get

DeSmuME 0.9.10 svn0 x86-JIT NOSSE
terminate called after throwing an instance of 'std::bad_alloc'
  what():  std::bad_alloc
Aborted (core dumped)

I've looked all over for solutions. Hardly any mention of this problem anywhere. One forum suggested downgrading gcc. I considered installing gcc 4.4 from aur. But that wouldn't fix the version in community, right? gcc 4.4 takes forever to compile, and I'm afraid to install it anyway.

Offline

#2 2014-05-15 21:07:36

adamnew123456
Member
Registered: 2014-05-15
Posts: 1

Re: Desmume throwing instance std:bad_alloc

I have the same issue with the version in community, and it showed the same message.

I attempted to build the version on the AUR, https://aur.archlinux.org/packages/desmume-svn/ with clang and clang++ flags. This required me to:

  • Change the PKGBUILD's ./configure line to:

      ./configure \
         --prefix=/usr \
         --enable-wifi \
         --enable-openal \
         --enable-osmesa \
         --enable-hud \
         --enable-glade \
         CC=clang CXX=clang++
  • The header file "/usr/include/agg2/agg_renderer_outline_aa.h" uses some invalid C++ which clang++ will call out as illegal. Go to line 1378 of this file, and change it to the following:

    line_profile_aa& profile() { return const_cast<line_profile_aa&>(*m_profile); }

    (Yes, this is almost certainly a bad idea, but it is the only thing that prevents clang++ from compiling this code. If this really scares you, then backup this file and restore it from the backup after compiling desmume).

  • Run the PKGBUILD and install the package.

  • Surprise! clang++ does something right here, that g++ did wrong. Hopefully this will work for you, as it worked for me.

Offline

#3 2014-07-15 05:09:02

allencch
Member
Registered: 2011-03-25
Posts: 120

Re: Desmume throwing instance std:bad_alloc

Thanks for the solution. It works.

Offline

Board footer

Powered by FluxBB