News:

Accounts with zero posts and zero activity during the last months will be deleted periodically to fight SPAM!

Main Menu

using boost/filesystem

Started by kanesoban, July 08, 2008, 10:26:56 PM

Previous topic - Next topic

kanesoban

Helo,

my problem is the following: there are some things i want to use in the boost/filesystem library.
http://www.boost.org/doc/libs/1_35_0/libs/filesystem/doc/index.htm

However, i have no idea, how to install 3rd party libraries. I've read through boost's website, but it mostly contains instructions on installing boost with Ms Visual Studio. With other IDEs, the site says, that
"if you're using an earlier version of Visual Studio or some other compiler, or if you prefer to build everything yourself, you can download boost_1_35_0.exe and run it to install a complete Boost distribution"

There is a link to the sourceforge boost page, but there is no exe to download.


MortenMacFly

Quote from: kanesoban on July 08, 2008, 10:26:56 PM
There is a link to the sourceforge boost page, but there is no exe to download.
Probably you are just a bit too early? I didn't even realise that boost 1.35.0 is out... :shock:
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: [url="https://www.codeblocks.org/docs/main_codeblocks_en.html"]https://www.codeblocks.org/docs/main_codeblocks_en.html[/url]
C::B FAQ: [url="https://wiki.codeblocks.org/index.php?title=FAQ"]https://wiki.codeblocks.org/index.php?title=FAQ[/url]

killerbot

note not everything from boost needs to be build Several things are just simple templates in header files, no idea about the filesystem, never used that part

By the way : in linux you get a free ride, most distros have it as a package : binary and headers :-)

Longe live linux :-) :-)

TDragon

The documentation is in error; an .exe is no longer distributed. You can download whichever of the archives on the SourceForge download page is easiest for you to extract.

boost::filesystem does indeed need to be built. Follow the directions here. You haven't specified which compiler you're using, so I'll assume it's the installation of MinGW included with the full Code::Blocks 8.02 download. Your toolset, for the purposes of building Boost, is "gcc". You will need to ensure the "bin" subdirectory (containing gcc.exe and friends) is in the PATH environment variable before invoking bjam.

Cheers,
John E.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

kanesoban

"You haven't specified which compiler you're using"

It's gcc 3.4.4.

"You will need to ensure the "bin" subdirectory (containing gcc.exe and friends) is in the PATH environment variable before invoking bjam."

How do i do that ?

TDragon

You can do it permanently by adding it in the Environment Variables applet (Control Panel / System / Advanced / Environment Variables). A "Path" entry is usually already present, and you can just tack ";C:\MinGW\bin" on to the end of it (assuming MinGW is installed in C:\MinGW).

Or you can do it for the length of a single command prompt session with:

set PATH=%PATH%;C:\MinGW\bin


You will also need to do this for the path to bjam.exe, unless you put it in the root of the Boost sources.

A final note:
Questions like this are not truly appropriate for the Code::Blocks forums. If you have further difficulties, you should use the MinGW or Boost mailing lists.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

kanesoban

Helo again,

i think i succesfully built boost. Now, the next question is, how do i link it in Codeblocks to my program ?

Note:
boost build directory is C:\Documents and settings\Kane\build-boost\

TDragon

Quote from: kanesoban on July 11, 2008, 09:50:01 PM
Now, the next question is, how do i link it in Codeblocks to my program ?

* Add whatever folder contains the boost/*.hpp files to your project's include search directories.
* Add whatever folder contains the library files you just built to your project's library search directories.

Then you can add the name of the library you want to link in your project's libraries to link.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

kanesoban

Quote* Add whatever folder contains the boost/*.hpp files to your project's include search directories.
* Add whatever folder contains the library files you just built to your project's library search directories.

Please write this down in simpler steps, and more detail.

TDragon

Depending on how you've run bjam, the full path to filesystem.hpp will be like "DriveLetter:\Path\To\SomethingWithBoostInIt\include\boost_1_35\boost\filesystem.hpp". In this case, add "DriveLetter:\Path\To\SomethingWithBoostInIt\include\boost_1_35" in the list of directories in the Compiler tab of the Search Directories tab of your project's Build options.

Also depending on how you've run bjam, the full path to libboost_filesystem-1_35.a will be like "DriveLetter:\Path\To\SomethingWithBoostInIt\MaybeLib\libboost_filesystem-1_35.a". In this case, add "DriveLetter:\Path\To\SomethingWithBoostInIt\MaybeLib" in the list of directories in the Linker tab of the Search Directories tab of your project's Build options.

Then, add "boost_filesystem-1_35" to the list of libraries to link in the Linker tab of your project's Build options.

Obviously, you'll have to do a smidge of creative thinking in order to figure out exactly what paths to use. The name of the library file might even be wrong. This is because A) I'm not at a computer with Boost installed, and B) if you can't figure it out, then there are some basic programming concepts you need to learn first.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

dje

Could you give more details on
Quotesome basic programming concepts
?  :lol: :lol: :lol:

TDragon

Sure. In this case, there are two that apply:
1. RTFM! The boost documentation tells you about the various libraries that are built and how to use them.
2. Understand your compiler! You need to grasp of the concepts of compile-time and link-time resolution and what files and commands the compiler needs in order to perform them. See (1) as applied to the compiler documentation, take a class in C or C++, or read a book.

And that's as detailed as is appropriate for the Code::Blocks forums.

Cheers,
John E.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

kanesoban

Quote...add "DriveLetter:\Path\To\SomethingWithBoostInIt\include\boost_1_35" in the list of directories in the Compiler tab of the Search Directories tab of your project's Build options.

Done.

QuoteAlso depending on how you've run bjam, the full path to libboost_filesystem-1_35.a will be like "DriveLetter:\Path\To\SomethingWithBoostInIt\MaybeLib\libboost_filesystem-1_35.a". In this case, add "DriveLetter:\Path\To\SomethingWithBoostInIt\MaybeLib" in the list of directories in the Linker tab of the Search Directories tab of your project's Build options.

Strange. There is no such file on my entire hard-drive. Maybe i didn't succeed in building boost after all ?

QuoteThen, add "boost_filesystem-1_35" to the list of libraries to link in the Linker tab of your project's Build options.

Done.

Now, the compiler gives this message when i try to build my project:

C:\Program Files\CodeBlocks\bin\..\lib\gcc\mingw32\3.4.4\..\..\..\..\mingw32\bin\ld.exe: C:\Program Files\boost\boost_1_35_0\libs: No such file: Permission denied

TDragon

Quote from: kanesoban on July 15, 2008, 11:29:19 AM
Strange. There is no such file on my entire hard-drive. Maybe i didn't succeed in building boost after all ?
That might be so.

At any rate there should be a directory somewhere full of Boost library files that were built, several of which should have "filesystem" in the name. Like I said, I might have gotten the name of the file wrong.
[url="https://jmeubank.github.io/tdm-gcc/"]https://jmeubank.github.io/tdm-gcc/[/url] - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

kanesoban

QuoteAt any rate there should be a directory somewhere full of Boost library files that were built, several of which should have "filesystem" in the name. Like I said, I might have gotten the name of the file wrong.

Well, i'm pretty much stuck. There is no such file as you describe (no .a file that has anything to do with boost or filesystem) in my HD, and i don't know if i really succeded in building boost or not. I'm not sure, how would i know, if i did succed. I posted a message on one of the boost mailing lists asking how do i know, if the build did succed, but no answer.
What to do next?