Test and Measurement Forum

SDK for Linux

Post your Linux discussions here

SDK for Linux

Postby DaveHughes » Thu Jun 25, 2015 1:36 pm

Hello,

I have installed the new PicoScope software on my Ubuntu system, and have it all running fine (can see traces etc through my PS6000).

However, I can't seem to get my own software to compile anymore? I used to be able to write my own C++ programs that made use of the drivers, but this isn't working now... Am I missing something?
With a simple Main.cpp of:
Code: Select all
#include <iostream>
using namespace std;
#include <sys/types.h>
#include <string.h>

#include <libps6000-1.4/ps6000Api.h>
#include <libps6000-1.4/PicoStatus.h>

int main()
{
   PICO_STATUS ret;   
   short psHndl;   
   bool psOpen;
   ret=ps6000OpenUnit(&psHndl,NULL);
   if(ret==PICO_OK)
   {
      cout<<"Picoscope opened.\n";
      psOpen=true;
   }else
   {
      cout<<"Problem! "<<ret<<"\n";
      return 1;
   };
   return 0;
};


doing the command:
gcc -I/opt/picoscope/include/ -L/opt/picoscope/lib main.cpp -lps6000

Gives the error:
/usr/bin/ld: /tmp/cc9WXO3N.o: undefined reference to symbol '_ZSt4cout@@GLIBCXX_3.4'
/usr/lib/i386-linux-gnu/libstdc++.so.6: error adding symbols: DSO missing from command line
collect2: error: ld returned 1 exit status


Can anyone give me advise on how to use the new PicoScope installation for developing software?
DaveHughes
Newbie
 
Posts: 0
Joined: Mon Jul 01, 2013 1:43 pm

Re: SDK for Linux

Postby Hitesh » Wed Jul 01, 2015 3:26 pm

Hi Dave,

Are you able to build the example provided as part of the libps6000 package successfully?

Regards,
Hitesh

Technical Specialist
Pico Technology
Hitesh
Site Admin
Site Admin
 
Posts: 2009
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: SDK for Linux

Postby mario_ » Wed Aug 19, 2015 2:45 pm

The solution is to use g++ instead of gcc... g++ compiles cpp, gcc just c. g++ will link stdc++ where missing symbols exists. Also option `-o main` will produce correct executable.
mario_
Site Admin
Site Admin
 
Posts: 112
Joined: Fri Sep 13, 2013 12:57 pm

Re: SDK for Linux

Postby DaveHughes » Thu Nov 12, 2015 11:53 am

Sorry for the belated replies (I switched to g++ before checking back here!), thanks for you help!
DaveHughes
Newbie
 
Posts: 0
Joined: Mon Jul 01, 2013 1:43 pm


Return to Linux

Who is online

Users browsing this forum: No registered users and 0 guests