06-23-2009 05:51 AM
Hi there.
I'm trying to run the C code shown in Ni-Motion help. More exactly, in the straight line move chapter -> position based straight-line move. I know that the code shown won't compile, but I managed to compile it by including the following files to the Visual C 6.0 project:
Header files: "flexmotn.h"; "flexcomp.h", "motncnst.h", "motnerr.h", "nimaxconfig.h", "nimcbasictypes.h", nimcenum.h", "nimcstruct.h", "nimotion.h", "nimcexample.h" and "nimcexampledata.h".
Resource files: "flexmotn.lib", "nimaxconfig.lib".
Building the code returns the following errors:
Miscare in linie dreapta.cpp
Linking...
Miscare in linie dreapta.obj : error LNK2001: unresolved external symbol "void __cdecl nimcDisplayError(long,unsigned short,unsigned short)" (?nimcDisplayError@@YAXJGG@Z)
Miscare in linie dreapta.obj : error LNK2001: unresolved external symbol "long err" (?err@@3JA)
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/Miscare in linie dreapta.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.
Miscare in linie dreapta.exe - 4 error(s), 0 warning(s)
What files shoud I add to solve these linker errors? I think I'm missing something. Or what files should I remove? Any special settings in Visual C in order to force the linker to work?
Thank you for answering.
06-24-2009 10:55 AM
I know they are quite hidden, but there are C shipping examples included (assuming you installed support for it).
They are hiding at C:\Program Files\National Instruments\NI-Motion\FlexMotion\Examples\C\OneAxis.
If you go into the Simple One Axis example, for instance, you can see what they require.