From Friday, April 19th (11:00 PM CDT) through Saturday, April 20th (2:00 PM CDT), 2024, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

i got compilation error!

First let me give you a detail of my tasks. I am writing a dll to connect between C++ and Labview. C++ program is a voice regnition engine and LabView is to control Digital Oscillope via GPIB card. Once my C++ program(voice renigtion engine) recongine the command,it needs to send the command( it's simply represented by number only)to Labview interface and perform action.I have sent you a question before for asking what approaches will be the best to deal with this problem and i got the reply is using dll approaches. i have followed the notes and example program to learn it. Now, I have written a test program(which is simply a I/O program),dll ( using C++ too)and labview program. In LabView program, it d0oesnt have problem so far, however, it occ
urs problem in dll and test program. In building dll, i need to include the header file of test program inside "stdafx.h". However, i got compilation error, "unexpected end of file while looking for precompiled header directive" pointed to the last line of my included test program( i made the project as win32 dynamic-link library) .
so what is the problem? my export function in dll and all code in test program is VERY simple. I really dont konw what's going on with it.
I got the other problem is my recognition engine will update the parameter(command to labview) time to time, however I cant rebuild the dll every min, right? so the command (which is in the export function)will not be updated once i build the dll, is that right? then how to deal with this problem? Sorry for my pool engish, but thx for your patient reading my question. I am looking forward to your command and suggestion. Thanks!
0 Kudos
Message 1 of 2
(2,888 Views)
Jan Cheung:

"Unexpected end of file while looking for precompiled header directive" usually means that you have enabled precompiled headers in your project settings, but the compiler cannot find the line '#include "stdafx.h"' in one of your source files. Any source file that is set to use a precompiled header must contain this line. You can check the precompiled header settings for each file under Project >> Settings >> C/C++ >> Precompiled Headers. These settings are set on a per-file basis, so you will want to check them for every source file. For every source file except stdafx.h, the option 'Use precompiled header file through header stdafx.h' should be enabled. For stdafx.h, the option 'Create precompiled header file through header stdafx.h' should be
enabled. If you used an MFC or Measurement Studio AppWizard to start your project, these settings should already be set.

I hope this helps.

-- Chris
0 Kudos
Message 2 of 2
(2,888 Views)