Skip to main content
Submitted by vijaylamkane on Fri, 10/21/2016 - 22:48

i had writen simple program for galil.h file to access it from Qt c++ program

#include <Galil.h>
using namespace std;
int main(int argc, char *argv[])
{

cout << Galil::libraryVersion() << endl; //e.g. 1.2.0.7 Jan 26 2009 09:15:13 libGalil.so

vector<string> addresses = Galil::addresses(); //retreive available addresses to connect to via constructor Galil()
for(vector<string>::size_type i = 0; i < addresses.size(); i++) //print associated connections
try
{
Galil g(addresses[i]);
cout << g.connection() << endl;
}
catch(string e)
{
cout << addresses[i] << " " << e;
}

}

it gives following errors(compiled Output)

g++ -m64 -o galilConnection3 main.o -L/home/system/Qt_Programs/galilConnection3/../../../../usr/lib/ -lGalil -lQt5Core -lpthread
main.o: In function `main':
/home/system/Qt_Programs/build-galilConnection3-Desktop-Debug/../galilConnection3/main.cpp:14: undefined reference to `Galil::libraryVersion[abi:cxx11]()'
Makefile:136: recipe for target 'galilConnection3' failed
/home/system/Qt_Programs/build-galilConnection3-Desktop-Debug/../galilConnection3/main.cpp:16: undefined reference to `Galil::addresses[abi:cxx11]()'
/home/system/Qt_Programs/build-galilConnection3-Desktop-Debug/../galilConnection3/main.cpp:20: undefined reference to `Galil::Galil(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >)'
/home/system/Qt_Programs/build-galilConnection3-Desktop-Debug/../galilConnection3/main.cpp:21: undefined reference to `Galil::connection[abi:cxx11]()'
collect2: error: ld returned 1 exit status
make: *** [galilConnection3] Error 1
11:13:32: The process "/usr/bin/make" exited with code 2.
Error while building/deploying project galilConnection3 (kit: Desktop)
When executing step "Make"

please help me to solve this problem

Comments 1