Note that there are some explanatory texts on larger screens.

plurals
  1. POCreating and using dynamic libraries in OS X
    primarykey
    data
    text
    <p>We have a Windows application written in C++, part of which we are trying to port to Mac OS X. Our goal is to wrap the business logic into some libraries and build a Cocoa layer on top for the controller and the GUI. We will probably have several smaller apps using the same libraries so our first thought was to use dynamic libraries for the C++ code (unless there is a better way). However, we are having some problems with achieving this. Our dynamic library complies fine (at least it looks like that) and we get a .dylib file which we link to in our app. The problem is that our app simply can't find any of the .h files we are trying to include. We have already checked that the .h files are being exported as well as checked the install name and made sure that the library is located in the correct directory. Also, we have followed Apple's guide for creating and using dynamic libraries and found no special step we were missing.</p> <p>My question here is in two parts:</p> <ol> <li>Is there some obvious step we might be missing which is instrumental in exposing the interface (i.e. the .h files) that we should try before anything else?</li> <li>We do suspect that the fault might be in the crappy C++ code we have inherited in this project. For instance, there is a lot of logic (implementation of methods) written directly in .h files and in some cases there isn't even a corresponding .cpp file at all. So the .h files aren't merely a description of the interface. This might not be the (solemn) problem as our app can't even find the .h files from the library and they should at be least present. We really hope that we can avoid rewriting a lot of the code since the code base which needs to be ported is really large and (as usual) the deadline is close.</li> </ol> <p>PS: We have so far only been working in Xcode 4.2 and have not tried with the command line tools yet.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload