Mailing Lists: Apple Mailing Lists
Image of Mac OS face in stamp
HELP: Project Builder/CodeWarrior, Mach-O and C++
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

HELP: Project Builder/CodeWarrior, Mach-O and C++



Hi all,

This is a general question about mixing Carbon calls with STL/C++, BSD
calls, etc, and also a specific Project Builder question. Hope it's the
right forum...

I'm using Mac OS X 10.2.3, CodeWarrior 8.3 and Project Builder 2.1 (DevTools
Dec 2002).
I have a couple of C++ classes that contain calls to Carbon as well as
Standard C++ (strings, exceptions, etc) and BSD calls.

Now, I want to use the classes in a Java JNI and a test app under Mac OS X.
Unfortunately I have stumbled into a couple of problems:

1) When using the classes in a CodeWarrior project (i.e is forced to use
Apple's Mach-O linker since it's a JNI) I've had the ususal horror building
a Apple Mach-O project. I have created the project from the JNI examples on
Metrowerks CD and also read all the MW notes about Mach-O and MSL. I've had
problems earlier to get the JNI to link properly, managed to fix it, but now
have stuck a runtime problem when the JNI is executed in 10.1.x:

dyld:
/System/Library/Frameworks/JavaVM.framework/Versions/1.3.1/Home/bin/java
Undefined symbols:
/usr/lib/libWeSeeLib.jnilib undefined reference to ___isinfd expected to be
defined in /usr/lib/libSystem.B.dylib
/usr/lib/libWeSeeLib.jnilib undefined reference to ___nan expected to be
defined in /usr/lib/libSystem.B.dylib

Do I need to link to another library to make a JNI that works in both 10.1.x
and 10.2.x?

2) When I clone the JNI target in CW, and create a standard test app (since
it's hard to debug a JNI), I get problems since Metrowerks header files for
some BSD calls differ from Apple's. I can't mix the BSD and MSL from both MW
and Apple without getting errors. Stuck in the middle. Does anyone have
hints how to solve this?

3) So I'm now giving Project Builder a try. Fairly straight forward, minor
changes in the code, but ends up with a linker problem:

ld: Undefined symbols:
std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> >::c_str() const
std::basic_string<wchar_t, std::char_traits<wchar_t>,
std::allocator<wchar_t> >::length() const

How can I solve this? Can I turn off the use of wchar in Project Builder as
easy as in a CW project? Or Do I need to download STLPort or similar to get
at fully functional STL implementation?

TIA,
/Anders
--
+--------------------+-------------------------------------------
| Anders Ulfheden | email: email@hidden, email@hidden
| Session AB | Web: http://www.session.se/
| Tvjnavdgen 55B | http://www.macula.se/
| S-191 34 Sollentuna| Phone: +46-8-444 09 80 (Work), ...85 (Fax)
| Sweden | +46-70-531 38 87 (Mobile)
_______________________________________________
carbon-development mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/carbon-development
Do not post admin requests to the list. They will be ignored.



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2011 Apple Inc. All rights reserved.