adding custom vertices to a boost graph

I don’t understand what you want to do exactly. Do you want to associate some data to vertices? Then use bundled properties. //Define a class that has the data you want to associate to every vertex and edge struct Vertex{ int foo;} struct Edge{std::string blah;} //Define the graph using those classes typedef boost::adjacency_list<boost::listS, boost::vecS, boost::directedS, … Read more

Feeding a Python list into a function taking in a vector with Boost Python

There are a few solutions to accomplish this without having to modify the original functions. To accomplish this with a small amount of boilerplate code and transparency to python, consider registering a custom converter. Boost.Python uses registered converters when going between C++ and Python types. Some converters are implicitly created when creating bindings, such as … Read more

Generating Spirit parser expressions from a variadic list of alternative parser expressions

Thank you for a quick hint! I’ve just tried your code and unless I do something wrong … I get this output: Syntax error:abc 8.81 Parsed:-a atoken Syntax error:-b btoken Syntax error:-c ctoken Syntax error:-d dtoken – G. Civardi 2 hours ago Okay, so, I couldn’t leave it alone :/ Turns out there was Undefined … Read more

Building Boost 1.52 with MinGW

Yes, that is correct. However there would have been a simpler, yet identical way; your steps until the bjam call are automatically done by bootstrap.bat: C:\boost_1_52_0> bootstrap.bat mingw Building Boost.Build engine … C:\boost_1_52_0> b2 toolset=gcc If not explicitly specified, the libraries will be placed into the stage\lib directory, include path is the installation root. To … Read more

Cmake doesn’t find Boost

Are you sure you are doing it the correct way? The idea is that CMake sets BOOST_INCLUDE_DIR, BOOST_LIBRARYDIR and BOOST_ROOT automatically. Do something like this in CMakeLists.txt: FIND_PACKAGE(Boost) IF (Boost_FOUND) INCLUDE_DIRECTORIES(${Boost_INCLUDE_DIR}) ADD_DEFINITIONS( “-DHAS_BOOST” ) ENDIF() If boost is not installed in a default location and can, thus, not be found by CMake, you can tell … Read more

How do you add Boost libraries in CMakeLists.txt?

Put this in your CMakeLists.txt file (change any options from OFF to ON if you want): set(Boost_USE_STATIC_LIBS OFF) set(Boost_USE_MULTITHREADED ON) set(Boost_USE_STATIC_RUNTIME OFF) find_package(Boost 1.45.0 COMPONENTS *boost libraries here*) if(Boost_FOUND) include_directories(${Boost_INCLUDE_DIRS}) add_executable(progname file1.cxx file2.cxx) target_link_libraries(progname ${Boost_LIBRARIES}) endif() Obviously you need to put the libraries you want where I put *boost libraries here*. For example, if you’re … Read more