OS X 10.5 SDK deprecated getAttributeNS; what should I use instead? - macos

I'm upgrading a project to use the 10.5 SDK. I'm getting warnings of this form:
warning: 'getAttributeNS::' is
deprecated (declared at
/Developer/SDKs/MacOSX10.5.sdk/System/Library/Frameworks/WebKit.framework/Headers/DOMElement.h:74)
...for getAttributeNS, hasAttributeNS, removeAttributeNS, replaceChild, and getElementsByTagNameNS.
I've looked at the header referenced, and I see that they are indeed marked deprecated via some Macro Magic. I also found some "documentation" on Apple's developer site, but it just lists the interfaces. It doesn't give any guidance on how to use them or what to use instead.
So, any advice on (a) how to figure out what to use instead, and (b) what I should actually use instead, would be very much appreciated.

According to the 10.5 WebKit changes, there are now methods called getAttributeNS:localName: and so on, and a replaceChild:oldChild: method of DOMNode.

Related

Warning linking libxml++-2.6 (c++11 obsoltes std::auto_ptr). Shall I just ignore it?

Using gcc with -std=c++11
pkg-config libxml++-2.6 --modversion
2.40.1
get lots of warnings like this:
/usr/include/libxml++-2.6/libxml++/parsers/saxparser.h:224:8: warning: 'template class std::auto_ptr' is deprecated [-Wdeprecated-declarations]
I may follow the recommendation and disable this warning but I may miss other warnings in future.
I may try latest libxml++ version 2.91; despite huge minor(lol) version difference it's at most one month younger; I'll build this on older machines where libxml++ will probably be older.
I'll ignore this warning. Would anybody do otherwise ?
You should be safe ignoring the std::auto_ptr warning. Prior to C++11, auto_ptr was a common way to manage memory, because it takes ownership of a pointer. Post C++11 it's recommended to use the new smart pointers that are part of STL (ie std::unique_ptr, std::shared_ptr).
This question has a good discussion on std::auto_ptr and issues that led to it being deprecated. I wouldn't write new code using it, but existing code using auto_ptr should be safe (assuming there aren't bugs to begin with which may or may not be valid).
Well, there is a better-than-average chance that auto_ptr will be removed from C++17. So I would be at least somewhat concerned about relying on software that made use of it.
You could replace your libxml++ version by a version higher or equal than 2.9.1 They fixed the auto_ptr thing and replaced it by unique_ptr. Although you have to install libxml++-2.9.1 by hand by downloading it from:
http://ftp.gnome.org/pub/GNOME/sources/libxml++/
hope it helps.

StgCreateDocfile, etc. on MacOS 10.9.5

I'm having trouble linking an Xcode project using the AAF SDK, with Xcode 5.1.1 on MacOS 10.9.5. When I link the main dynamic library, these symbols come up missing:
_StgCreateDocfile
_StgCreateDocfileOnILockBytes
_StgOpenStorage
_StgOpenStorageOnILockBytes
AssertProc
I can't find a definition for them anywhere in the entire source tree for the SDK. The first four appear to be part of Structured Storage on Windows. A Structured Storage library is provided in the SDK and I'm already linking that.
Can anyone tell me of a Mac system library that defines these? Or is there a linker argument that pulls in a library for them? Thanks for any help.
A late answer (!), but in case anyone comes across this... The solution is either:
To use the makefiles with the AAF SDK to generate the AAF dylib,
which works fine. or...
If you use Xcode to build the AAF SDK, ensure the correct
#defines are kept, namely:
_DEBUG OM_DEBUG OM_STACK_TRACE_ON_ASSERT OM_USE_SCHEMASOFT_SS OM_STRUCTURED_STORAGE
Note that DEBUG=1 is absent (it is added by default by Xcode) - if defined, this brings in AssertProc. Define NDEBUG on release builds and omit the debug defines.
The Stg... functions are part of the MS implementation of Structured storage as you stated, but should not be referenced on a Mac, the Schemasoft implementation being used.

Xcode from MonoTouch

