Motion Control and Motor Drives

cancel
Showing results for 
Search instead for 
Did you mean: 

Weird Linker Errors c/c++

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.

0 Kudos
Message 1 of 2
(3,288 Views)

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.

Jeff | LabVIEW Software Engineer
0 Kudos
Message 2 of 2
(3,279 Views)