Archive

Posts Tagged ‘dylib’

Xcode and static libs

October 19th, 2009

I’m writing this blog entry just in case other people come across the same problem and can’t seem to figure out what’s going on.

I found it in Xcode 2.5 that hasn’t been fixed in the latest version of Xcode that I have, version 3.1.3.

The bug I’m referring to is when you create a target as a static lib output, then you change the target later to output a dylib. The problem is that everything looks fine… heck, it even puts a dylib in the file name extension, but the file is actually a static library.

You have to go to Terminal.app and use the file command to see that the file is in fact, a static lib and not a dylib. You may not notice the problem at first until you go to debug the project and notice some weirdness.

Hopefully, you haven’t gotten bit by this problem, but if you have, the only solution I found was to create a new target from scratch.

Jaime Coding, Not-so-funny , , , , ,

Dumping symbols from a library

September 4th, 2008

When you need to dump symbols from a dylib on Mac OS or a DLL on Windows, you can use the following commands to do so:

Mac OS

nm -m mySpecialLibrary.dylib

Windows

dumpbin /exports mySpecialLibrary.dll

Now sometimes, you have have a lot of symbols in one library, or you may want to find one particular symbol. On the Mac, that’s pretty simple to do. Just use the grep command to find the symbol you are looking for:

nm -m mySpecialLibrary.dylib | grep someSpecialFunction

On the PC, you can dump your symbols to a file so that you can use a text editor like Notepad++ to search for symbols:

dumpbin /exports mySpecialLibrary.dll > c:\MyProjectFolder\mySpecialLibrarySymbols.txt

Jaime Coding , , , ,