CoLab-Glasgow / Coconut

BSD 2-Clause "Simplified" License
0 stars 0 forks source link

error: ‘value’ was not declared in this scope #2

Open pkeir opened 5 months ago

pkeir commented 5 months ago

When I configure CMake, I get two errors. I can fix these by removing the extra space in the names of the " LightSwitch_Example" and "Http_connection " directories; but when I run make I then get an error from the static_assert in Typestate_Checking (see below). I am using GCC on Ubuntu 23.10.

/home/user/code/ext/Coconut/include/Typestate_Library/TypestateLibrary.h:252:71: error: ‘value’ was not declared in this scope; did you mean ‘boost::hana::value’?
  252 |           static_assert(std::is_same<decltype(FP), decltype(value)>::value,
      |                                                             ^~~~~       
      |                                                             boost::hana::value
In file included from /usr/include/boost/hana/value.hpp:13,                     
                 from /usr/include/boost/hana/concept/constant.hpp:19,          
                 from /usr/include/boost/hana/core/to.hpp:15,                   
                 from /usr/include/boost/hana/bool.hpp:17,                      
                 from /usr/include/boost/hana/integral_constant.hpp:13,         
                 from /usr/include/boost/hana/drop_front.hpp:20,                
                 from /usr/include/boost/hana/concept/iterable.hpp:20,          
                 from /usr/include/boost/hana/at.hpp:16,                        
                 from /usr/include/boost/hana/any_of.hpp:16,                    
                 from /usr/include/boost/hana/all_of.hpp:15,                    
                 from /usr/include/boost/hana/equal.hpp:16,                     
                 from /home/user/code/ext/Coconut/include/Typestate_Library/TypestateLibrary.h:16:
/usr/include/boost/hana/fwd/value.hpp:65:30: note: ‘boost::hana::value’ declared here
   65 |     constexpr decltype(auto) value(T const&)                            
      |                              ^~~~~                                      
/home/user/code/ext/Coconut/include/Typestate_Library/TypestateLibrary.h:252:77: error: template argument 2 is invalid
  252 |       static_assert(std::is_same<decltype(FP), decltype(value)>::value, 
      |                                                               ^                                                                                      
ArwaAlsubhiM commented 5 months ago

The library is been updated now, hopefully, this solves the issue. Working on Windows 11 Pro, with GCC version 13.2.0.

pkeir commented 5 months ago

Thankyou. I am using Ubuntu, so perhaps it can't work. I tried the following:

git clone https://github.com/CoLab-Glasgow/Coconut.git
mv Http_connection\ / Http_connection
mv \ LightSwitch_Example\ / LightSwitch_Example
mkdir build2 && cd build2
cmake ..
make

There is now only an error in main.cpp of Inheritance/Case_2:

Coconut/Inheritance/Case_2/main.cpp:16:10: error: no match for ‘operator->*’ (operand types are ‘Car’ and ‘void (Car::*)()’)
   16 |        (C->*&Car::Adjust_Seats)();
ArwaAlsubhiM commented 4 months ago

I fixed it now, hope it works on your end

pkeir commented 3 months ago

I tried it again today, but now the error is:

Coconut/PillBox/PillBox.h:40:10: error: ‘class Drawer’ has no member named ‘SetDrawerState’
   40 |       d->SetDrawerState("CLOSED");
ArwaAlsubhiM commented 2 months ago

Fix it!

pkeir commented 2 months ago

Thanks again. But now I get the error:

Coconut/PillBox/tests/Valid_test2.cpp:10:36: error: no match for call to ‘(TypestateLibrary::TypestateClassConnector<PillBox, TypestateLibrary::Typestate_Template<TypestateLibrary::State<domain{0}, &PillBox::Activate_pillBox, domain{1}>, TypestateLibrary::State<domain{1}, &PillBox::Process_System_Time, domain{3}>, TypestateLibrary::State<domain{3}, &PillBox::Switch_ON, domain{4}>, TypestateLibrary::State<domain{4}, &PillBox::Switch_ON, domain{4}>, TypestateLibrary::State<domain{4}, &PillBox::Blink, domain{6}>, TypestateLibrary::State<domain{4}, &PillBox::Switch_OFF, domain{5}>, TypestateLibrary::State<domain{6}, &PillBox::Switch_OFF, domain{5}>, TypestateLibrary::State<domain{1}, &PillBox::Deactivate_Pill_Box, domain{2}> > >::operator->*<PillBox, Drawer*>(void (PillBox::*)(Drawer*))::<lambda(Drawer*)>) (std::remove_reference<Drawer*&>::type, int)’
   10 |     (pillbox->*&PillBox::Switch_ON)(std::move(d),0);