link error in C example

Post your C and C++ discussions here
Post Reply
fabienL
Newbie
Posts: 0
Joined: Wed Sep 09, 2015 10:15 am

link error in C example

Post by fabienL »

Hi guys,

I use the ps2000a SDK stable version to recover data with my picoscope 2208A. I would to use the C code example so I follow instructions in this file

* To build this application:
* Set up a project for a 32-bit console mode application
* Add this file to the project
* Add PS2000A.lib to the project
* Add ps2000aApi.h and picoStatus.h to the project
* Build the project*

I created a 32-bit console application project on visual C++ 2008 and I add required files. I have indicated the library path on project properties like this :

Project Properties -> Linker -> Input -> Additional Dependencies.
Project Properties -> Linker -> General -> Additional Library Directory.

But when I build the project, he compile, but there is many link errors. I saw that is in link with the ps2000a.lib but i don't understand how to fix that... So if someone have an idea thank in advance.

Regards,

Fabien L.

Output debug:

1>Linking...
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aCloseUnit@4 referenced in function _CloseDevice
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aSetChannel@24 referenced in function _SetDefaults
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aSetEts@20 referenced in function _SetDefaults
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aSetDigitalPort@16 referenced in function _SetDigitals
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aSetDataBuffer@24 referenced in function _ClearDataBuffers
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aSetDataBuffers@28 referenced in function _ClearDataBuffers
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aStop@4 referenced in function _BlockDataHandler
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aGetValues@28 referenced in function _BlockDataHandler
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aRunBlock@36 referenced in function _BlockDataHandler
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aGetTimebase@28 referenced in function _BlockDataHandler
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aGetStreamingLatestValues@12 referenced in function _StreamDataHandler
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aRunStreaming@36 referenced in function _StreamDataHandler
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aSetTriggerDigitalPortProperties@12 referenced in function _SetTrigger
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aSetPulseWidthQualifier@28 referenced in function _SetTrigger
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aSetTriggerDelay@8 referenced in function _SetTrigger
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aSetTriggerChannelDirections@28 referenced in function _SetTrigger
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aSetTriggerChannelConditions@12 referenced in function _SetTrigger
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aSetTriggerChannelProperties@20 referenced in function _SetTrigger
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aGetValuesBulk@28 referenced in function _CollectRapidBlock
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aGetNoOfCaptures@8 referenced in function _CollectRapidBlock
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aSetNoOfCaptures@8 referenced in function _CollectRapidBlock
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aMemorySegments@12 referenced in function _CollectRapidBlock
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aGetUnitInfo@20 referenced in function _get_info
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aSetSigGenBuiltIn@60 referenced in function _SetSignalGenerator
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aSetSigGenArbitrary@68 referenced in function _SetSignalGenerator
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aSigGenFrequencyToPhase@24 referenced in function _SetSignalGenerator
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aMaximumValue@8 referenced in function _OpenDevice
1>ps2000acon.obj : error LNK2019: unresolved external symbol __imp__ps2000aOpenUnit@8 referenced in function _OpenDevice
1>C:\Users\Labo\Documents\Test_acquisition_picoscope\test10\test10\Debug\test10.exe : fatal error LNK1120: 28 unresolved externals
1>Build log was saved at "file://c:\Users\Labo\Documents\Test_acquisition_picoscope\test10\test10\Debug\BuildLog.htm"
1>test10 - 29 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

Hitesh

Re: link error in C example

Post by Hitesh »

Hi fabienL,

Did you install the 32-bit or 64-bit SDK?

In your Project Properties -> Linker -> Input -> Additional Dependencies entry, did you add ps2000a.lib to the list?

Alternatively, have you added the lib file to the project in the Solution Explorer?

Regards,

fabienL
Newbie
Posts: 0
Joined: Wed Sep 09, 2015 10:15 am

Re: link error in C example

Post by fabienL »

Hi Hitesh,

thanks for your reply,

I installed the 64-bit SDK version (my system is a 64-bit system).

I added "ps2000a.lib" in my project like that Project Properties -> Linker -> Input -> Additional Dependencies

And I specify the path "C:\Users\Labo\Documents\Test_acquisition_picoscope\test60" (test60 is the project directory)
in Project Properties -> Linker -> General-> Additional Library Directories

I also specify the path for header files in Project Properties -> C/C++-> General-> Additional Include Directories

All files i need are in my project directory (test60) and I added them to the project in the solution explorer. But Visual return error link (as you can see in my first post). So if you have any idea...

Regards,

FabienL

Hitesh

Re: link error in C example

Post by Hitesh »

Hi FabienL,

Try setting the paths to the location where the SDK installed the files.

Header files (Project Properties -> C/C++-> General-> Additional Include Directories):

Code: Select all

