Jump to content

[v2.4.1 -> 2.15.1] Error at compile time in header file


photo

Recommended Posts

Hi there Team.

I'm switching an application prototype from 2.4.1 to 2.15.1 to know what I must to change in our set of simulators build in the old 2.4.1 version, and I'm getting and compile time error in one of your header files UnigineBase.h

template <class F>
struct YCombinator
{
  template <class... Args>
  decltype(auto) operator()(Args&&... args) const
  {
    return f(std::ref(*this), std::forward<Args>(args)...);
  }
  
  F f;
}

In this code the compiler sais that type auto must to be an expression not a type.

Also in the next

template <class F>
YCombinator<std::decay_t<F>> makeRecursiveLambda(F &&f)
{
  return [std:forward<F>(f)};
}

Compiler sais that std::decay_t don't belong to std

 

I don't know what could be happening but I gess that it could be because the C++ version.

We are using C++11, What are the C++ version supposed to be used with the v2.15.1 of Unigine?

Link to comment

Hello!

Quote

 

I don't know what could be happening but I gess that it could be because the C++ version.

We are using C++11, What are the C++ version supposed to be used with the v2.15.1 of Unigine?

 

@Gmarquez At the moment with the SDK 2.15.1 we are on C++14 and plan to keep it for a while for sure. 

Looks like your issue should be solved at the same time as you switch from C++11.

You can also might try to add following line at the top of the UnigineBase header:

#include <type_traits>

Thanks!

  • Thanks 1
Link to comment
1 hour ago, bmyagkov said:

Hello!

@Gmarquez At the moment with the SDK 2.15.1 we are on C++14 and plan to keep it for a while for sure. 

Looks like your issue should be solved at the same time as you switch from C++11.

You can also might try to add following line at the top of the UnigineBase header:

#include <type_traits>

Thanks!

Thank you, it works.

It didn't worked, At first sight it looks like worked but somehow the sim_linux version swithced to 2.4.1, I don't know why.

Once the sim_linux version get fixed to the 2.15.1, the error comes again

Edited by Gmarquez
Link to comment
3 hours ago, Gmarquez said:

Thank you, it works.

It didn't worked, At first sight it looks like worked but somehow the sim_linux version swithced to 2.4.1, I don't know why.

Once the sim_linux version get fixed to the 2.15.1, the error comes again

Check out UnigineBase header again. If you are upgraded your project from 2.4.1 to 2.15.1 then includes files might be overwritten by the default one.

The most correct way to solve the issue would be switch to C++14 instead of using C++11 since there might be a lot of the other places which requires fixes to make things works again without switching :)

P.S If you're using cmake then you need to add the following line to the CMakeLists.txt:

set(CMAKE_CXX_STANDARD 14)

And for QT based project standard should be switched here:

image.png

Thanks!

  • Thanks 1
Link to comment
×
×
  • Create New...