Brief introduction
Common name is generally static library file ***.lib
, for example, nisyscfg.lib
is a static library file, but is actually a routine reference **.obj
file as a static library, a little unconventional ah.
This is a NI488.2 routine, a routine in which the documentation is as follows:
Microsoft Visual C++ (64-bit)
With Microsoft Visual C++ (Version 8.0 or higher), this is done by
typing in using the 64-bit environment:cl /I"%NIEXTCCOMPILERSUPP%\include" 4882query.c "%NIEXTCCOMPILERSUPP%\lib64\msvc\ni4882.obj" /MD
As can be seen in the compilation command to set the first sample program contains the file path, the file path to the library. Where libraries are ni4882.obj . According to project documentation set:
unresolved external symbol
Create a new command-line project, which was originally only the output of the Hello World !!! , I intend to change the name of the entry function for the sample program int __cdecl entry_4882query(void)
as a function of the introduction to the command line main()
functions, directly translated, it was an error, confused.
Thought for a moment, just new construction is C++
construction, but are all examples of works written in C language, is it a problem here, so I'm going to add some finishing touches something in the example of project source files, as follows:
#include "ni4882.h"
#ifdef __cplusplus
extern "C" {
#endif
int __cdecl entry_4882query(void)
{
//.....
}
#ifdef __cplusplus
}
#endif
However, after compiling or wrong.
Finally, the aid will be, they would understand the original source and header files need to add __cplusplus
marks for the job.
Between the computer and the instrument through a GPIB card, the instrument performs power results are as follows:
Instrument off the results:
to sum up
- Do not fall into thinking errors, filed a static library file is
*.lib
likely to vendors is a*.obj
file; - C code with C ++ code compatibility issues, and newcomers stepped pit too little, what problems are encountered new problems.
Reproduced in: https: //www.cnblogs.com/LinTeX9527/p/11045815.html