On Tuesday, March 17, 2020 at 12:04:34 PM UTC-4, Mohamed Mahmoud wrote: > > I have created swigcxx file , since swig now is natively integrated in go > tools > I ran the following to build a test program that interact with the mabain > wrapper go package to test the APIs > > go install -x -i -ldflags '-w -extldflags "-lmabain"' > > > However I ran into linker errors that I am not able to resolve > > > # mabain > > /tmp/go-build378478658/b001/_x003.o: In function `mbOpen': > > ./mabain_c_interface.cpp:10: undefined reference to > `mabain::CONSTS::ReaderOptions()' > > ./mabain_c_interface.cpp:12: undefined reference to `mabain::DB::DB(char > const*, int, unsigned long, unsigned long, unsigned int)' > > ./mabain_c_interface.cpp:13: undefined reference to `mabain::DB::is_open() > const' > > ./mabain_c_interface.cpp:14: undefined reference to > `mabain::DB::StatusStr() const' > > ./mabain_c_interface.cpp:11: undefined reference to > `mabain::CONSTS::WriterOptions()' > > /tmp/go-build378478658/b001/_x003.o: In function `mbFind': > > ./mabain_c_interface.cpp:44: undefined reference to > `mabain::MBData::MBData()' > > ./mabain_c_interface.cpp:45: undefined reference to `mabain::DB::Find(char > const*, int, mabain::MBData&) const' > > ./mabain_c_interface.cpp:44: undefined reference to > `mabain::MBData::~MBData()' > > ./mabain_c_interface.cpp:44: undefined reference to > `mabain::MBData::~MBData()' > > /tmp/go-build378478658/b001/_x003.o: In function `mbClose': > > ./mabain_c_interface.cpp:23: undefined reference to `mabain::DB::Close()' > > /tmp/go-build378478658/b001/_x003.o: In function `mbAdd': > > ./mabain_c_interface.cpp:30: undefined reference to `mabain::DB::Add(char > const*, int, char const*, int, bool)' > > /tmp/go-build378478658/b001/_x003.o: In function `mbRemove': > > ./mabain_c_interface.cpp:37: undefined reference to > `mabain::DB::Remove(char const*, int)' > > collect2: error: ld returned 1 exit status > > > root@e75d907ebd87:/usr/local/lib# ls -ltr > > total 1844 > > -rwxr-xr-x 1 root root 1887608 Mar 17 11:42 *libmabain.so* > > root@e75d907ebd87:/usr/local/lib# > > > root@e75d907ebd87:/usr/local/lib# objdump -t libmabain.so | grep > ReaderOption > > 0000000000022b60 g F .text 0000000000000003 > _ZN6mabain6CONSTS13*ReaderOption*sEv > > > Any suggestions on how to fix this linker error ? >
I have added the changes and steps to build here https://github.com/msherif4/mabain/tree/gointerface/swig/golang > > Thanks!! > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/b9854a83-6c46-4f23-921a-51e2e4a279eb%40googlegroups.com.