Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Preprocesser Expression is invalid

Status
Not open for further replies.

psperry2

Programmer
Nov 7, 2007
141
US
When I try to compile this old legacy application, I am getting an error.

Compiling g:\sourcesafe\foxpro\production\production_humanresources\libraries\wwipstuff.vcx
#IF WWVFPVERSION > 5
Error in line 155 of wwhttpdata.s_execute (record 12): Preprocessor expression is invalid.
#IF WWVFPVERSION > 5
Error in line 166 of wwhttpdata.s_execute (record 12): Preprocessor expression is invalid.


so I go into the class and look at the code:

#IF WWVFPVERSION > 5
SYS(2335,0)
#ENDIF

The only changes I made was to put the project into Source safe and try and recompile.

I have this exact same code in another directory that is not in source safe and that compiles fine.

Been staring at this for 2 hours already. Can anyone help?





 
It seems you are using west wind components. Where is WWVFPVERSION defined? I think not in the same file it's used. Building with "Recompile All Files" could help, finding some #include which may not point to a correct file could help.

SourceSafe can have strange effects on file attributes. Make double sure all relevant files are not read-only, including header files and third party files.

Bye, Olaf.
 
I am compiling with VFP 7.

I am using westwind version 2.95a

The wwvfpversion is definded int the wconnect.h file.
#DEFINE wwVFPVERSION VAL(SUBSTR(Version(),ATC("FoxPro",VERSION())+7,2))

the production version is saying that the preprocessor expression is invalid while identical code allows it.

The only difference that I can see is that the place I am having a problem, I deleted the original project and created a project from scratch and set the main.prg and compiled from that.
 
so I deleted the new project, copied in the one that compile ok elsewhere and recompile. Did not work!

so the problem is not the project.

I am going to copy in one by one the class libraries and prg files and attempt a recompile until I track down what isn't the same.
 
I fixed it. It now works correctly. I just don't know what I did that fixed the problem. I had the wconnect.h in 3 places in the progs folder, in the libraries folder and in the main project directory. I removed the copies from progs and libraries, recompiled the project and it worked! No error. That shouldn't have fixed anything but it did!
 
Seems at some point the precomipler got confused by the three wconnect.h files and the constant WWVFPVERSION was not clearly defined as it was needed to precompile that #IF statement.

The way you wanted to resurrect your project from main.prg only also is not guaranteed to work and it's often relative paths of #includes and #includes within #included headers that can cause endless loops in precompilation and lead to such errors for example.

I'm not that familar with the WestWindConnect include files but they're surely not meant to be there twice or more times.

Bye, Olaf.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top