I hope you are good I am trying to fix that problem for nearly two months and finally I found a random video on youtube just I had to write "sqlite3.dll" when running file and add sqlite3.dll to cpp file directory and it works like a magic I even do not know what changes but it works that is for future visitors facing the same problem
1-) add sqlite3.dll file to cpp file directory
2-) when running g++ command to run file add "sqlite3.dll" at the end of command
g++ filename.cpp sqlite3.dll -o filename.exe