Welcome! Log In Create A New Profile

Advanced

Boost Libraries

Posted by musicinstinct 
Boost Libraries
May 13, 2009 11:21AM
Has anyone managed to use the Boost libraries with devkitPPC? [www.boost.org]

I would have thought at least the "header only" parts should just work straight out of the box, but I get lots of errors like this:

error: expected '=', ',', ';', 'asm' or '__attribute__' before 'boost'

That error is repeated many times over, when attempting to compile even the simplest of example progs using one of the header only parts of the library. Eg, this simple example:

#include 
#include 
#include 
#include 

int main()
{
    using namespace boost::lambda;
    typedef std::istream_iterator in;

    std::for_each(
        in(std::cin), in(), std::cout << (_1 * 3) << " " );
}
Re: Boost Libraries
May 14, 2009 09:47PM
What's the rest of the output when you try to compile that example? And what's the exact command that runs to create that output.

I have limited experience with this as I was working on an aleph one port for the psp which used the boost library (headers only) I got it to compile fine but someone else was working on their version simultaneously and released his first lol.
Re: Boost Libraries
May 15, 2009 09:24AM
I know i accidentally included boost in .C files. I was absolutely clueless what the error messages meant.
Not everything may work but i do know shared_ptr works and i assume many other libs work.
Re: Boost Libraries
May 16, 2009 12:55PM
In this file (part of Boost):

boost/config/no_tr1/utility.hpp

There is this include:

#ifndef BOOST_CONFIG_UTILITY
#  define BOOST_CONFIG_UTILITY

#  ifndef BOOST_TR1_NO_RECURSION
#     define BOOST_TR1_NO_RECURSION
#     define BOOST_CONFIG_NO_UTILITY_RECURSION
#  endif

#  include <utility>

#  ifdef BOOST_CONFIG_NO_UTILITY_RECURSION
#     undef BOOST_TR1_NO_RECURSION
#     undef BOOST_CONFIG_NO_UTILITY_RECURSION
#  endif

#endif

Which causes this error:

... devkitpro/libogc/include/boost/config/no_tr1/utility.hpp:21:21: warning: utility: No such file or directory

Anyone help find the missing include file?
Re: Boost Libraries
May 20, 2009 04:28PM
In boost/config/select_stdlib_config.hpp

comment out #include boost/config/no_tr1/utility.hpp

and try #define'ing BOOST_STDLIB_CONFIG "boost/config/stdlib/libstdcpp3.hpp"



Edited 1 time(s). Last edit at 05/20/2009 04:28PM by MrPeanut.
Re: Boost Libraries
May 21, 2009 09:27AM
Thanks MtPeanut - that solved the first warning in the output - about utility.hpp - which I thought might have something to do with all the other errors.

Unfortunately not, I'm still getting tons of "error: expected '=', ',', ';', 'asm' or '__attribute__' before 'boost'" from most of the boost hpp files.
Re: Boost Libraries
May 21, 2009 03:23PM
hrmm.. utility is a file included with the C++ standard library and should be on your computer

// Test file to see if I have 

#include 
#include         // this says utility

int main(int argc, char *argv[])
{
     std::cout << "test\n";
     return 1;
}



And it works


C:\Projects>make
test.cpp
Using built-in specs.
Target: powerpc-gekko
Configured with: ../../gcc-4.2.4/configure --enable-languages=c,c++,objc --with-
cpu=750 --without-headers --disable-nls --disable-shared --enable-threads --disa
ble-multilib --disable-win32-registry --disable-libstdcxx-pch --target=powerpc-g
ekko --with-newlib --prefix=c:/devkitPro/devkitPPC --disable-dependency-tracking
 --with-bugurl=http://wiki.devkitpro.org/index.php/Bug_Reports --with-pkgversion
=devkitPPC release 17
Thread model: single
gcc version 4.2.4 (devkitPPC release 17)
 c:/devkitpro/devkitppc/bin/../libexec/gcc/powerpc-gekko/4.2.4/cc1plus.exe -quie