C:\Program Files\Pico Technology\SDK\inc
Lib files (Project Properties -> Linker -> General-> Additional Library Directories):

Code: Select all

C:\Program Files\Pico Technology\SDK\lib
Are you building a 64-bit application and have you checked to see whether it is the Debug or Release mode that is being built?

Regards,

DanielB
Newbie
Posts: 0
Joined: Tue Dec 20, 2016 12:33 pm

Re: link error in C example

Post by DanielB »

Hi guys,

I do have the same problem here, I use the ps2000a SDK stable version (64 bit) trying to receive some data from my Picoscope 2005A.

I followed the instructions just like fabienL did and I get the same Problems.

I created a 32-bit console application project on visual studio community 2015.

Also I set the paths for the Header and Lib files to the location where SDK installed the files.

The Debug Mode is being built.

I have no idea why I still get the same errors. So any help provided by you would be very appreciated.

Regards,

DanielB

Hitesh

Re: link error in C example

Post by Hitesh »

Hi DanielB,

Which device are you using as the 2005A is not one of our model numbers.

If you are using a PicoScope 2205A, you need to use the C example solution from the C:\PicoSDK\PS2000\C console directory if you have installed the SDK.

If you are using a PicoScope 2405A, please e-mail support@picotech.com and we can provide an updated example and drivers for you.

Regards,

DanielB
Newbie
Posts: 0
Joined: Tue Dec 20, 2016 12:33 pm

Re: link error in C example

Post by DanielB »

Hi Hitesh,

thank you very much for your advice!
Since I switched to your suggested directory and files everything is working.

Regards

DanielB

Michal T
Newbie
Posts: 0
Joined: Thu Apr 27, 2017 1:16 pm

Re: link error in C example

Post by Michal T »

Hi!
I'm using Pico 3406D MSO and have the same problem. I'm using VS Express 2015, added directories to correct fields in project - but I'm still getting an error. Intellisense sees header, but on linking stage I get Severity Code
Error LNK2001 unresolved external symbol ps3000aOpenUnit

Could someone point me in a right direction on what to do next ?

BR
M.T.

Hitesh

Re: link error in C example

Post by Hitesh »

Hi M. T.,

Have you tried using the latest examples file from our GitHub repository?

Have you installed the 32-bit or 64-bit PicoSDK?

Regards,

vprabhala
Newbie
Posts: 0
Joined: Fri Jul 14, 2017 7:23 pm

Re: link error in C example

Post by vprabhala »

Hi Folks,
I am trying to upgrade from 3207B to 3206D. I have followed the instructions to download latest driver/libraries on my Ubuntu system. It created /opt/picoscope and subdirectories. The installation program installed and linked with libpicoipp.so.1.0.1 and similarly had links to libps3000a.so.2.0.0 under /opt/picoscope/lib folder.
When linking my application, the Qt C++ linker says "libpicoipp.so is incompatible". Incompatible with what? Is it incompatible with libps2000a.so.2.0.0?

Hitesh

Re: link error in C example

Post by Hitesh »

Hi vprabhala,

The libps3000a library has a dependency on the libpicoipp library. When the picoscope or libps3000a packages are installed, the libpicoipp package should be installed.

Are you building for a 32-bit or 64-bit platform?

Regards,

vprabhala
Newbie
Posts: 0
Joined: Fri Jul 14, 2017 7:23 pm

Re: link error in C example

Post by vprabhala »

Hi Hitesh!
I'm installing on a 64-bit Ubuntu Linux machine.

That said, what is interesting is that when I linked with libpicoipp library of the previous version with the current version of libps3000a, the linker error vanished. I expected it to link with the libpicoipp library in the same folder as the new version of libps3000a.

Hitesh

Re: link error in C example

Post by Hitesh »

Hi vprabhala,

Did you download the driver packages only or the PicoScope application?

Regards,

vprabhala
Newbie
Posts: 0
Joined: Fri Jul 14, 2017 7:23 pm

Re: link error in C example

Post by vprabhala »

Hi Hitesh,
I followed the instructions on your website to download the Linux driver package for 3206D. I can see both libps3000a.2.0.0 (and its symbolic links), and libpicoipp.so.1.0.1 (and its symbolic links). I merely pointed my application to this folder and received the "incompatibility" error from the linker.

On a hunch, I pointed libpicoipp.so link in the new folder (/opt/picoscope/lib) to the original libpicoipp library, and the linker error vanished.

So, the question is - what's the incompatibility I encountered?

Thanks,
-- Venkata Prabhala

Hitesh

Re: link error in C example

Post by Hitesh »

Hi Venkata,

I have picked up your e-mail support request.

We do provide drivers for 32-bit, 64-bit and armhf platforms.

Regards,

Post Reply