error: ‘FILE’ in namespace ‘std’ does not name a type
n7st opened this issue · comments
Mike Jones commented
Hi,
I'm hitting an error during make
.
In file included from /home/mike/src/Applications/mir2x/client/src/pngtexdb.hpp:24,
from /home/mike/src/Applications/mir2x/client/src/inventoryboard.cpp:19:
/home/mike/src/Applications/mir2x/common/src/zsdb.hpp:76:14: error: ‘FILE’ in namespace ‘std’ does not name a type
76 | std::FILE *m_fp;
| ^~~~
compilation terminated due to -Wfatal-errors.
make[2]: *** [client/src/CMakeFiles/client.dir/build.make:303: client/src/CMakeFiles/client.dir/inventoryboard.cpp.o] Error 1
make[1]: *** [CMakeFiles/Makefile2:1108: client/src/CMakeFiles/client.dir/all] Error 2
make: *** [Makefile:171: all] Error 2
Arch Linux, amd64.
Mike Jones commented
The following seems to correct the build error (for my platform), and the server and client will run:
diff --git a/common/src/zsdb.hpp b/common/src/zsdb.hpp
index 99125705..efad71ed 100644
--- a/common/src/zsdb.hpp
+++ b/common/src/zsdb.hpp
@@ -73,7 +73,7 @@ class ZSDB final
#pragma pack(pop)
private:
- std::FILE *m_fp;
+ FILE *m_fp;
private:
ZSTD_DCtx *m_DCtx;
Etorth commented
try pull and rebuild, I added the cstdio header.
Mike Jones commented
This fixed this issue, thanks!