Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

error LNK2028: unresolved token (0A00001E) "extern "C" long

In a Microsoft Visual studio C++ 2005 CLR forms application the error:'

error LNK2028: unresolved token (0A00001E) "extern "C" long
> __stdcall DAQmxCreateTask(char const * const,unsigned long *)"


can be solved by making two changes in the project properties:

1. Change \properties\linker\input\Additional Dependences\ from
"$(NoInherit);" to "$(NoInherit) NIDAQmx.lib"
2. Change \properties\linker\general\Additional Library Directories\ to
"C:\Program Files\National Instruments\NI-DAQ\DAQmx ANSI C Dev\lib\msvc".

While the second change may be a clear one to users of non-microsoft products (like myself), the first one is not so clear.

0 Kudos
Message 1 of 4
(18,147 Views)
Given that you are using the CLR, why are you using the C API instead of the .NET API? Both are freely available with NI-DAQmx and I would think that the .NET API would be easier to use in a managed application.
0 Kudos
Message 2 of 4
(18,144 Views)
I never found anything like a .net  set of API calls. Exactly where are they, where is the documentation? Perhaps a sample call would be helpfull to do the search. The only place I have found anything was in "NI-DAQmx C Recerence Help".
0 Kudos
Message 3 of 4
(18,142 Views)
I believe that the .NET API for NI-DAQmx does not install by default unless you have Measurement Studio installed. Run your DAQmx installer in modify mode and made sure the feature .NET Framework 2.0 Languages Support is enabled.
 
After you install the .NET API, help is available directly in MSDN or through Start>>All Programs>>National Instruments>>NI-DAQ>>NI-DAQmx .NET Framework 2.0 Help. If you want to evaluate whether this approach is a good one for you, I recommend that you look at the topics under NI Measurement Studio Help>>NI Measurement Studio .NET Class Library>>Using the Measurement Studio DAQmx .NET Library, rather than trying to sift through all of the reference (which is located under NI Measurement Studio Help>>NI Measurement Studio .NET Class Library>>Reference>>NationalInstruments.DAQmx.
 
We do not have examples in C++/CLI, so you will need to look at the C# or VB.NET examples for guidance. I'm not sure if this will be easier for you than using the C API examples. It probably depends on your comfort level with C vs. C# and on whether the rest of your program is more C-like or more .NET-like.
0 Kudos
Message 4 of 4
(18,136 Views)