Test and Measurement Forum

link error in C example

Post your C and C++ discussions here

link error in C example

Postby fabienL » Wed Sep 09, 2015 10:42 am

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 ==========
fabienL
Newbie
 
Posts: 0
Joined: Wed Sep 09, 2015 10:15 am

Re: link error in C example

Postby Hitesh » Thu Sep 10, 2015 2:11 pm

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,
Hitesh

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

Re: link error in C example

Postby fabienL » Wed Sep 16, 2015 9:21 am

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
fabienL
Newbie
 
Posts: 0
Joined: Wed Sep 09, 2015 10:15 am

Re: link error in C example

Postby Hitesh » Wed Sep 16, 2015 9:26 am

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,
Hitesh

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


Return to C and C++

Who is online

Users browsing this forum: No registered users and 1 guest