Author Topic: using boost/filesystem  (Read 22464 times)

Offline kanesoban

  • Multiple posting newcomer
  • *
  • Posts: 10
using boost/filesystem
« on: July 08, 2008, 10:26:56 pm »
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.


Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9508
Re: using boost/filesystem
« Reply #1 on: July 08, 2008, 10:47:03 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: http://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: http://wiki.codeblocks.org/index.php?title=FAQ

Offline killerbot

  • Administrator
  • Lives here!
  • *****
  • Posts: 5193
Re: using boost/filesystem
« Reply #2 on: July 08, 2008, 11:35:24 pm »
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 :-) :-)

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: using boost/filesystem
« Reply #3 on: July 09, 2008, 03:31:56 am »
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.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline kanesoban

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: using boost/filesystem
« Reply #4 on: July 09, 2008, 04:03:46 pm »
"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 ?

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: using boost/filesystem
« Reply #5 on: July 09, 2008, 06:15:27 pm »
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:
Code: [Select]
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.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline kanesoban

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: using boost/filesystem
« Reply #6 on: July 11, 2008, 09:50:01 pm »
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\

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: using boost/filesystem
« Reply #7 on: July 12, 2008, 12:09:11 am »
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.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline kanesoban

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: using boost/filesystem
« Reply #8 on: July 14, 2008, 06:16:20 pm »
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.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: using boost/filesystem
« Reply #9 on: July 14, 2008, 08:18:35 pm »
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.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline dje

  • Lives here!
  • ****
  • Posts: 683
Re: using boost/filesystem
« Reply #10 on: July 14, 2008, 09:29:14 pm »
Could you give more details on
Quote
some basic programming concepts
?  :lol: :lol: :lol:

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: using boost/filesystem
« Reply #11 on: July 15, 2008, 05:13:39 am »
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.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline kanesoban

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: using boost/filesystem
« Reply #12 on: July 15, 2008, 11:29:19 am »
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.

Quote
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.

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

Quote
Then, 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

Offline TDragon

  • Lives here!
  • ****
  • Posts: 936
    • Twilight Dragon Media
Re: using boost/filesystem
« Reply #13 on: July 15, 2008, 05:41:18 pm »
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.
http://tdm-gcc.tdragon.net/ - TDM-GCC compiler suite for Windows (GCC 5.1.0 2015-06-28, 32/64-bit, no extra DLLs)

Offline kanesoban

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: using boost/filesystem
« Reply #14 on: July 17, 2008, 08:03:08 pm »
Quote
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.

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?