Test and Measurement Forum

Having problems with the example.

Post general discussions on using our drivers to write your own software here

Having problems with the example.

Postby Kalvirox » Wed Sep 13, 2017 1:09 pm

Hi

So, I'm having some trouble getting the example to work in Visual Studio.
I have a picoscope 2205A and I downloaded the 64x drivers (as I have a 64x machine) and followed the installation instructions in the software guide. I added the ps2000.dll ps2000.lib to the resources folder and added the ps2000.h to the headers folder and put all of the files in the same location as the .cpp file and linked them. However It shows that files such as termios.h and unistd.h are missing.

I tried swapping over to the 32x version but got lots of link errors (See at the end).
Thanks in advance.

1>------ Build started: Project: PicoExampleTake2, Configuration: Release Win32 ------
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_set_ets@16
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_set_channel@20
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000SetAdvTriggerChannelConditions@12
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000SetAdvTriggerChannelDirections@24
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000SetAdvTriggerChannelProperties@16
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000SetAdvTriggerDelay@12
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_set_trigger@24
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_get_timebase@28
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_run_block@20
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_ready@4
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_stop@4
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_get_times_and_values@36
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_run_streaming@16
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_get_values@28
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_run_streaming_ns@28
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_get_streaming_last_values@8
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_get_streaming_values_no_aggregation@40
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_get_unit_info@16
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_set_sig_gen_built_in@40
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_open_unit@0
1>ps2000con.obj : error LNK2001: unresolved external symbol __imp__ps2000_close_unit@4
1>C:\Users\nsalt\source\repos\PicoExampleTake2\Release\PicoExampleTake2.exe : fatal error LNK1120: 21 unresolved externals
1>Done building project "PicoExampleTake2.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
Kalvirox
Newbie
 
Posts: 0
Joined: Wed Sep 13, 2017 12:33 pm

Re: Having problems with the example.

Postby Hitesh » Wed Sep 13, 2017 1:41 pm

Hi Kalvirox,

Which version of Visual Studio are you using?

The projects that we provide via our GitHub repository are configured so you can switch between 32-bit and 64-bit target platforms with the path to the lib files set in the project to the location where the PicoSDK installer installs them.

You should not need to add the dlls to the project resources as the PicoSDK installer adds the information to the Windows PATH environment variable.

Regards,
Hitesh

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2498
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Having problems with the example.

Postby Kalvirox » Thu Sep 14, 2017 11:02 am

Hi Hitesh

I'm using Visual Studio2017, do I need to use an earlier version that contains all of the headers listed?
Also I was wrong I just have the lib added as a resource, not the DLL. For the project I am working on I am trying to make this SDK work with another one and for the other SDK I have to add the dll as a resource.

Regards
Kalvirox
Newbie
 
Posts: 0
Joined: Wed Sep 13, 2017 12:33 pm

Re: Having problems with the example.

Postby Hitesh » Thu Sep 14, 2017 12:20 pm

Hi Kalvirox,

The C project was saved using Visual Studio Express 2015 for Windows Desktop.

Which platform are you targeting for the other SDK - 32-bit or 64-bit? Which Platform Toolset is being used in the Project Properties?

The errors you are seeing are likely to be down to the 32-bit lib file not being detected. Have you placed the correct ps2000.lib in the project folder or set the Project Properties (Configuration Properties -> Linker -> General) so that the location is set in the Additional Library Directories field? The lib file will also need to be named in the Linker -> Input -> Additional Dependencies field.

Regards,
Hitesh

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2498
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Having problems with the example.

Postby Kalvirox » Thu Sep 14, 2017 12:53 pm

Hi Hitesh

The other SDK is written for Visual Studio and I got that one to build just fine. It's configured for 32 bit but I also got it to build for a 64 bit.

In the Platform Toolset I am using Visual Studio 2017 (v141)

The lib and header files are next to the .cpp and they are linked through as you have described.
(see picture)

Regards
Attachments
Linker.png
Kalvirox
Newbie
 
Posts: 0
Joined: Wed Sep 13, 2017 12:33 pm

Re: Having problems with the example.

Postby Hitesh » Fri Sep 15, 2017 8:00 am

Hi Kalvirox,

For the 32-bit platform settings, please ensure that the location of the lib file is set to

C:\Program Files (x86)\Pico Technology\SDK\lib

Regards,
Hitesh

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2498
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire

Re: Having problems with the example.

Postby Kalvirox » Fri Sep 15, 2017 11:01 am

Yeah, I noticed that yesterday and got it to build. I almost couldn't believe how silly of a mistake I had made ;)
Thanks very much for your help.
Kalvirox
Newbie
 
Posts: 0
Joined: Wed Sep 13, 2017 12:33 pm

Re: Having problems with the example.

Postby Hitesh » Mon Sep 18, 2017 10:24 am

That's alright - it happens :)

Good to hear it is building now :D
Hitesh

Technical Support Engineer
Hitesh
Site Admin
Site Admin
 
Posts: 2498
Joined: Tue May 31, 2011 3:43 pm
Location: St. Neots, Cambridgeshire


Return to General Software Discussions

Who is online

Users browsing this forum: No registered users and 0 guests