SQLiteCpp icon indicating copy to clipboard operation
SQLiteCpp copied to clipboard

Issue compiling with ncurses library

Open martyb95 opened this issue 10 months ago • 1 comments

I love your SQLite library for C++. I am writing an application using curses and panels and i am getting errors compiling the SQLiteCPP package. See the enclosed screenshot of the build error.

It seems to be a conflict with the ncurses library. When I remove the ncurses library it compiles fine. The error is related to the OK constant. The error message is "expected unqualified-id before numeric constant" and the first error is on line 33 of statement.h which is SQLITECPP_API extern const int OK;

Is there anything I can do to get it to compile with the ncurses library?

Image

martyb95 avatar Feb 11 '25 22:02 martyb95

sounds like there is a namespace pollution, probably curses is defining an "OK" constant that is causing the issue? this is very common in some libraries that expose macros so I would check if there is an include before "database.h" and change the order, even an #undef could help to fix the issue

UnixY2K avatar Feb 12 '25 18:02 UnixY2K