ikeyasu on master
IRremote.h, IRremote.cc: Mock v… Arduino.h, Arduino.cc: Added au… Serial.h, Serial.cc: Added flag… and 5 more (compare)
ikeyasu on master
added SPI Fixed gtest download … Ctest crashes on my machine but… missed formatting and 2 more (compare)
virtual size_t write(const uint8_t *buffer, size_t size);
c++ -isystem ./googletest/include -isystem ./gmock/include -I./arduino-mock/include/arduino-mock/ -g -Wall -Wextra -pthread -Wno-missing-field-initializers -Wno-missing-braces -Wno-unused-command-line-argument -lpthread NullStream.o NullStream_unittest.o gmock_main.a arduino_mock_all.a -o NullStream_unittest Undefined symbols for architecture x86_64: "Print::write(unsigned char const*, unsigned long)", referenced from: vtable for Stream in NullStream_unittest.o "typeinfo for Print", referenced from: typeinfo for Stream in NullStream.o typeinfo for Stream in NullStream_unittest.o "vtable for Print", referenced from: Print::Print() in NullStream_unittest.o NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. ld: symbol(s) not found for architecture x86_64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make: *** [NullStream_unittest] Error 1
@ikeyasu OK so I kind of figured out my vtable issue. One of the Print virtuals isnt pure, so we need to compile the Print.cpp too. You do your files with cc though. So for now I rename Print.cpp to Print.cc but I still cant figure out the linking.
HOWEVER if I explicitly add the Print.o build target
Print.o : $(ARDUINO_MOCK_DIR)/src/Print.cc $(GTEST_HEADERS) $(ARDUINO_MOCK_HEADERS)
$(CXX) $(CPPFLAGS) $(CXXFLAGS) -c $(ARDUINO_MOCK_DIR)/src/Print.cc
It does work.. So it is just a matter of figuring out how to add those targets, and ideally changing the project around to use both cpp or frankly just .cc since thats what arduino uses.