LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CIN's and visual C++

I can't figure this out?! I'm following the istructions in the LabVIEW Code
Interface Reference Manual to compile a CIN using visual c++, but I can't
get around the errors:

error C2146: syntax error : missing ';' before identifier 'MgErr'

error C2501: 'CIN' : missing storage-class or type specifiers

fatal error C1004: unexpected end of file found". Can anyone help?

My code is:
>#include "extcode.h"
>#include "stdafx.h"
>
>CIN MgErr CINRun(LVBoolean *var1);
>
>CIN MgErr CINRun(LVBoolean *var1) {
>return noErr;
>}
Basically this code was created by LabVIEW.
0 Kudos
Message 1 of 2
(2,965 Views)
Are you using a .mak file? If not, it is much easier and with fewer errors
trying to do it manually. Here is how:

Create a makefile (using Notepad or something equivalent) with the following
lines:

name=name_of_c_file_without_the_extension
type=CIN
cinlibraries=Kernel32.lib
CINTOOLSDIR=path_to_cintools_directory (in MS-DOS format)
!include <$(CINTOOLSDIR)\ntlvsb.mak>

Save this file with the filename "name_of_c_file.mak" and save it in the
same directory as the C file.

Now, launch VC++.
Choose File -> Open (NOT Open Workspace)
Open the makefile that you just created.
You will get a dialog that says that the makefile was not created with VC++
(choose to proceed)
Now, another dialog that will ask you what kind of platform to use (choose
Win32)
Now, the makefile
is loaded and the CIN is ready to be built. Choose Build.

Hope this helps.

"Paul" wrote:
>>I can't figure this out?! I'm following the istructions in the LabVIEW
Code>Interface Reference Manual to compile a CIN using visual c++, but I
can't>get around the errors:>>error C2146: syntax error : missing ';' before
identifier 'MgErr'>>error C2501: 'CIN' : missing storage-class or type specifiers>>fatal
error C1004: unexpected end of file found". Can anyone help?>>My code is:>>#include
"extcode.h">>#include "stdafx.h">>>>CIN MgErr CINRun(LVBoolean *var1);>>>>CIN
MgErr CINRun(LVBoolean *var1) {>>return noErr;>>}>Basically this code was
created by LabVIEW.
0 Kudos
Message 2 of 2
(2,965 Views)