Skip to content
New issue

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

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

Already on GitHub? # to your account

c++ standard ignored in MSVC #180

Open
ChristosT opened this issue Apr 15, 2024 · 0 comments
Open

c++ standard ignored in MSVC #180

ChristosT opened this issue Apr 15, 2024 · 0 comments

Comments

@ChristosT
Copy link

It looks like the c++ standard is ignored if provided via the cflags when using MSVC

The example below fails in MSVC but success with gcc (10.5):

from pygccxml import parser
from pygccxml import utils

generator_path, generator_name = utils.find_xml_generator()

print(f"f{generator_path=}")
print(f"f{generator_name=}")
header="""
#include <variant>
std::variant<int, double, float> value;
"""

config = parser.xml_generator_configuration_t(
        xml_generator_path=generator_path,
        xml_generator=generator_name,
        cflags="-std=c++17",

)
parsed_declarations = parser.parse_string(
	header,
        config,
 )

Error:

C:\Users\User\AppData\Local\Temp\tmp9050xy28.h:3:6: error: no template named 'variant' in namespace 'std'
std::variant<int, double, float> value;
~~~~~^
1 error generated.

Using

castxml            0.4.5
pygccxml           2.5.0

and MSVC 19.39.33522

daniel-riehm pushed a commit to daniel-riehm/kwiver that referenced this issue Mar 4, 2025
Due to CastXML/pygccxml#180
we cannot generate the python wrappings on windows using MSVC and C++17.
In the meantime we apply the compose the castxml command ourselves and run it
as part of the script.  At this point pygccxml is used only to parse the generated xml
file.
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant