ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
No luck compiler spits out file not found errors anywhere I try to use boost.
In Dev-C++ I've edited the compiler options to include C:\boost\include (I moved all the directories from boost-1_33 to C:\boost\include, I didn't think this would be a problem) but I noticed the lib directory was empty (not sure if this matters) so I ran bjam -sTOOLS=mingw stage and dumped the library files into C:\boost\lib, also updated Dev-C++'s settings to search this directory for lib files.
Still the program won't compile. Same error every time. I even tried specifying the include path on the command line using g++.
Is it important to you to use Dev-C++ ? I've been using cygwin/boost/mingw/g++ on the command line in windows with no problems. The sample program compiled fine for me. I can give you more info but I don't want to waste my time ( and yours ) if this is a solution that does not work for you.
OK I've done the install using -sTOOLS=gcc everything worked out pretty much the same. All the files are in c:\Boost\include\boost-1_33 using the same command as you've supplied I tried compiling from the command line with still the same results.
Can anyone tell me why this might be happening? I'm using boost supplied source code, and it compiles for everyone else... so this is kind of weird.
Perhaps it's because the directory I'm compiling from is in My Documents <- which contains a space in the name. I'll try from a new dir and get back to you guys.
OK this is the result of the compile after moving the source code to C:\src
Code:
C:\src>g++ simple_ls.cpp -o ls -LC:\boost\lib\boost-1_33 -IC:\boost\include\boos
t-1_33 -lboost_filesystem-gcc
C:\Dev-Cpp\bin\..\lib\gcc\mingw32\3.4.2\..\..\..\..\mingw32\bin\ld.exe: cannot f
ind -lboost_filesystem-gcc
collect2: ld returned 1 exit status
C:\src>
So this is an obvious improvement. Still I am unsure as to the usage of the -l arguement. If I leave it out I get a hole slew of errors. Hopefully I can figure this out.
That's because the executable does not know where to find the dll. There are a few ways to fix this but probably the best way is to tell it where to look for the dll by modifying your Path variable as follows:
set Path=c:\Boost\lib;%Path%
There are ways to make this happen automatically for a new command window but I don't remember how offhand.
Thanks for the help. I got it working! I copied the neccessary dll into the src directory. That works for now. I need to look into staticlly compiling but that's for another day.
Yes, copying the dll will work but it's not a very maintainable solution because you have to copy every boost shared library used by an executable to the folder of the executable. Not only that but you have to do this for every different folder at which you have created executables that use boost.
Static linking will also work but will result in larger executables that link slower. On the other hand it generates executables that are more self-contained and depend on a simpler run-time environment.
Of course, what works best for you depends on your circumstances.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.