Skip to content

Conversation

@drewfish
Copy link
Owner

This introduces a slightl backwards-compatibility break.
Previously that "state" methods where of type TrimWright::State
but going forward they will be either TrimWright::FSM::State or
TrimWright::HSM::State.

drewfish added 2 commits July 25, 2020 08:59
This introduces a slightl backwards-compatibility break.
Previously that "state" methods where of type `TrimWright::State`
but going forward they will be either `TrimWright::FSM::State` or
`TrimWright::HSM::State`.
@SailingDreams
Copy link

SailingDreams commented Aug 4, 2020

I pulled your pr6 branch and am having issues compiling with cmake.

I'd like to use the statemachine as a library. In order to do this, I comment out #include "../../src/TrimWright.cpp" in main.cpp and use the cmakelists.txt file below.

But where you added Event FSM::PSEUDOEVENTS in the .h file, I now get the error

libhsmTW.a(TrimWright.cpp.o):(.data+0x0): multiple definition of `TrimWright::PSEUDOEVENTS'
CMakeFiles/fsmTest.dir/tests/fsmtest/main.cpp.o:(.data+0x0): first defined here

cmake_minimum_required(VERSION 2.8)

# **** Compile hsm library **********************
add_library(hsmTW SHARED
        src/TrimWright.h
        src/TrimWright.cpp)

target_include_directories(hsmTW PUBLIC
        src )

# **** test/blink *************************
project(blinkTest)
include_directories(src)
add_executable(blinkTest tests/blink/main.cpp)
target_link_libraries(blinkTest hsmTW)

# **** test/fsmtest *************************
project(fsmTest)
include_directories(src)
add_executable(fsmTest tests/fsmtest/main.cpp)
target_link_libraries(fsmTest hsmTW)

# **** test/ *************************
project(hsmTest)
include_directories(src)
add_executable(hsmTest tests/hsmtest/main.cpp)
target_link_libraries(hsmTest hsmTW)

# **** test/queues *************************
project(queuesTest)
include_directories(src)
add_executable(queuesTest tests/queues/main.cpp)
target_link_libraries(queuesTest hsmTW)

# **** test/sugar *************************
project(sugarTest)
include_directories(src)
add_executable(sugarTest tests/sugar/main.cpp)
target_link_libraries(sugarTest hsmTW)

If I move PSEUDOEVNETS[5] back into TrimWright.cpp, I get the error

/hdd/NEO9/device/sonosite/apps/neo/common/src/StateMachineTrimWright.cpp:41:30: error: 'StateMachineTrimWright::Event StateMachineTrimWright::FSM::PSEUDOEVENTS [5]' is not a static data member of 'class StateMachineTrimWright::FSM'
Event FSM::PSEUDOEVENTS[5] = {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants