Open ghost opened 8 years ago
Hi,
the arduino compile process requires your libraries (which adding multiple .cpp & .h files to one .ino file is) to be in a folder with the same name inside your project.
E.g.
PATH_TO_PROJECT/use_lib.ino:
#include <Arduino.h>
#include "MyLib/MyLib.h"
...
PATH_TO_PROJECT/MyLib/MyLib.h:
class MyClass {
void doSth();
};
PATH_TO_PROJECT/MyLib/MyLib.cpp:
void MyClass::doSth() { ... }
Then the generate_arduino_firmware function will link it correctly to your .ino.
Hi, I'm working on a UNO project in CLion with multiple .cpp & .h files, and am unable to figure out how to get them to link. Please Help.
Output: [100%] Linking CXX executable MultipleFileTest.elf CMakeFiles/MultipleFileTest.dir/MultipleFileTest_MultipleFileTest.ino.cpp.obj: In function
loop': /home/keri/ClionProjects/MultipleFileTest/MultipleFileTest.ino:9: undefined reference to
TestMenu()'