Jump to content

Compilation error


Atrik
 Share

Recommended Posts

I'm not able to compile a28 or main, the compilation fail with this error:

../../../source/scriptinterface/ModuleLoader.h:86:15:   required from here
/usr/include/c++/11/bits/stl_pair.h:218:11: error: ‘std::pair<_T1, _T2>::second’ has incomplete type
  218 |       _T2 second;                ///< The second member
      |           ^~~~~~
In file included from ../../../source/dapinterface/DapInterface.cpp:30:
../../../source/scriptinterface/ModuleLoader.h:50:15: note: forward declaration of ‘class Script::ModuleLoader::CompiledModule’
   50 |         class CompiledModule;
      |               ^~~~~~~~~~~~~~
make[1]: *** [atlas.make:233: obj/atlas_Release/MiscHandlers.o] Error 1
make[1]: *** Waiting for unfinished jobs....
JSInterface_GameView.cpp
JSInterface_Renderer.cpp
make[1]: *** [engine.make:390: obj/engine_Release/CConsole.o] Error 1
make: *** [Makefile:122: engine] Error 2
AtlasObjectJS.cpp
make[1]: *** [graphics.make:417: obj/graphics_Release/FontManager.o] Error 1
make[1]: *** Waiting for unfinished jobs....
CCmpMotionBall.cpp
make[1]: *** [simulation2.make:371: obj/simulation2_Release/CCmpAIManager.o] Error 1
make[1]: *** Waiting for unfinished jobs....
AtlasObjectText.cpp
CommonConvert.cpp
make[1]: *** [dapinterface.make:142: obj/dapinterface_Release/DapInterface.o] Error 1
make: *** [Makefile:92: dapinterface] Error 2

Some time ago I already had this error when compiling main, and though it was because of some WIP, but now I'm guessing the problem is on my end since it's still here. What am I doing wrong? Debian build

Thanks

Edited by Atrik
  • Sad 1
Link to comment
Share on other sites

12 hours ago, phosit said:

That do fix the error, but compilation fails later with another forward declaration and a bunch of new errors too.
I have clang 18.1.8, rusc 1.91.0

Spoiler

error: ‘constexpr void fmt::v8::basic_format_parse_context<Char, ErrorHandler>::on_error(const char*) [with Char = char; ErrorHandler = fmt::v8::detail::error_handler]’ called in a constant expression
 2201 |     context_.on_error(message);
      |     ~~~~~~~~~~~~~~~~~^~~~~~~~~
/usr/include/fmt/core.h:692:22: note: ‘constexpr void fmt::v8::basic_format_parse_context<Char, ErrorHandler>::on_error(const char*) [with Char = char; ErrorHandler = fmt::v8::detail::error_handler]’ is not usable as a ‘constexpr’ function because:
  692 |   FMT_CONSTEXPR void on_error(const char* message) {
      |                      ^~~~~~~~
/usr/include/fmt/core.h:693:27: error: call to non-‘constexpr’ function ‘void fmt::v8::detail::error_handler::on_error(const char*)’
  693 |     ErrorHandler::on_error(message);
      |     ~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~
/usr/include/fmt/core.h:618:29: note: ‘void fmt::v8::detail::error_handler::on_error(const char*)’ declared here
  618 |   FMT_NORETURN FMT_API void on_error(const char* message);
      |                             ^~~~~~~~
../../../source/graphics/MapGenerator.cpp:401:110: error: no matching function for call to ‘std::runtime_error::runtime_error(<brace-enclosed initializer list>)’
  401 |                 throw std::runtime_error{fmt::format("Loading module {:?} takes too long.", script.string8())};
      |         

[...]

/usr/include/fmt/core.h:2201:22: error: ‘constexpr void fmt::v8::basic_format_parse_context<Char, ErrorHandler>::on_error(const char*) [with Char = char; ErrorHandler = fmt::v8::detail::error_handler]’ called in a constant expression
 2201 |     context_.on_error(message);
      |     ~~~~~~~~~~~~~~~~~^~~~~~~~~
../../../source/graphics/MapGenerator.cpp:418:48: error: no matching function for call to ‘std::runtime_error::runtime_error(<brace-enclosed initializer list>)’
  418 |                                 GENERATOR_NAME)};
      |                                                ^
In file included from /usr/include/c++/11/system_error:41,
                 from /usr/include/c++/11/bits/std_mutex.h:39,
                 from /usr/include/c++/11/bits/atomic_wait.h:49,
                 from /usr/include/c++/11/bits/atomic_base.h:41,
                 from /usr/include/c++/11/atomic:41,
                 from ../../../source/lib/debug.h:45,
                 from ../../../source/lib/precompiled.h:70,
                 from ../../../source/pch/graphics/precompiled.h:18:
/usr/include/c++/11/stdexcept:237:5: note: candidate: ‘std::runtime_error::runtime_error(const std::runtime_error&)’
  237 |     runtime_error(const runtime_error&) _GLIBCXX_NOTHROW;
      |     ^~~~~~~~~~~~~     

 

Link to comment
Share on other sites

11 minutes ago, Atrik said:

I have clang 18.1.8, rusc 1.91.0

I think you are using gcc instead, if you want to use clang you have to set CXX environment variable or pass --cc=clang to update-workspace.sh, also your gcc version is likely older then gcc-12.

  • Like 1
Link to comment
Share on other sites

1 hour ago, hyperion said:

if you want to use clang you have to set CXX environment variable or pass --cc=clang to update-workspace.sh, also your gcc version is likely older then gcc-12.

Thanks, so what I've tried now is 

./update-workspaces.sh --cc=gcc-12
cd gcc
make

And

./update-workspaces.sh --cc=clang-18
cd gcc #Can't see any other folders
make

 

If i pass a compiler version i don't have to update-workspaces.sh, it tell me so. Therefor I'm guessing i do have to compiler I'm passing above.
Yet compilation fails in both cases.
 

With gcc 

/usr/include/fmt/core.h:2201:22: error: ‘constexpr void fmt::v8::basic_format_parse_context<Char, ErrorHandler>::on_error(const char*) [with Char = char; ErrorHandler = fmt::v8::detail::error_handler]’ called in a constant expression
 2201 |     context_.on_error(message);

With clang

In file included from ../../../source/ps/GameSetup/GameSetup.cpp:84:
../../../source/scriptinterface/FunctionWrapper.h:518:6: error: call to consteval function 'fmt::basic_format_string<char, std::basic_string<char> &>::basic_format_string<char[51], 0>' is not a constant expression
  518 |                                         "Failed defining function {:?} on the native scope.", classInfo->name)};
      |                                         ^

 

Edited by Atrik
Link to comment
Share on other sites

Can you add verbose to your build command like "make -C build/workspaces/gcc verbose=1" so we see the actual build command run.

Also what output do you get for "g++ --version" and "clang++ --version"?

 

Side note, premake --cc option with version, ie gcc-12 isn't documented and broken in some cases. Typically if you use binutils you wont have an corresponding ar-12 for example which it would look for.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...