Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Compilation fails using std03 and std14 #1321

@KevinShaughnessy89

Description

@KevinShaughnessy89

I downloaded 0.8.7 from the main site. The CMake file came preconfigured to use std03, and when I attempt to compile using that standard I get compilation errors related to OpenGL which requires that I switch to std11 or std14. Doing that however gives me these errors:

PyCEGUI.main.cpp: In static member function 'static PyObject* CEGUI_String_to_python::convert(const CEGUI::String&)':
/home/kevinshaughnessy89/engine/internal/cegui-0.8.7/cegui/src/ScriptModules/Python/bindings/output/CEGUI/PyCEGUI.main.cpp:735:51: error: 'const CEGUI::String' {aka 'const class std::__cxx11::basic_string<char>'} has no member named 'ptr'
735 |             PyUnicode_DecodeUTF32((const char*)(s.ptr()), s.length() * sizeof(CEGUI::utf32), "replace", &byteorder)

usr/include/c++/13/bits/basic_string.h:641:7: note:   conversion of argument 1 would be ill-formed:
/home/kevinshaughnessy89/engine/internal/cegui-0.8.7/cegui/src/ScriptModules/Python/bindings/output/CEGUI/PyCEGUI.main.cpp:798:41: error: invalid conversion from 'const CEGUI::utf8*' {aka 'const unsigned char*'} to 'const char*' [-fpermissive]
798 |             new (storage) CEGUI::String(value);
|                                         ^~~~~
|                                         |
|                                         const CEGUI::utf8* {aka const unsigned char*}

/cegui-0.8.7/cegui/src/ScriptModules/Python/bindings/output/CEGUI/PyCEGUI.main.cpp: In static member function 'static void CEGUI_String_from_python::construct(PyObject*, boost::python::converter::rvalue_from_python_stage1_data*)':
/home/kevinshaughnessy89/engine/internal/cegui-0.8.7/cegui/src/ScriptModules/Python/bindings/output/CEGUI/PyCEGUI.main.cpp:798:46: error: no matching function for call to 'std::__cxx11::basic_string<char>::basic_string(const CEGUI::utf8*&)'
798 |             new (storage) CEGUI::String(value);
|                                              

It looks like the code is trying to use a ptr() method on a std::string object which doesn't exist in the C++11 (and later) versions of the standard library. Because of the OpenGL problem though I can't use std03.

I'm using g++ 13.2.0 and cmake 3.28.3 on Xubuntu (the latest release).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions