LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

CIN Compilation error in MSVC 6.0

I am trying to generate a CIN for the following example C code (mult.c)
/*
* CIN source file
*/

#include "extcode.h"

CIN MgErr CINRun(float32 *A, float32 *B, float32 *AB);

CIN MgErr CINRun(float32 *A, float32 *B, float32 *AB) {

*AB = *A * *B;

return noErr;
}
and I get the following error during compilation in MSVC6
fatal error C1010: unexpected end of file while looking for precompiled header directive
Error executing cl.exe.

my preprocessor path in project settings is
c:\progra~1\nation~1\Labvie~1.1\cintools\

I tried the full path name. I also tried putting the extcode.h in the same directory of mult.c and then explicitly added extcode.h in the project but
keep on getting the same error message.


I will greatly appreciate any pointer to what I am doing incorrectly.

kushal
0 Kudos
Message 1 of 7
(3,308 Views)
Hi Kushal;

Are you sure about the preprocessor path.

In the C/C++, in the Preprocessor category, you have to write that path in the Additional include directory. Make sure the Settings are for All Configurations.


Also I note the path says:

c:\progra~1\nation~1\Labvie~1.1\cintools\

I think it should say:

c:\progra~1\nation~1\Labvie~1\cintools\

without the ".1" portion. In MSVC6 you can write the path exactly as it appears in the Windows' Address field:

C:\Program Files\National Instruments\LabVIEW 6\cintools\

Reagrds;
Enrique
www.vartortech.com
0 Kudos
Message 2 of 7
(3,308 Views)
Thanks for the suggestion:

Yes, I created a new project, Put the actual path
for preprocessor

C:\Program Files\National Instruments\LabVIEW 6.1\cintools\

in the Additional include directories

for code generation selected multithreaded DLL and 1 byte

and on custom build typed the following for commands

"C:\Program Files\National Instruments\LabVIEW 6.1\cintools\lvsbutil" "$(TargetName)" -d "$(WkspDir)\$(outDir)" (all in one line)

and in the output typed
$(OutDir)$(TargetName).lsb

I also made sure that I have settings as All configurations

and still get the same error

kushal (puzzled!!)

ps I am attaching the file also
0 Kudos
Message 3 of 7
(3,308 Views)
Kushal;

I am not sure if your error is because of the custom step. However, I am aware of and I have experienced myself errors because of that custom step. I created a simple VI that performs the custom step outside MSVC. It is called CIN Custom Step and you can download it from my website.

Let me know if that helps you.

Best regards;
Enrique
www.vartortech.com
0 Kudos
Message 4 of 7
(3,308 Views)
Enrique:

The problem is before the custom step. I can't even compile the file mult.c.

I reinstalled the MSVC 6.0 and tried to create projects in two different ways.

1. A simple DLL project
2. A DLL that exports some symbols

but get the same error while compiling mult.c

I am using LabVIEW 6.1, MSVC 6.0 and Windows ME
creating a project named cintest.

And it is not the code. I tried omitting a ' ; ' at the end of a statement but the bug does not get caught and I keep getting the same error message I reported originally.

Thanks for all your suggestions

kushal
0 Kudos
Message 5 of 7
(3,308 Views)
Kushal:

Regular line oriented languages use a two step process of first
compiling individual module (.c or .cpp) files into object files and
then second linking them, i.e. setting them up into a single
executable and filling in all the address offsets with real addresses.

Finally, if the program uses a run-time library (.DLL) this gets
linked in when the program executes but for this to happen, the
program has to know that it is going to import (DLLIMPORT) these
functions so it can know the function entry points.

You can select build, compile your to compile filename.cpp (or
filename.c) to determine if there are any compile errors without
having to build the whole executable and link all your compiled
objects instead of Build, Rebuild All.

This way you can separate the problem into either a compile or a link
problem. If it compiles with no errors, but rebuild all gives you
errors, then the problem is definitely a link problem. From your
description, it sounds to me like you are having a link problem

Your particular problem is with the precompiled header (.PCH) file
that Microsoft Visual C is using to link with when building your
project. Something is broken with that PCH file. The good news is
that you don't usually need to use PCH files. It's just an option
that Microsoft uses to let you recompile your code faster (because
they've already been compiled hence precompiled header.)

Try turning off the use precompiled headers option. This may fix your
problem. If not then you may need to turn them back on and try to
figure out what is broken with your PCH file (perhaps it doesn't
exist?)

To turn off using PCH's look under the Project menu under settings,
switch to the C/C++ tab and then select Precompiled Headers under the
Category drop down selector on the C/C++ tab and tell it that you
don't want to use PCH's.

I hope this has been helpful.

Douglas De Clue
LabVIEW programmer (and MSVC/C++ guy too... 🙂
ddeclue@bellsouth.net


Kushal wrote in message news:<506500000005000000F58A0000-1023576873000@exchange.ni.com>...
> Enrique:
>
> The problem is before the custom step. I can't even compile the file
> mult.c.
>
> I reinstalled the MSVC 6.0 and tried to create projects in two
> different ways.
>
> 1. A simple DLL project
> 2. A DLL that exports some symbols
>
> but get the same error while compiling mult.c
>
> I am using LabVIEW 6.1, MSVC 6.0 and Windows ME
> creating a project named cintest.
>
> And it is not the code. I tried omitting a ' ; ' at the end of a
> statement but the bug does not get caught and I keep getting the same
> error message I reported originally.
>
> Thanks for all your suggestions
>
> kushal
0 Kudos
Message 6 of 7
(3,308 Views)
Douglas:

Turning off the Pre Compiled Header Option solved the problem. Thanks a lot for the suggestion.

Kushal
0 Kudos
Message 7 of 7
(3,308 Views)