Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

gpib-32.obj

Hi,

 

I am trying to create a C program which can remotely control my Attenuation box remotely using NI-GPIB. I read the userManual of NI-488.2 and installed the Measurment & Automation s/w on my PC. I was able to "Communicate with Instrument" and use "Interactive Control" to send commands and receive expected info. 

 

Now I want to  pick up the "sample" file provided by NI, and compile it with including ni4882.h and ni4882.obj But when I try to link the project with ni4882.obj, the VC++ 6.0 gives following error:

 

--------------------Configuration: template_automation - Win32 Debug--------------------

Linking...

LINK : warning LNK4098: defaultlib "LIBCD" conflicts with use of other libs; use /NODEFAULTLIB:library

ni4882.obj : fatal error LNK1103: debugging information corrupt; recompile module

Error executing link.exe

 

 

Can you pls provide me with the *.obj file which I would link with VC++ 6.0? Or I guess source code file which has all the functions listed in ni4882.h.

 

thanks,

0 Kudos
Message 1 of 12
(7,148 Views)
That warning is telling you there's a conflict with a link setting amongst the libraries being used. A common one is that one library was compiled for use in a single-threaded app and another for multi-threaded. If you Google for that warning you will see lots of hits. Are you using one of the examples that gets installed with NI-488.2 as a starting point?
0 Kudos
Message 2 of 12
(7,133 Views)

Yeah I am using C:\Program Files\National Instruments\NI-488.2\Bin\sample.txt with following includes:

 

#include <stdio.h>

#include <windows.h>

#include "ni4882.h"

 
I added  these to my project: 
C:\Program Files\National Instruments\Shared\ExternalCompilerSupport\C\include under "Include Files"
C:\Program Files\National Instruments\Shared\ExternalCompilerSupport\C\lib32\msvc under "Library Files" 
 
And added <ni4882.obj> under Project > Settings > Link > Object/Lib Modules:

 

And I get this error:

Linking... 

ni4882.obj : fatal error LNK1103: debugging information corrupt; recompile module

 

I also looked at http://forums.ni.com/ni/board/message?board.id=140&message.id=41079#M41079 and tried

 

cl /I"%NIEXTCCOMPILERSUPP%\include" sample.c "%NIEXTCCOMPILERSUPP%\lib32\msvc\ni4882.obj" /MD

 

which gives C:\testing\template_automation.c(6) : fatal error C1083: Cannot open include file: 'stdio.h': No such file or directory

0 Kudos
Message 3 of 12
(7,125 Views)

According to this, this appears to be an issue with trying to use a newer version of NI-488.2 with older compilers.

0 Kudos
Message 4 of 12
(7,100 Views)

I am using 4.5.0f0 version of Measurment & Automation. Is that OK or you suggest some other version?

 

thanks

 

0 Kudos
Message 5 of 12
(7,095 Views)

The version of MAX is totally irrelevant. The link talked about the version of NI-488.2 and the version of Visual C++.

0 Kudos
Message 6 of 12
(7,091 Views)

2.60

0 Kudos
Message 7 of 12
(7,087 Views)

When I use gpib-32.obj it gives this error

 

 

Linking...
template_automation.obj : error LNK2001: unresolved external symbol _Ibcnt@0
template_automation.obj : error LNK2001: unresolved external symbol _Ibsta@0
template_automation.obj : error LNK2001: unresolved external symbol _Iberr@0
Debug/template_automation.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
template_automation.exe - 4 error(s), 0 warning(s)

 

Linking...template_automation.obj :

error LNK2001: unresolved external symbol _Ibcnt@0template_automation.obj :

error LNK2001: unresolved external symbol _Ibsta@0template_automation.obj :

error LNK2001: unresolved external symbol _Iberr@0Debug/template_automation.exe :

fatal error LNK1120: 3 unresolved externalsError executing link.exe.
template_automation.exe - 4 error(s), 0 warning(s)

0 Kudos
Message 8 of 12
(7,083 Views)

I would suggest either using an older version of NI-488, or a newer compiler. Microsoft has Express versions of the latest compilers available for free.

0 Kudos
Message 9 of 12
(7,069 Views)

Can you pls recommend which specific version of NI 488 should I use with VC++ 6.0 ?

 

thanks

-M.

0 Kudos
Message 10 of 12
(7,062 Views)