Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to generate xml with Boost on Windows and MSVC #36

Closed
espdev opened this issue Nov 11, 2015 · 4 comments
Closed

Unable to generate xml with Boost on Windows and MSVC #36

espdev opened this issue Nov 11, 2015 · 4 comments

Comments

@espdev
Copy link

espdev commented Nov 11, 2015

Hi, everyone!

I'm trying to generate Python wrappings via WrapITK for my C++ project. The project also uses Boost libraries. I'm getting the following errors while generating xml for sources that include Boost headers:

In file included from C:/Boost/boost/filesystem.hpp:16:
In file included from C:/Boost/boost/filesystem/path.hpp:25:
In file included from C:/Boost/boost/filesystem/path_traits.hpp:22:
In file included from C:/Boost/boost/type_traits/decay.hpp:18:
In file included from C:/Boost/boost/mpl/eval_if.hpp:17:
C:/Boost/boost/mpl/if.hpp:131:1: error: pasting formed 'BOOST_PP_TUPLE_ELEM_O_3(', an invalid preprocessing token [-Winvalid-token-paste]
BOOST_MPL_AUX_NA_SPEC(3, if_)
^
C:/Boost/boost/mpl/aux_/na_spec.hpp:161:40: note: expanded from macro 'BOOST_MPL_AUX_NA_SPEC'
#define BOOST_MPL_AUX_NA_SPEC(i, name) \
                                       ^
C:/Boost/boost/mpl/aux_/na_spec.hpp:154:47: note: expanded from macro '\
BOOST_MPL_AUX_NA_SPEC_NO_ETI'
#define BOOST_MPL_AUX_NA_SPEC_NO_ETI(i, name) \
                                              ^
C:/Boost/boost/mpl/aux_/na_spec.hpp:65:9: note: expanded from macro '\
BOOST_MPL_AUX_NA_SPEC_MAIN'
        BOOST_MPL_PP_NESTED_DEF_PARAMS_TAIL(i, typename T, na) \
        ^
note: (skipping 5 expansions in backtrace; use -fmacro-backtrace-limit=0 to see all)
C:/Boost/boost/preprocessor/tuple/elem.hpp:26:42: note: expanded from macro 'BOOST_PP_TUPLE_ELEM'
#        define BOOST_PP_TUPLE_ELEM(...) BOOST_PP_TUPLE_ELEM_I(BOOST_PP_OVERLOAD(BOOST_PP_TUPLE_ELEM_O_, __VA_ARGS__), (__VA_ARGS__))
                                         ^
C:/Boost/boost/preprocessor/tuple/elem.hpp:27:48: note: expanded from macro 'BOOST_PP_TUPLE_ELEM_I'
#        define BOOST_PP_TUPLE_ELEM_I(m, args) BOOST_PP_TUPLE_ELEM_II(m, args)
                                               ^
C:/Boost/boost/preprocessor/tuple/elem.hpp:28:64: note: expanded from macro 'BOOST_PP_TUPLE_ELEM_II'
#        define BOOST_PP_TUPLE_ELEM_II(m, args) BOOST_PP_CAT(m ## args,)
                                                               ^

I use Windows 7/8.1 x64 and MS VisualStudio 2013. Boost 1.56

CastXML Version:

castxml version 0.1-g2e55b35

CastXML project maintained and supported by Kitware (kitware.com).

clang version 3.7.0 (tags/RELEASE_370/rc1)
Target: x86_64-pc-windows-msvc
Thread model: posix

(Prebuilt windows binary from here)

@bradking
Copy link
Member

I think the problem is that CastXML is a Clang parser but is simulating MSVC's preprocessor, so Boost's preprocessor library is using MSVC-specific code instead of its implementation for Clang. In the past with gccxml this worked because the Boost headers gained explicit knowledge of gccxml here.

Something similar may be needed for CastXML, but currently CastXML does not define any macro to identify itself.

@bradking
Copy link
Member

bradking commented Dec 3, 2015

CastXML does not define any macro to identify itself.

Commit d2ef49b adds predefined macros that identify both CastXML and the internal Clang version against which it was built. This provides enough information for the Boost preprocessor library to adapt (via boost/config/select_compiler_config.hpp) to the CastXML preprocessor behavior.

Actually modifying Boost with this information is beyond the scope of CastXML development.

@bradking bradking closed this as completed Dec 3, 2015
@espdev
Copy link
Author

espdev commented Dec 4, 2015

@bradking thank you!
I will send an issue to Boost to support CastXML preprocessor behavior.

@ibrawada
Copy link

Hi,

I'm currently facing these issues. Boost doesn't have CastXML support. Is there any workaround that I could use?

I use: Window 10, Boost 1.70, msvc2022, CastXML 0.4.3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants