![]() pc file that describes the library and where it is and how to link to it. Modern stuff you install also installs a. You can supplement this by using the CPATH variable, or CFLAGS or any number of other environment variables really (conveniently complicated). There is a default path that the linker searches for libraries. Except the env variable is DYLD_LIBRARY_PATH instead. ![]() On Mac it is the same for most open source software almost always (unless it is an Xcode Project). On Linux they need to be installed to a path that the dynamic linker can find, this is defined by the LD_LIBRARY_PATH environment variable and the contents of /etc/ld.conf. ![]() configure & make finds them, what actually happens when they are linked against How shared libraries work under OS X / Linux - where they live on the filesystem, how. If you install anything anywhere else (which makes things painful if the dependency was installed by MacPorts or Fink), you will have to pass a flag to configure or modify the shell's environment to help GNU tools find these dependencies.Ģ. Generally, you shouldn't have to pass anything to configure, it should figure out if your system can build foo-tool or not.Ĭonfigure and GNU tools all look in /, /usr and /usr/local for dependencies. ![]() But there's plenty of stuff out there using cmake, or custom build scripts. Autotools is easy enough as it is consistent. How do I figure out what arguments to pass to. Basically what follows is 8 years of making desktop apps (that I help distribute), frustration and googling:ġ. I apologise for directly answering everything, but I don't know any useful tutorials, FAQs, etc. I'm willing to invest quite a bit of time and effort here - I don't necessarily want direct answers to the above questions, I'd much rather get recommendations on books / tutorials / FAQs that I can read which will give me the knowledge I need to understand what's actually going on and hence figure out problems on my own. What are the command line tools I need to master to get good at this stuff? Stuff like otool, pkg-config etc.Assuming I manage to compile something fiddly from source, how can I then package that up so other people don't have to jump through the same hoops? Particularly on OS X.If I am installing stuff from source on a system that is otherwise managed using packages, what's the cleanest way of doing so?.How can I install more than one version of a library without breaking my normal system?.How can I tell what libraries I have installed, and what versions?.What are the actual differences between a shared and a statically linked library? Why can't I just statically link everything (RAM and disk space are cheap these days) and hence avoid weird library version conflicts?.How shared libraries work under OS X / Linux - where they live on the filesystem, how.How do I figure out what arguments to pass to.This almost always relates to other library dependencies in some way. While I install software from packages (MacPorts / apt-get) where-ever possible, I often find myself needing to compile packages from source./configure & make & sudo make install is usually enough, but sometimes it doesn't work - and when it doesn't, I frequently get stuck.
0 Comments
Leave a Reply. |