Comments (11)
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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)
- Impossible toolchain compilation on Linux HOT 2
- compilation failed HOT 1
- #error Add the correct JBLEN size for your target here HOT 3
- SJ99 - iPhone toolchain SDK v2.0.1, THE BEST SDK SUPPORT MAC OS 10.6.X
- A lot of warnings & errors on Ubuntu Lucid Lynx x86
- error building lvmm-gcc on Ubuntu HOT 1
- Good news to all toolchain users, one-key to install toolchain and no need to config anything! HOT 1
- gcc problems whith iphone-dev installlation on 64 bit gnu/linux (deb/deb based) HOT 1
- Make odcctools failed on MacOS10.6.3
- make LLVM-GCC error
- Can't Compile LLVM-SVN on Ubuntu 10.10 Maverick HOT 1
- native 64bit toolchain on linux HOT 10
- problems while performing 'make' HOT 2
- Can't compile llvm because it can't find lgcc_s HOT 1
- Error while running make ENABLE_OPTIMIZED=1
- compilation LLVM
- make odcctools failed due to error
- llvm-gcc-4.2-iphone: configure: error: You must specify valid path to your LLVM tree with --enable-llvm=DIR
- error building llvm HOT 1
- error Darwin CC Tools IPad 2 HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from iphone-dev.