Instrument Control (GPIB, Serial, VISA, IVI)

cancel
Showing results for 
Search instead for 
Did you mean: 

VC++ Programming Guide

Solved!
Go to solution

One last comment.  My directory names had a space in the name and I think this was the root of my problems.  You know some programs don't really uderstand a space as a filename so well.  It sometimes look the end of input.  I'd rather use underscores.  So take a close look at directory/filenames if any have a space.   For example I had C:\Program Files\National Instruments\

If I could I'd use C:\Program_Files\National_Instruments\ (hint MSFT/NI) and avoid the spaces! 

0 Kudos
Message 11 of 17
(2,257 Views)

Hello M,

 

Were you able to get that working?

 

National Instruments
0 Kudos
Message 12 of 17
(2,237 Views)

No...I have tried different versions of NI 4882.2 such as 2.6 and 2.2 and none of them seem to help.

I am now using 488.2 ver: 2.2 and VC++ 6.0 with DevQuery.c example

with ni488.h and gpib-32.obj, Its giving following error:

 

Compiling...
Devquery.c
Linking...
gpib-32.obj : fatal error LNK1103: debugging information corrupt; recompile module
Error executing link.exe.

Devquery.exe - 1 error(s), 0 warning(s)

 

Do you think you can re-create this issue and see if you encounter same error as mine? Our entire project is in VC++ 6.0 so thats a hard constraint for me to use the same.

thank you for your help,

 

0 Kudos
Message 13 of 17
(2,229 Views)

I will try this out

National Instruments
0 Kudos
Message 14 of 17
(2,204 Views)

Thanks Anna - for your help.

 

On one of the machines I installed VC++ 2008 and 488.2 version 2.7.3 so that I can exactly follow Chris's steps and re-create it. I copied devquery folder under c:\Devquery and applied the .h and .obj properties in right places. Do I need /MD ??  I tried that as well...below is the error,

 

 

1>Compiling...
1>Devquery.c
1>Compiling manifest to resources...
1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.1
1>Copyright (C) Microsoft Corporation.  All rights reserved.
1>Linking...
1>LINK : fatal error LNK1104: cannot open file 'C:\Program.obj'
1>Build log was saved at "file://c:\Devquery\Debug\BuildLog.htm"
1>Devquery - 1 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

1>Compiling...1>Devquery.c1>Compiling manifest to resources...1>Microsoft (R) Windows (R) Resource Compiler Version 6.1.6723.11>Copyright (C) Microsoft Corporation.  All rights reserved.1>Linking...1>LINK : fatal error LNK1104: cannot open file 'C:\Program.obj'1>Build log was saved at "file://c:\Devquery\Debug\BuildLog.htm"1>Devquery - 1 error(s), 0 warning(s)========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

 

I was really hoping that this will work as I have exact same stuff as Chris.

 

Below is the info for VC++ 6.0 and 488.2 ver 2.6:
I opened C:\Documents and Settings\All Users\Documents\National Instruments\NI-488.2\Examples\Standard C\Devquery
And then I did the following in VC++ 6.0,
1. In Tools > Options > Directories > Win32 > Include Files: added C:\Program Files\National Instruments\Shared\ExternalCompilerSupport\C\include
2. In Tools > Options > Directories > Win32 > Library Files: added C:\Program Files\National Instruments\Shared\ExternalCompilerSupport\C\lib32\msvc
3. In Project > Settings > C/C++ > Project Options: added /MD
4. In Project > Settings > C/C++ > Link > Object/library modules: added gpib-32.obj
5. In Project > Add to project > Files > added C:\Program Files\National Instruments\Shared\ExternalCompilerSupport\C\include\ni4882.h
After rebuilding below is the error and the compiler is hung,
Compiling...
Devquery.c
Linking...
Devquery.obj : error LNK2001: unresolved external symbol _Ibcnt@0
Devquery.obj : error LNK2001: unresolved external symbol _Ibsta@0
Devquery.obj : error LNK2001: unresolved external symbol _Iberr@0
Debug/Devquery.exe : fatal error LNK1120: 3 unresolved externals
In step 4 when I replace <gpib-32.obj> to <ni4882.obj> and then rebuild I get following error:
Compiling...
Devquery.c
Linking...
ni4882.obj : fatal error LNK1103: debugging information corrupt; recompile module
Error executing link.exe.
Devquery.exe - 1 error(s), 0 warning(s)

 

 

0 Kudos
Message 15 of 17
(2,198 Views)

Aah, as far as VC++ 2008 with 2.7.3 NI 488.2 is concerned - it compiles fine. I added "Quotes" to the include dir names in the project Properties as it has spaces (the prob which Chris was referring to).

 

But Anna, it will be really great if you can try to get it to compile with VC++ 6.0. Now that I have starting point, I can try to play around a bit.

0 Kudos
Message 16 of 17
(2,197 Views)

I see a sign of my "space character" problem.  On the 06-23-2010 06:57 PM entry from gpib_user17 I see:

 

LINK : fatal error LNK1104: cannot open file 'C:\Program.obj'

 

If the space character gets the software confused then directory C:\Program Files\National Instruments  might somehow "turn into" C:\Program.obj.  I don't think there is a file called Program.obj.

 

I would quote the directory name that object files come from, perhaps that is from library or include (but I don't really know).

 

Good luck.

0 Kudos
Message 17 of 17
(2,183 Views)