c++ - Error "multiple definition of" when trying to make a mock library -
this may arduino specific because obvious solution have different make file. however, working team of people pretty green in ways of c++ , i'd not change current compile setup/workflow.
the goal
- have myclass defined in myclass.h , myclass.cpp uses hardware not developers have access @ times.
- have myclass defined in mock_myclass.h , mock_myclass.cpp defines exact same interface, sends output serial.
- not have move/rename files successful compile.
the problem
i have working except #3 above. if use #include "myclass.h" in code , for f in mock_myclass.*; mv $f $f.hide; done on command line, avoids error. use real hardware have reverse it. if have on command line, it'd easier overwrite symlinks... team members using windows. s#&$*^!!
the ask
can arduino ide ignore *.h , *.cpp files not #include-ed in sketch compiles fine change include?
Comments
Post a Comment