Important changes to forums and questions
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
All forums and questions are now archived. To start a new conversation or read the latest updates go to forums.mbed.com.
初めてこのフォーラムに投稿させていただきます。
現在mbed LPC824でSDカードの使用を考えているのですが、公式のSDFileSystem Libraryをコンパイルすると以下のエラー文が出力されます。何か根本的な勘違いをしているのかもしれません。ご指摘いただければ幸いです。
よろしくお願いいたします。
Error: Undefined symbol mbed::FATFileSystem::open(const char*, int) (referred from SDFileSystem.cpp.SSCI824.o). Error: Undefined symbol mbed::FATFileSystem::mkdir(const char*, int) (referred from SDFileSystem.cpp.SSCI824.o). Error: Undefined symbol mbed::FATFileSystem::format() (referred from SDFileSystem.cpp.SSCI824.o). Error: Undefined symbol mbed::FATFileSystem::remove(const char*) (referred from SDFileSystem.cpp.SSCI824.o). Error: Undefined symbol mbed::FATFileSystem::opendir(const char*) (referred from SDFileSystem.cpp.SSCI824.o). Error: Undefined symbol mbed::FATFileSystem::FATFileSystemsub_object(const char*) (referred from SDFileSystem.cpp.SSCI824.o). Error: Undefined symbol mbed::FATFileSystem::FATFileSystemsub_object() (referred from SDFileSystem.cpp.SSCI824.o). Error: Undefined symbol typeinfo for mbed::FATFileSystem (referred from SDFileSystem.cpp.SSCI824.o).
コードは公式のHelloworldほぼそのままで、ピンアサインのみ変更しています。
include the mbed library with this snippet
// example writing to SD card, sford #include "mbed.h" #include "SDFileSystem.h" SDFileSystem sd(dp8, dp9, dp10, dp11, "sd"); // the pinout on the mbed Cool Components workshop board int main() { printf("Hello World!\n"); mkdir("/sd/mydir", 0777); FILE *fp = fopen("/sd/mydir/sdtest.txt", "w"); if(fp == NULL) { error("Could not open file for write\n"); } fprintf(fp, "Hello fun SD Card World!"); fclose(fp); printf("Goodbye World!\n"); }