I get this error while compiling my program: Error 1 error VGDB1000: undefined reference to
`mongocxx::v_noabi::uri::k_default_uri' C:\Users\XXXX\AppData\Local\VisualGDB\RemoteSourceCache\192.168.1.108\0004\include\bsoncxx\v_noabi\bsoncxx\string\view_or_value.hpp project-name
It is a linker error. I link with the libraries libbsoncxx and libmongocxx. I include these files:
#include <bsoncxx/builder/stream/document.hpp>
#include <bsoncxx/json.hpp>
#include <mongocxx/client.hpp>
#include <mongocxx/options/find.hpp>
#include <mongocxx/instance.hpp>
#include <mongocxx/uri.hpp>
I have no idea of how to fix this error message. Any help much appreciated!
Thanks, Easter postponed this one a bit. Here is the minimal example: github.com/xauxatz/LinuxTest
The link command is this:
g++ -o Debug/LinuxProject1 -Wl,-gc-sections -L/usr/local/lib -Wl,--start-group Debug/LinuxProject1.o -lbsoncxx -lmongocxx -Wl,--rpath='$ORIGIN' -Wl,--end-group
Complete error output:
Debug/LinuxProject1.o: In function `main':
/usr/local/include/bsoncxx/v_noabi/bsoncxx/string/view_or_value.hpp:70: undefined reference to `mongocxx::v_noabi::uri::k_default_uri'
collect2: error: ld returned 1 exit status
So obviously it has to do with "mongocxx::uri {}". If I remove this, it compiles fine.
Here is the minimal example: github.com/xauxatz/LinuxTest
The link command is this:
g++ -o Debug/LinuxProject1 -Wl,-gc-sections -L/usr/local/lib -Wl,--start-group Debug/LinuxProject1.o -lbsoncxx -lmongocxx -Wl,--rpath='$ORIGIN' -Wl,--end-group
Complete error output:
Debug/LinuxProject1.o: In function `main':
/usr/local/include/bsoncxx/v_noabi/bsoncxx/string/view_or_value.hpp:70: undefined reference to `mongocxx::v_noabi::uri::k_default_uri'
collect2: error: ld returned 1 exit status
So obviously it has to do with "mongocxx::uri {}". If I remove this, it compiles fine.