Git Product home page Git Product logo

Comments (11)

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
To test, try building the RtAudio library 
(http://www.music.mcgill.ca/~gary/rtaudio/)
and their "probe" example (http://www.music.mcgill.ca/~gary/rtaudio/probe.html)

Configure the library with:
./configure --host=arm-apple-darwin AR=/usr/local/bin/arm-apple-darwin-ar

Original comment by [email protected] on 20 Sep 2007 at 4:43

from iphone-dev.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
On digging into this more, it's clear that g++ is emitting code for standard
exceptions, rather than SJLJ exceptions, even though I've enabled SJLJ 
exceptions as
shown in the instructions.  The Objective-C++ compiler appears to do the same.

Oddly, I don't see either symbol set (__Unwind_SjLj_* or __Unwind_*) in sample
Objective-C object files, even though I'm using exceptions in them.

Original comment by [email protected] on 20 Sep 2007 at 9:39

from iphone-dev.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
I got the same error. Is there a workaround or something? Is there somebody 
working on this one?

Thanks for the great tool, btw!

Christian

Original comment by [email protected] on 23 Sep 2007 at 7:47

from iphone-dev.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
Ok, this is a tough one. I've known for some time that C++ exceptions are 
broken: this is why you see the 
enable-sjlj-exceptions stuff. There isn't a whole lot that can be done about it 
right now; LLVM doesn't support 
SjLj-type exceptions at all. I've provided a fix that will enable the 
exceptions to link, but as we have to use SjLj 
exceptions on the ARM (unless someone wants to reverse engineer the ARM's 
zero-cost exception mechanism) 
we're pretty much stuck here unless someone wants to do a lot of work to 
implement SJLJ-type exceptions in 
LLVM-GCC. Sorry.


Original comment by [email protected] on 23 Sep 2007 at 9:03

  • Changed title: C++ exceptions broken
  • Changed state: Started

from iphone-dev.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
No problem, I was afraid that might be the case.  I would guess that internally 
Apple
isn't giving much thought to C++ on the iPhone, and I wouldn't either - if I 
didn't
have existing apps to migrate to it.

Thanks for the explanation, and the link fix.

Original comment by [email protected] on 23 Sep 2007 at 9:39

from iphone-dev.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
Not sure whether it is related, but I found that enabling exceptions for streams
causes programs to abort although the stream is in the "good" state when the 
program
is run without enabled exceptions. A catch() block inside Apple's own
libstdc++.6.0.4.dylib which is not entered as it should be?

Here's an example:
----------------------------------------------------------
#include <fstream>
#include <iostream>

using namespace std;

int main(int argc, char **argv)
{
    ofstream out;
    out.open(argv[1]);
    cout << (out.good() ? "good" : "bad") << endl;
    out.exceptions(ios_base::badbit|ios_base::failbit|ios_base::eofbit);
    out << "test\n";
    cout << (out.good() ? "good" : "bad") << endl;


    return 0;
}
----------------------------------------------------------
When run it fails with:
terminate called after throwing an instance of 'std::ios_base::failure'
  what():  basic_ios::clear
Abort trap


Original comment by [email protected] on 7 Oct 2007 at 6:52

from iphone-dev.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
ubuntu feisty

$ cat a.cpp
int main()
{
}
$ arm-apple-darwin-c++ a.cpp
/usr/local/bin/arm-apple-darwin-ld: can't locate file for: -lstdc++
collect2: ld returned 1 exit status

Original comment by [email protected] on 9 Oct 2007 at 4:22

from iphone-dev.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
regarding comment #6:
Looks like any exception raised will just terminate the app:

#include <stdio.h>
int main()
{
  try { throw 1; } catch(int i) {}
  printf("still alive...\n");
  return 0;
}

compile and run:

$ ./foo
terminate called after throwing an instance of 'int'
zsh: abort      ./foo

Original comment by [email protected] on 26 Oct 2007 at 2:53

from iphone-dev.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
I want to know how to comiple c++ code with Objective C. I just wrote a short 
c++ 
code as followings:

test.h
=========================
class My
{
public:
void test_hello();
};

test.c
============================
#include "test.h"
void::test_hello()
{
}


In the helloApplication.m,I add   
#include "test.h"

And,I create a class in 

- (void) applicationDidFinishLaunching: (id) unused
{
    .....

 My my;
my.test_hello();

}

When compiling it,it gets error!

In file included from HelloApplication.m:26:
hello1.h:6: error: syntax error before 'my'
hello1.h:7: error: syntax error before '{' token
hello1.h:12: error: syntax error before '}' token

Original comment by [email protected] on 24 Jan 2008 at 8:51

from iphone-dev.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
I was able to solve this issue by linking to gcc_eh
nm /usr/local/lib/gcc/arm-apple-darwin/4.0.1/libgcc_eh.a for more details :)

Original comment by [email protected] on 21 Feb 2008 at 5:47

from iphone-dev.

GoogleCodeExporter avatar GoogleCodeExporter commented on June 12, 2024
 dlaprise is right. the problem is with linking libgcc_eh.a
To solve this, use:
LIBFLAGS += -L"/usr/local/arm-apple-darwin/lib"
instead of:
LIBFLAGS += -L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib

I created the toolchain env using this tutorial:
http://ansani.it/2008/08/12/build-the-toolchain-for-iphone-20x-on-macosx-105x/ 

I attached a working application (an example I found on the net) and a makefile.


Goodluck,
Asaf Pinhassi

Original comment by [email protected] on 22 Jan 2009 at 2:50

Attachments:

from iphone-dev.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.