linker error Windows 7 S4000sdk10.5.2.1

Post general discussions on using our drivers to write your own software here
Post Reply
Hainewaldi
Newbie
Posts: 0
Joined: Wed Apr 29, 2015 5:08 pm

linker error Windows 7 S4000sdk10.5.2.1

Post by Hainewaldi »

SDK: PS4000sdk10.5.2.1
OS Name: Microsoft Windows 7 Enterprise
Version 6.1.7601 Service Pack 1 Build 7601
compiler: Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x86
linker: Microsoft (R) Incremental Linker Version 12.00.31101.0

Problem Description: linking error (X86)
Following link sequence has been called:

cl.exe main.obj interfaceSPI.obj util.obj interfacePico.obj ps4000.lib -o main

Following result I got:

Microsoft (R) C/C++ Optimizing Compiler Version 18.00.31101 for x86
Copyright (C) Microsoft Corporation. All rights reserved.

cl : Command line warning D9035 : option 'o' has been deprecated and will be removed in a future release
Microsoft (R) Incremental Linker Version 12.00.31101.0
Copyright (C) Microsoft Corporation. All rights reserved.

/out:main.exe
/out:main.exe
main.obj
interfaceSPI.obj
util.obj
interfacePico.obj
ps4000.lib
interfacePico.obj : error LNK2019: unresolved external symbol _ps4000OpenUnit referenced in function _openPicoDevices
interfacePico.obj : error LNK2019: unresolved external symbol _ps4000GetUnitInfo referenced in function _infoPicoDevice
interfacePico.obj : error LNK2019: unresolved external symbol _ps4000CloseUnit referenced in function _closePicoDevices
main.exe : fatal error LNK1120: 3 unresolved externals
make: *** [main] Error 2


The file ps4000.lib is available in the folder where compiler/link is called.
When I create my own lib 'ps4000.lib' the linker works fine - that means the linker call is ok:
dumpbin /exports ps4000.dll > ps4000.dump.csv
produce a one column file of symbols called ps4000.def
lib /def:ps4000.def /out:ps4000.lib

Any ideas ?

Hainewaldi
Newbie
Posts: 0
Joined: Wed Apr 29, 2015 5:08 pm

Re: linker error Windows 7 S4000sdk10.5.2.1

Post by Hainewaldi »

additional remark:
I tried to get running the C Console example inside of Microsoft Visual Express 2013.
Again I get a linker error: LNK1123

Hitesh

Re: linker error Windows 7 S4000sdk10.5.2.1

Post by Hitesh »

Hi Hainewaldi,

The example in the SDK is a Visual Studio 2010 Express project. In the Project Properties under the Linker settings try setting Incremental Linking to No.

Do you have any other versions of Visual Studio installed? Which versions of the .NET Framework are installed?

Regards,

Hainewaldi
Newbie
Posts: 0
Joined: Wed Apr 29, 2015 5:08 pm

Re: linker error Windows 7 S4000sdk10.5.2.1

Post by Hainewaldi »

Hi Hitesh,
Well, I've just installed Visual Studio 2010 Express and SP1.
Compiling and linking of the C console example works fine now - that means I get an executable.

I have analysed the ps4000con project properties (compiler, link options) and added the following link options to my own makefile:
link.exe main.obj interfaceSPI.obj util.obj interfacePico.obj /INCREMENTAL:NO /NOLOGO /LIBPATH:"." "kernel32.lib" "user32.lib" "gdi32.lib" "winspool.lib" "comdlg32.lib" "advapi32.lib" "shell32.lib" "ole32.lib" "oleaut32.lib" "uuid.lib" "odbc32.lib" "odbccp32.lib" "PS4000.lib" /ALLOWISOLATION /MANIFESTUAC:"level='asInvoker' uiAccess='false'" /SUBSYSTEM:CONSOLE /OPT:REF /OPT:ICF /LTCG /TLBID:1 /DYNAMICBASE /NXCOMPAT /MACHINE:X86 -out:main


I get now the (new) error message:
error LNK2001: unresolved external symbol _ps4000OpenUnit
According to https://msdn.microsoft.com/en-us//libra ... .100).aspx a possible root cause
could be mixed versions of the libraries.

As .NET framework I use 4.5.
I hesitate to install .NET 4, because I have no feeling about the consequences.


Really strange: VS 2010 is able to resolve _ps4000OpenUnit , my makefile is not able to do that.
Both approaches are using .NET 4.5
Perhaps the VS 2010 contains some framework with an own .NET wrapper .NET4 -> .NET4.5 ?

Regards
Hainewaldi

Hainewaldi
Newbie
Posts: 0
Joined: Wed Apr 29, 2015 5:08 pm

Re: linker error Windows 7 S4000sdk10.5.2.1

Post by Hainewaldi »

Incident can be closed. Solution found: Preprocessor definition is used in include file 'ps4000Api.h', but was not defined within makefile.
Thanks for your dedication.
Regards Hainewaldi

Post Reply