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

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: using boost/filesystem
« Reply #15 on: July 18, 2008, 02:24:03 am »
What to do next?
Although providing support for 3rd party libraries is (as previously stated) outside the purview of the C::B forums, I think a quick-start guide for Boost+C::B would not go amiss in the Wiki. In the meantime, I'll also send you a personal message as soon I've rebuilt Boost myself.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline joubertdj

  • Multiple posting newcomer
  • *
  • Posts: 120
Re: using boost/filesystem
« Reply #16 on: July 18, 2008, 08:19:47 am »
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\

I notice you use space within your directories ... when you use space remember to reference that with the 8.3 convention then it will "find" the files, else it will not find them ... I personally use D:\Sources\Boost, and D:\MingW, and D:\CodeBlocks ...

Best Regards,

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: using boost/filesystem
« Reply #17 on: July 18, 2008, 06:56:13 pm »
For those interested, a BoostWindowsQuickRef article is now available in the Wiki.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: using boost/filesystem
« Reply #18 on: July 18, 2008, 10:15:25 pm »
For those interested, a BoostWindowsQuickRef article is now available in the Wiki.
Well done TDragon, nice work!
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline kanesoban

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: using boost/filesystem
« Reply #19 on: July 19, 2008, 04:28:44 pm »
Ok, i relocated everything, so that there are no spaces in paths (i reinstalled Codeblocks too), and i followed the Wiki exactly as it is written. No luck, though. I was trying to compile the example program here (it requires the regex library):

http://www.boost.org/doc/libs/1_35_0/more/getting_started/windows.html#link-your-program-to-a-boost-library

Message:

C:\C++\Proba_boost\main.cpp|1|boost/regex.hpp: No such file or directory|

Now, that i am looking at the bjam output, while it is a big mess, i can see a lot of g++ related "failed" messages.
By the way, g++ is in my PATH, wich looks like this:

%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\CodeBlocks\MinGW\bin;C:\boost_1_35_0;

I also tried removing the semicolon from the end of PATH, and then executing bjam, but that didn't help either.

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: using boost/filesystem
« Reply #20 on: July 19, 2008, 05:07:12 pm »
Okay, the article is not quite right. I forgot about the "boost-1_35" subfolder in the includes directory. Will now correct it.

You can either (A) add the "boost" global variable and project search folders as per the skipped steps in the Wiki article, using "C:\CodeBlocks\include\boost-1_35" for the include field ("C:\CodeBlocks" for the base field), or (B) add "C:\CodeBlocks\include\boost-1_35" directly to your project's Compiler search directories.

Really, though, you should have been able to figure that out on your own. It's as simple as seeing that you want to include boost/regex.hpp, and seeing that the path boost/regex.hpp is in C:\CodeBlocks\include\boost-1_35.

Now, that i am looking at the bjam output, while it is a big mess, i can see a lot of g++ related "failed" messages.
This may or may not be normal. Hopefully the libraries you want are getting built.
« Last Edit: July 19, 2008, 05:23:33 pm by TDragon »
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline kanesoban

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: using boost/filesystem
« Reply #21 on: July 20, 2008, 01:49:21 pm »
Well, i first did A, and got this while compiling the project:

C:\CodeBlocks\MinGW\bin\ld.exe: cannot find -lboost_regex-mgw34-mt-1_35.lib

With option B it was the same error.

I tried googling what can cause this type of error, but no luck so far.

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: using boost/filesystem
« Reply #22 on: July 20, 2008, 03:54:49 pm »
C:\CodeBlocks\MinGW\bin\ld.exe: cannot find -lboost_regex-mgw34-mt-1_35.lib
this error indicates that you entered "boost_regex-mgw34-mt-1_35.lib" into the linker options which is wrong. please enter "boost_regex-mgw34-mt-1_35" (notice the missing ".lib").

In addition: You are using the MinGW compiler, right? I wonder why you get ".lib" files when you compile Boost. Using MinGW you should have compiled ".a" files...?! Probably you are mixing MinGW compilation with some unsupported format (e.g. you compiled boost wit a compiler that is not compatible with MinGW)???
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline TDragon

  • Lives here!
  • ****
  • Posts: 943
    • TDM-GCC
Re: using boost/filesystem
« Reply #23 on: July 20, 2008, 04:36:19 pm »
In addition: You are using the MinGW compiler, right? I wonder why you get ".lib" files when you compile Boost. Using MinGW you should have compiled ".a" files...?! Probably you are mixing MinGW compilation with some unsupported format (e.g. you compiled boost wit a compiler that is not compatible with MinGW)???

Nope, Boost Build causes GCC to create .lib files as of Boost 1.35.
https://jmeubank.github.io/tdm-gcc/ - TDM-GCC compiler suite for Windows (GCC 9.2.0 2020-03-08, 32/64-bit, no extra DLLs)

Offline MortenMacFly

  • Administrator
  • Lives here!
  • *****
  • Posts: 9694
Re: using boost/filesystem
« Reply #24 on: July 20, 2008, 05:11:20 pm »
Nope, Boost Build causes GCC to create .lib files as of Boost 1.35.
I just tried: Indeed! ...how weired. :shock: That surely will cause some trouble. Strange they decided to do so.
The include folder also looks pretty strange include\boost\boost-1_35??? Huh? I just moved the files directly to boost and it seems to work as well.
Compiler logging: Settings->Compiler & Debugger->tab "Other"->Compiler logging="Full command line"
C::B Manual: https://www.codeblocks.org/docs/main_codeblocks_en.html
C::B FAQ: https://wiki.codeblocks.org/index.php?title=FAQ

Offline Hitnrun

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: using boost/filesystem
« Reply #25 on: July 21, 2008, 05:17:47 pm »
Here is my boost compilling recipe (I'm using 1.34):

Code
- using msys
- go to boost root dir
# cd tools/jam/src
# ./build.sh
- go back to boost root dir
# tools/jam/src/bin.ntx86/bjam toolset=gcc variant=release threading=multi link=static stage

Offline kanesoban

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: using boost/filesystem
« Reply #26 on: July 24, 2008, 04:14:39 pm »
Quote
this error indicates that you entered "boost_regex-mgw34-mt-1_35.lib" into the linker options which is wrong. please enter "boost_regex-mgw34-mt-1_35" (notice the missing ".lib").

It is still giving the same message.

Offline kanesoban

  • Multiple posting newcomer
  • *
  • Posts: 10
Re: using boost/filesystem
« Reply #27 on: July 24, 2008, 05:11:00 pm »
Ok, well it seems i finally managed to compile it !

You see, the problem was, that boost build gave wrong names to some of the library files it built.
Most of the built library files look like this:
boost_*-mgw34-mt
However, for some odd reason, the regex library file (and only that) looked like this:
libboost_regex-mgw34-mt
Once i renamed it, so there is no "lib" prefix, Codeblocks was able to compile it.