[Boost users] MacPorts and Boost path issues
I am a command-line user of C++ and boost. I installed boost on Mac Leopard using mac ports like this: sudo port install boost I saw as it installed that macports was using bjam, and the version was 1.37. I want to use boost/regex.hpp, so I know it's not just a matter of including a header file. When I compile my own source files, I see a variety of paths, such as /opt/local/var/macports/sources/rsync.macports.org/release/ports/devel/boost /opt/local/var/macports/sources/ rsync.macports.org/release/ports/devel/boost/files etc My first question is, when I compile my work on command line using g++: i.e., g++ myfile.cpp -o myfile which of these paths should I include? I think I am supposed to do something like g++ -I /path/to/boost myfile.cpp -o myfile but I do not understand how a person knows which dir to use. Another way of asking this is: If YOU sat down at my machine and decided to use boost, what would you do to a)find it and b)include it in your pre-processor includes? Is there clear documentation on how a fellow figures out where the install is located, and then shows how to include it? Perhaps I simply don't know what to ask for, but when I google for this I gfind a zillion unrelated things. Do I in fact need to do the "-I /silly/long/path/to/the/bowels/of/the/machine/where/macports/hid/buried/installed/boost" every single time I compile something?? It occured to me to try a soft link somewhere in my development dir to save typing, but in order to do that of course I first need to figure out where boost actually resides in the system. I also have fink installed on the system, and fink says that boost1.33 is installed. So how in the world do I update fink to accept a later version? When I try to update, fink says no update is needed. Thanks in advance for the hand-holding. Boost is worth the effort to figure it out, yes? -- John Burgoon Development Staff, GiveALink.org Informatics 304 812-856-1833 office 812-391-2428 cell --
Insight without implementation is worthless. Get to work.
2009/3/16 John Burgoon
My first question is, when I compile my work on command line using g++: i.e., g++ myfile.cpp -o myfile which of these paths should I include? I think I am supposed to do something like g++ -I /path/to/boost myfile.cpp -o myfile but I do not understand how a person knows which dir to use.
I've never used the macports boost package, but I expect the headers are in '/opt/local/include/boost'. So probably '-I /opt/local/include'.
Another way of asking this is: If YOU sat down at my machine and decided to use boost, what would you do to a)find it
At the command line: port contents boost | less
Is there clear documentation on how a fellow figures out where the install is located
Also at the command line: man port
and then shows how to include it?
I'm not sure. You might get more help on the macports user list.
I also have fink installed on the system, and fink says that boost1.33 is installed. So how in the world do I update fink to accept a later version? When I try to update, fink says no update is needed.
That would be a question for the fink documentation or users list. Although you should be careful if you've got both macports and fink installed as they can interfere with each other. Daniel
participants (2)
-
Daniel James
-
John Burgoon