@@ -47,7 +47,13 @@ class ICEBERG_EXPORT FileIO {
4747 // / \return The content of the file if the read succeeded, an error code if the read
4848 // / failed.
4949 virtual expected<std::string, Error> ReadFile (const std::string& file_location,
50- std::optional<size_t > length) = 0;
50+ std::optional<size_t > length) {
51+ // The following line is to avoid Windows linker error LNK2019.
52+ // If this function is defined as pure virtual function, the `unexpected<Error>` will
53+ // not be instantiated and exported in libiceberg.
54+ return unexpected<Error>{
55+ {.kind = ErrorKind::kNotImplemented , .message = " ReadFile not implemented" }};
56+ }
5157
5258 // / \brief Write the given content to the file at the given location.
5359 // /
@@ -57,7 +63,13 @@ class ICEBERG_EXPORT FileIO {
5763 // / file exists.
5864 // / \return void if the write succeeded, an error code if the write failed.
5965 virtual expected<void , Error> WriteFile (const std::string& file_location,
60- std::string_view content, bool overwrite) = 0;
66+ std::string_view content, bool overwrite) {
67+ // The following line is to avoid Windows linker error LNK2019.
68+ // If this function is defined as pure virtual function, the `unexpected<Error>` will
69+ // not be instantiated and exported in libiceberg.
70+ return unexpected<Error>{
71+ {.kind = ErrorKind::kNotImplemented , .message = " WriteFile not implemented" }};
72+ }
6173
6274 // / \brief Delete a file at the given location.
6375 // /
0 commit comments