Is there a possibility to call methods in a XCode library from MonoTouch? We would like to use the Bardecode (http://www.bardecode.com/) library in our Apps.
Regards
Paul Sinnema
Yes, it is possible to call Xcode libraries from MonoTouch.
First you should see if somebody has already created bindings for the library you want to use, if not, you should have a look at how to bind native libraries in MonoTouch.
Here is the documentation on how to bind native libraries: http://docs.xamarin.com/ios/advanced_topics/binding_objective-c_types
There are also a lot of samples here: https://github.com/mono/monotouch-bindings

SecPKCS12Import() from Security.framework fails on OS X 10.6

When I attempt to use SecPKCS12Import() from the Security framework as provided by Mac OS X 10.6, the result code is always errSecUnimplemented, regardless of the arguments provided.
Furthermore, the linker is unable to find symbols for the constants relevant to this function declared in SecImportExport.h (i.e. kSecImportExportPassphrase, kSecImportItemIdentity, et al.).
What on Earth is going on with this library -- is the function implemented or is it not? Why can the linker resolve all other symbols in the framework, but not these? How should I convert a PKCS12-formatted binary blob to a SecIdentityRef or SecCertificateRef and SecKeyRef pair?
What am I doing wrong? I'm sure this is a PEBKAC issue. :-)
EDIT: I see that I was very unclear in my question. I'm aware that Security.framework is implemented, given that I am able to use the other functionality it provides without an issue. Given this, I'm fairly certain that I'm linking against the framework correctly, since if I remove the link, none of the symbols can be found -- as expected. When I relink the framework, all the symbols are found, with the exception of the constants relevant to SecPKCS12Import(), e.g. kSecImportExportPassphrase, kSecImportItemIdentity, etc.
Given that I cannot use these symbols, I passed in what could have been incorrect strings (#"kSecImportItemIdentity", etc.), but the error code returned was errSecUnimplemented. This led me to believe that perhaps this specific functionality has not been implemented.
I tried using the 10.5 SDK, but that didn't work, of course. :-)
EDIT: My import is just a regular #import <Security/Security.h>. For kicks, I tried #import <Security/SecImportExport.h> as well, but this effected no change. That said, the error is issued by the linker, not the compiler.
I ran dyldinfo -export Security.framework/Security to list the symbols exported by the library and found many of the new symbols, but kSecImportExportPassphrase and friends were conspicuously missing. This might explain why the linker cannot find the symbols. The symbol for SecPKCS12Import appears in the symbol table and I can call that with no issues, it's just the functionality does not seem to be there.
Security.framework is most certainly implemented — see the Security Reference Update which documents what has changed in the framework in 10.6 and prior. Since you know the headers to use, I assume you've already consulted the Security Framework Reference.
Are you sure you're properly importing and linking against the framework? (It's in /System/Library/Security.framework, so you shouldn't have to specify the path.)
Does the compiler issue warnings or errors stating that the symbols in SecImportExport.h are undefined? (If not, how do you know they're "declared but undefined"?)
When you say that this fails on 10.6, have you tried it on an earlier version of the OS successfully?
EDIT: Okay, since you're using other parts of Security.framework successfully, and the APIs and constants you're trying to use are 10.6 only, it doesn't seem like a linking issue. What do your import look like? Are you sure you're importing SecImportExport.h properly? The constants are declared just above the SecPKCS12Import() function, so if you get warnings for the constants, you should get one for the function being undefined as well.
EDIT: I have confirmed with a member of the team at Apple that works on Security.framework that this functionality is not currently implemented. Please file a bug to gripe about this at http://bugreport.apple.com against component Security (New Bugs), version X. Include the URL to this question in your report. Sorry there's not a better answer at the moment.
To my knowledge, Apple is great at partially implementing things or leaving no documentation. If you really can't find the real implementation you need, you can use OpenSSL to extract the blobs and then Security services to import them to a keychain or further process with Security/CDSA methods. That would get you going and you can ping the Apple dev connection with further questions, if you have the possibility.
Further, looking at /System/Library/Frameworks/Security.framework/Headers/SecImportExport.h on my 10.6.2 machine, I see references to PKCS#12 in the documentation of SecKeychainItemImport()
Search that file for "PKCS12" for further information.

Why "Follow symbol under cursor" does not work in Qt Creator for Mac OS X?

I'm using Qt Creator under Mac osx, but "Follow symbol under cursor" option, to allow me to jump for class and methods' definitions, does not really work... it only works for local symbols. neither does "Switch between method declaration/definition"
Any ideas?
Thanks much for any thought.
Lior
First off, which version of Qt Creator are you using?
There is a Qt Creator 1.3 release candidate final release (1.3) out now that you might want to try: http://qt.nokia.com/developer/qt-creator-1.3-preview Qt Website Download Section :)
Hope that helps!
As #badcat said, ensure that you have the most recent version.
Other than that, when you have problems following a "symbol under cursor" it could mean 1 of 2 things.
1) I would check that you have your project appropriately constructed so that it has all the include and source files that it needs.
2) This is more rare, but check that you have function definitions in header files and that they are included properly by your source files. As opposed to what you may ask? We have a project here where, instead of include files, functions are defined in .cc files, and extern statements are used so that other files have access to them. (It's legacy code) In such a case, Qt Creator doesn't know how to find anything because files are only aware of each other while linking and have no other way to see each other.

Resources