Results 1 to 5 of 5
I am learning C++ and wish to include some Boost functions in my code. My machine is running Debian Linux with the pre-installed boost binarys.
I have a couple of ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 02-21-2011 #1Just Joined!
- Join Date
- Dec 2009
- Posts
- 8
using binary c++ libraries
I am learning C++ and wish to include some Boost functions in my code. My machine is running Debian Linux with the pre-installed boost binarys.
I have a couple of questions:
How do I include the library in my C++ code as there are no cpp or h files only binary files (eg /usr/lib/libboost_regex-d.so and /usr/lib/libboost_regex-d.a)
How do I comipile the code. I am using DialogBlocks for creating forms using wxwidgets. The editor also compiles the code using the gcc compiler. Do I have to give an instruction to the compiler saying which file is requried and where to find it? If so, any ideas how this is done?
Thanks in advance.
Michael
- 02-21-2011 #2
Rather than figure out how to do it yourself,
you can install the development libraries.
libboost-dev seems to be the main package.
- 02-22-2011 #3Just Joined!
- Join Date
- Dec 2009
- Posts
- 8
- 02-22-2011 #4Just Joined!
- Join Date
- Dec 2009
- Posts
- 8
Which folder to use and how to instruct the compiler/linker
The problem I have now is informing the GCC compiler / linker where the libarary files are.
The following folders have binary files in:
boost_1_44_0/bin.v2
boost_1_44_0/stage/lib
Note,I have attached a picture of the folder tree structure.
Which folder contains the library I should use. In fact what is the difference between the two folders contents.
Also what instructions should I pass to the gcc compiler/linker?
Michael
- 02-27-2011 #5Linux Guru
- Join Date
- Apr 2009
- Location
- I can be found either 40 miles west of Chicago, or in a galaxy far, far away.
- Posts
- 10,144
For the linker use the LDFLAGS argument "-L /usr/local/boost_1_44_0/bin.v2/libs -L /usr/local/boost_1_44/stage/lib" assuming that each of these are the actual paths to the libraries you need to link. From the directory tree however I don't think you ran "make install" after building everything. If you had then all the stuff you need would be in /usr/local/lib or /usr/local/lib64. In that case the LDFLAGS components would be "-L /usr/local/lib" or "-L /usr/local/lib64" depending upon whether you built boost in 32-bit or 64-bit format.
Sometimes, real fast is almost as good as real time.
Just remember, Semper Gumbi - always be flexible!


Reply With Quote

