# C++ and Boost

This topic is 3346 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

Quote:
 bjam --toolset=gcc "--prefix=C:\Program Files\CodeBlocks" install
But I received (below) upon completion.
Quote:
 ...failed updating 16 targets... ...skipped 9 targets... ...updated 12 targets...
This was an error I found within the cmd window
Quote:
 ...failed gcc.compile.c++ bin.v2\libs\serialization\build\gcc-mingw-3.4.5\releas e\link-static\threading-multi\xml_woarchive.o... . . wide char i/o not supported on this platform
So serialization is failing and its due to some Wide Char Support missing. Do you guys have any ideas? I searched google... I searched everywhere and I'm out of luck.

##### Share on other sites
Quote:
 Please help me understand why you would go with the Microsoft compiler in windows when the entire aim for Boost its cross platform ability.

Because if the code is cross-platform, I can use it with any (serious) compiler. And on Windows, I find the Visual Studio IDE to be vastly superior to all other options, and the GCC compiler to be equivalent enough in functionality to cl.exe that it's not work hooking up GCC to VS unless I have to (i.e., PSP programming). The point of cross-platform code is that it can be used (compiled) on multiple platforms with multiple tools -- that has no bearing on whether or not the tool ultimately used to compile it is cross-platform or not.

##### Share on other sites
I am using MingW 4.4.0 (you should really upgrade) and Boost 1.39, and I had an issue with wide characters that I could not find a solution to anywhere on the internet.

What worked for me was to comment out the lines 159 and 166 in the file mingw\lib\gcc\mingw32\4.4.0\include\c++\cwchar. Here is how my modified file looks, starting from line 157 to give some context:
  using ::putwc;  using ::putwchar;//  using ::swprintf; // DOES NOT COMPILE FOR WHATEVER REASON  using ::swscanf;  using ::ungetwc;  using ::vfwprintf;#if _GLIBCXX_HAVE_VFWSCANF  using ::vfwscanf;#endif//  using ::vswprintf; // DOES NOT COMPILE FOR WHATEVER REASON#if _GLIBCXX_HAVE_VSWSCANF  using ::vswscanf;#endif  using ::vwprintf;#if _GLIBCXX_HAVE_VWSCANF  using ::vwscanf;#endif

Of course I'd prefer a real solution, but it works for me.

Oh, I may have misunderstood. You are compiling Boost? I was merely using the templates.

##### Share on other sites
Quote:
 Original post by DevFredI am using MingW 4.4.0 (you should really upgrade) and Boost 1.39, and I had an issue with wide characters that I could not find a solution to anywhere on the internet.What worked for me was to comment out the lines 159 and 166 in the file mingw\lib\gcc\mingw32\4.4.0\include\c++\cwchar. Here is how my modified file looks, starting from line 157 to give some context: using ::putwc; using ::putwchar;// using ::swprintf; // DOES NOT COMPILE FOR WHATEVER REASON using ::swscanf; using ::ungetwc; using ::vfwprintf;#if _GLIBCXX_HAVE_VFWSCANF using ::vfwscanf;#endif// using ::vswprintf; // DOES NOT COMPILE FOR WHATEVER REASON#if _GLIBCXX_HAVE_VSWSCANF using ::vswscanf;#endif using ::vwprintf;#if _GLIBCXX_HAVE_VWSCANF using ::vwscanf;#endifOf course I'd prefer a real solution, but it works for me.Oh, I may have misunderstood. You are compiling Boost? I was merely using the templates.

I'm compiling the Boost libraries ('bjam' command I used above).. and apparently there's 37 library files which it places in the "...\CodeBlocks\lib\" folder but a few of them failed. But now you're confusing me because you're saying that I can simply skip installing the libraries? After I got some of these libraries installed, I just pointed my Code Blocks IDE's Global Variables to the libraries which successfully installed. Problem is that not all Boost tutorials are compiling in here... :(

##### Share on other sites
I have never compiled boost, because 95% of it are templates anyway, and you can't compile those in the sense that you compile other libraries. I just moved the boost folder in my include directory and everything was fine.

##### Share on other sites
Is that really a big issue if some libraries fail to build?
Weren't you interested just in asio? Why are you even compiling the whole stuff?

##### Share on other sites
Quote:
Original post by jpetrie
Quote:
 Please help me understand why you would go with the Microsoft compiler in windows when the entire aim for Boost its cross platform ability.

Because if the code is cross-platform, I can use it with any (serious) compiler. And on Windows, I find the Visual Studio IDE to be vastly superior to all other options, and the GCC compiler to be equivalent enough in functionality to cl.exe

This. When I write code, I use visual studio when I can. When I compile for *nix, I use gcc. Using Microsoft's IDE doesn't make you any less cross platform.

##### Share on other sites
Quote:
 Original post by Telastyn Using Microsoft's IDE doesn't make you any less cross platform.

Okay done, installation for VS 2008 was way too easy. They have the binaries already made for you. I'm just hoping you're right about that statament when I go to compile my code within Linux, 3 months from now.

##### Share on other sites
Remember you don't need to compile the whole boost stuff. Creating a library project and throwing the required (specific) files for a boost library into it should compile just fine, and ultimately, that's all that you need.

Most commonly used Linux distros come with the boost libraries already compiled and installed.

##### Share on other sites
Quote:
 I'm just hoping you're right about that statament when I go to compile my code within Linux, 3 months from now.

You should test your code on all target platforms on a regular basis. This helps getting things correct, since sometimes GCC refuses some code and sometimes MSVC does.
If you use CMake or Boost.Build this is fairly easy to do.

1. 1
2. 2
Rutin
19
3. 3
4. 4
5. 5
frob
13

• 9
• 15
• 10
• 9
• 17
• ### Forum Statistics

• Total Topics
632602
• Total Posts
3007363

×