t -v -Ic:/Projects/build -Ic:/devkitPro/libogc/include -iprefix c:\devkitpro\dev
kitppc\bin\../lib/gcc/powerpc-gekko/4.2.4/ -MMD test.d -MF c:/Projects/build/tes
t.d -MP -MQ test.o -D__wii__ -DHW_RVL -ffunction-sections -fdata-sections -DGEKK
O c:/Projects/test.cpp -mcall-sysv -quiet -dumpbase test.cpp -mrvl -mcpu=750 -me
abi -mhard-float -auxbase-strip test.o -O2 -Wall -version -o C:/Users/Nick/AppDa
ta/Local/Temp/cccRi5ff.s
ignoring nonexistent directory "c:\devkitpro\devkitppc\bin\../lib/gcc/powerpc-ge
kko/4.2.4/../../../../powerpc-gekko/sys-include"
ignoring nonexistent directory "c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-ge
kko/4.2.4/../../../../powerpc-gekko/sys-include"
#include "..." search starts here:
#include <...> search starts here:
 c:/Projects/build
 c:/devkitPro/libogc/include
 c:\devkitpro\devkitppc\bin\../lib/gcc/powerpc-gekko/4.2.4/../../../../powerpc-g
ekko/include/c++/4.2.4
 c:\devkitpro\devkitppc\bin\../lib/gcc/powerpc-gekko/4.2.4/../../../../powerpc-g
ekko/include/c++/4.2.4/powerpc-gekko
 c:\devkitpro\devkitppc\bin\../lib/gcc/powerpc-gekko/4.2.4/../../../../powerpc-g
ekko/include/c++/4.2.4/backward
 c:\devkitpro\devkitppc\bin\../lib/gcc/powerpc-gekko/4.2.4/include
 c:\devkitpro\devkitppc\bin\../lib/gcc/powerpc-gekko/4.2.4/../../../../powerpc-g
ekko/include
 c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-gekko/4.2.4/../../../../powerpc-g
ekko/include/c++/4.2.4
 c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-gekko/4.2.4/../../../../powerpc-g
ekko/include/c++/4.2.4/powerpc-gekko
 c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-gekko/4.2.4/../../../../powerpc-g
ekko/include/c++/4.2.4/backward
 c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-gekko/4.2.4/include
 c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-gekko/4.2.4/../../../../powerpc-g
ekko/include
End of search list.
GNU C++ version 4.2.4 (devkitPPC release 17) (powerpc-gekko)
        compiled by GNU C version 4.3.0 20080305 (alpha-testing) mingw-20080502.

GGC heuristics: --param ggc-min-expand=99 --param ggc-min-heapsize=130880
Compiler executable checksum: 8ece19643dad013c41621791a7a4ed14
 c:/devkitpro/devkitppc/bin/../lib/gcc/powerpc-gekko/4.2.4/../../../../powerpc-g
ekko/bin/as.exe -mppc -many -V -Qy -o test.o C:/Users/Nick/AppData/Local/Temp/cc
cRi5ff.s
GNU assembler version 2.19.1 (powerpc-gekko) using BFD version (GNU Binutils) 2.
19.1
linking ... boot.elf
output ... boot.dol

C:\Projects>

I recommend reinstalling devkitppc



Edited 2 time(s). Last edit at 05/21/2009 05:11PM by MrPeanut.
Re: Boost Libraries
June 19, 2009 05:39PM
Could somebody take me step by step on how to do this? I don't understand how to cross-compile very well.
Re: Boost Libraries
June 20, 2009 12:08AM
Having a look into this myself. Will report back with instructions if I get anywhere. Hopefully the info here makes it straight forward enough.
Re: Boost Libraries
June 20, 2009 10:14PM
Is it possible to get threading support through Boost? The application I'm trying to port (Gnash) uses Boost and it's threading.
Re: Boost Libraries
June 21, 2009 05:34PM
Quote
matthewbauer
Is it possible to get threading support through Boost? The application I'm trying to port (Gnash) uses Boost and it's threading.

Unfortunately, boost::thread is a compiled library, not header only. Boost also uses "bjam" compatible with Perforce Jam (kinda like make, or ant) so I would have no idea on how to even compile boost::thread targeted for the gekko.

Your best bet (in my opinion) would be to read up on the threading implementation that is within libogc.
Re: Boost Libraries
July 05, 2009 10:37PM
If anyone could help me that would be great. Right now I've just downloaded the hpp files and copied them to my libogc/include folder, but pretty soon I'm going to want to compile it.
Re: Boost Libraries
July 06, 2009 12:12PM
i know AerialX has been able to compile some of the boost libs for wii and that he used a tutorial aimed to compiling boost for ds

[wiibrew.org]
Sorry, only registered users may post in this forum.

Click here to login