LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Compile CIN via VC++6 Makefile error

Hello,
I try to compile .lsb file via VC++6 accorrding to the instrunction below:
 
1.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 formatc:\progra~1\nation~1\Labvie~1\cintools\)
!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.

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

fatal error C1083: Cannot open include file: 'extcode.h': No such file or directory
Error executing cl.exe.
 
Can any body tell me why?
0 Kudos
Message 1 of 10
(4,691 Views)


@HighTechie wrote:
Hello,
I try to compile .lsb file via VC++6 accorrding to the instrunction below:
 
1.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 formatc:\progra~1\nation~1\Labvie~1\cintools\)
!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.

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

fatal error C1083: Cannot open include file: 'extcode.h': No such file or directory
Error executing cl.exe.
 
Can any body tell me why?


You need to tell Visual C where it should find your header files.
This is done under Tools->Options:Directories:Include Directories. There you add an entry to your LabVIEW cintools directory.

Alternatively you can completely avoid the Visual C development environment and add a line

include=
$(CINTOOLSDIR)

to your makefile. Open a command line, change the current directory to the directory where your makefile and CIN source is and type "nmake -f <your makefile>"

And even better would be to forget about CINs and create your C code as DLL instead. There you can use the Visual C IDE to develop and debug your DLL just as you would any other C project. The Call Library Node since about LabVIEW 6.0 has really the same features as what you could do with a CIN (except a few very esoteric things I can guarantee you will never even want to know about).

Rolf Kalbermatter

Message Edited by rolfk on 01-05-2006 04:31 PM

Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
Message 2 of 10
(4,693 Views)
Hello Rolf,
  Thanks a lot for your reply!
   
I already solve the problem
0 Kudos
Message 3 of 10
(4,684 Views)
Hello Rolf,
  Thanks a lot for your reply!
  your  solution works fine!
 But I found that the DOS format path some times works not so good. when I use the path(c:\progra~1\nation~1\Labvie~1\cintools), there are error happens during the build procedure. later I copy the whole cintools dir to d:\ and use d:\cintools in the IDE or makefile, it works fine. so I think this DOS format path sometimes got trouble.

帖子被HighTechie在01-05-2006 09:35 PM时编辑过了

0 Kudos
Message 4 of 10
(4,688 Views)
Hello Rolf,
  Thanks a lot for your reply!
  your solution  
I already solve the problem
0 Kudos
Message 5 of 10
(4,685 Views)
Hello,
   Can any body tell me why I must use last step(open .mak file with VC IDE) but not nmake /f .mak??
0 Kudos
Message 6 of 10
(4,680 Views)


@HighTechie wrote:
Hello,
   Can any body tell me why I must use last step(open .mak file with VC IDE) but not nmake /f .mak??


You don't (must) have to! But nowadays there are people who don't know anymore that even Windows has a command shell and if they see one they run away screaming because they think their computer got a virus or such. So I guess whoever wrote  that turorial didn't like command shells or wanted to avoid having people to explain what that is and how it works, as well as how you actually can get at it.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 7 of 10
(4,677 Views)


@HighTechie wrote:
Hello Rolf,
  Thanks a lot for your reply!
  your  solution works fine!
 But I found that the DOS format path some times works not so good. when I use the path(c:\progra~1\nation~1\Labvie~1\cintools), there are error happens during the build procedure. later I copy the whole cintools dir to d:\ and use d:\cintools in the IDE or makefile, it works fine. so I think this DOS format path sometimes got trouble.

帖子被HighTechie在01-05-2006 09:35 PM时编辑过了


The problem is that you are using the abbreviated form of the long Windows name. Windows creates short form names for all directory entries that are longer than 8 + 3 characters. However this obviously can  lead to naming conflicts so Windows does create a new name according to the pattern <first 6 chars of name>~<a digit,
starting with 1>.<ending limited to 3 chars>. What digit Windows uses for a particular directory depends on a number of things such as if there are other names with the same first 6 characters in that directory.

Unfortunately the Visual IDE makefile parser is not very friendly about long file names containing spaces. So you have to use the short filenames or as I usually do for such things, install everything in some directory which is sure to only contain short names (<8) chars, such as D:/src/lvsrc/cins/myproj, as you have found out already.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 8 of 10
(4,674 Views)
hello rolf;
  Thanks a lot for your reply! But I do not agree what your opion about why I must use last step via VC IDE. I tried alreay to execute "nmake /f [Name_of_Makefile]"directly from a command line instead of open make file via VC IDE, but I got error messages reads that something "fatal error: can not found ntwin32", but when I use VC IDE convert the make file and build the project, everything works fine? Could you please tell me why or you successful experence? thX!
 
Best Regards
Techie
0 Kudos
Message 9 of 10
(4,670 Views)


@HighTechie wrote:
hello rolf;
  Thanks a lot for your reply! But I do not agree what your opion about why I must use last step via VC IDE. I tried alreay to execute "nmake /f [Name_of_Makefile]"directly from a command line instead of open make file via VC IDE, but I got error messages reads that something "fatal error: can not found ntwin32", but when I use VC IDE convert the make file and build the project, everything works fine? Could you please tell me why or you successful experence? thX!
 
Best Regards
Techie


Sorry, you are right. There is something else you need to do after installation of Visual C for the command line tool to work. In your Visual C installation inside the bin folder you will find a batch file VCVARS32.BAT. This must be run to add the necessary settings to your environment for the command line tools to be able to find all the different tools, include files, etc. At the end of the installation you should have gotten a message about this.

You can add this file to your startup group to make sure it is always ready or execute it before you open the command line.

Rolf Kalbermatter
Rolf Kalbermatter  My Blog
DEMO, Electronic and Mechanical Support department, room 36.LB00.390
0 Kudos
Message 10 of 10
(4,662 Views)