Error E0025 Error in #if expression

Error E0025 Error in #if expression

Postby reinaldocrespo » Tue Oct 12, 2010 5:31 pm

Hi.

I'm trying to upgrade my project to current xharbour + fwh both from most recent fivetech distribution. Getting this error message:

MAKE Version 5.2 Copyright (c) 1987, 2000 Borland
f:\xharbour_1.2.1_6714\bin\harbour.exe -i..\shared;f:\fwh_2010_09\include;f:\xharbour_1.2.1_6714\include -n -m -w -es2 -gc0 -DADMIN prgs\main.prg -o\mp\ReleaseBranch\MpAdmin\main.xhrb
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6717)
Copyright 1999-2010, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'prgs\main.prg'...
prgs\main.prg(62) Error E0025 Error in #if expression

No code generated

** error 1 ** deleting \mp\ReleaseBranch\MpAdmin\main.xhrb


The line with the error is this:
Code: Select all  Expand view
#if MAKE_VERSION == PATHOLOGY_VERSION
 


What has change? Can someone help?

Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: Error E0025 Error in #if expression

Postby James Bott » Tue Oct 12, 2010 9:07 pm

Reinaldo,

Two things to try; look at the PPO output from both versions, try with only one equals sign.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Error E0025 Error in #if expression

Postby reinaldocrespo » Tue Oct 12, 2010 9:22 pm

James;

Hi.

Already tried the = at no avail. But your first suggestion is the perfect way to start investigating what's wrong. My only question is how to produce a .ppo.


BTW; from the xharbour language Reference Guide -(pay special attention to #6):
#if
Compile a section of code based on a condition.
Syntax
#if <condition1>
<statements1>
[ #elif <conditionN>
<statmentsN> ]
[ #else
<statments> ]
#endif

Arguments
<condition1> .. <conditionN>
<condition> is one or more logical conditions that are resolved by the preprocessor. Conditions are formulated using #define constants, numeric or logical literal values. A condition expression may include comparison operators.
<statements1> .. <statementsN>

<statements> is the program code to include in the preprocessor output when a condition is true.

Description
The #if..#elif..#else..#endif directives are used for conditional compilation. They work analogous to the IF..ELSEIF..ELSE..ENDIF statements, but are resolved by the preprocessor, rather than the compiler. In contrast to the #ifdef and #ifndef directives, which test only the presence or absence of #define constants, #if allows for testing the values of such constants and comparing them with other values. In addition, multiple conditions can be formulated using #if..#elif. When the #else directive is used, it must be the last one, followed by #endif.

The statements following the first condition that resolves to True is included in the preprocessor output. All other statements are discarded. That means, even if multiple conditions are True, only one of the code statements appears in the preprocessor output. When all conditions are False, the statements following the #else directive, if present, are used.

The following rules are applied by the preprocessor to evaluate a condition:
1. A numeric literal <> 0 yields True, while exact zero yields False.

2. The logical literal .T. is True, .F. is False.

3. #define constants with no associated value yield False.

4. The literal value NIL yields False.

5. Other literal values cannot be used and result in a compile error.

6. Numeric values can be compared using the comparison operators !=, #, >, >=, =, ==, =< and <. The True/False result of the comparison is evaluated by the preprocessor.

Info
See also: #define, #ifdef, #ifndef
Category: Preprocessor directives , xHarbour extensions

Example
// The example demonstrates how the same source code file can be
// compiled for different program versions. Depending on the #define
// constant MAKE_VERSION, differen initilization routines are called.

#define FULL_VERSION 3
#define RESTRICTED_VERSION 2
#define DEMO_VERSION 1

#define MAKE_VERSION RESTRICTED_VERSION

PROCEDURE Main
#if MAKE_VERSION > RESTRICTED_VERSION
InitFullPackage()
#elif MAKE_VERSION > DEMO_VERSION
InitRestrictedPackage()
#else
InitDemoPackage()
#endif

? "Common code for all packages"
RETURN





Thank you,


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: Error E0025 Error in #if expression

Postby James Bott » Tue Oct 12, 2010 9:37 pm

Reinaldo,

Just add a "/p" parameter to the xharbour compiler line in buildx.bat.

James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA

Re: Error E0025 Error in #if expression

Postby reinaldocrespo » Wed Oct 13, 2010 1:57 am

Switching from xharbour 0.99.6 to 1.2.1 has revealed many problems with my code that were not being catch my the old compiler. Mainly non-existent #include files that I had remove long ago but were still being "included" in some of my sources. Fixed!

I now only have problems with hbzip.lib. I tried searching this ng but can't find any references to these lines. I'm linking zlib_lib as well as hbzip_lib in that order:

Error: Unresolved external 'std::_String_base::_Xran() const' referenced from F:\XHARBOUR_1.2.1_6714\LIB\HBZIP.LIB|zipstorage
Error: Unresolved external 'std::_String_base::_Xlen() const' referenced from F:\XHARBOUR_1.2.1_6714\LIB\HBZIP.LIB|zipstorage
Error: Unresolved external 'std::locale::id::_Id_cnt' referenced from F:\XHARBOUR_1.2.1_6714\LIB\HBZIP.LIB|zipstring
Error: Unresolved external 'std::locale::_Getfacet(unsigned int) const' referenced from F:\XHARBOUR_1.2.1_6714\LIB\HBZIP.LIB|zipstring
Error: Unresolved external 'std::_Locinfo::~_Locinfo()' referenced from F:\XHARBOUR_1.2.1_6714\LIB\HBZIP.LIB|zipstring
Error: Unresolved external 'std::_Locinfo::_Locinfo(const char *)' referenced from F:\XHARBOUR_1.2.1_6714\LIB\HBZIP.LIB|zipstring
Error: Unresolved external '__Getctyptab' referenced from F:\XHARBOUR_1.2.1_6714\LIB\HBZIP.LIB|zipstring
Error: Unresolved external 'std::locale::facet::_Register()' referenced from F:\XHARBOUR_1.2.1_6714\LIB\HBZIP.LIB|zipstring

** error 2 ** deleting \mp\\MpAdmin.exe


Any ideas?


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: Error E0025 Error in #if expression

Postby anserkk » Wed Oct 13, 2010 3:49 am

reinaldocrespo wrote:I'm linking zlib_lib as well as hbzip_lib in that order:


I don't have any problems using zip functions. I have added the lib files in the following order

echo %hdirl%\hbzip.lib + >> b32.bc
echo %hdirl%\zlib.lib + >> b32.bc

Regards
Anser
User avatar
anserkk
 
Posts: 1332
Joined: Fri Jun 13, 2008 11:04 am
Location: Kochi, India

Re: Error E0025 Error in #if expression

Postby Antonio Linares » Wed Oct 13, 2010 7:31 am

Reinaldo,

Please download xHarbour again from:
http://www.fivetechsoft.com/files/xharbour.exe

this new build solves the hbzip problem :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
User avatar
Antonio Linares
Site Admin
 
Posts: 42082
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: Error E0025 Error in #if expression

Postby reinaldocrespo » Wed Oct 13, 2010 1:32 pm

Antonio;

Hi and thank you for your reply.

Before I do so, I was planning to continue using borland 5.5 only to keep at a minimum the number of changes introduced at once. However, I noticed your xharbour is compiled with 5.82. Should I also use bcc582 instead of 5.5?


Reinaldo.
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: Error E0025 Error in #if expression

Postby reinaldocrespo » Wed Oct 13, 2010 2:15 pm

Antonio;

With the xharbour in your link I got the same result.
...
xHarbour Compiler build 1.2.1 (SimpLex) (Rev. 6741)
Copyright 1999-2010, http://www.xharbour.org http://www.harbour-project.org/
Compiling '..\shared\tuser.prg'...
Lines 177, Functions/Procedures 6
Generating C source output to '\mp\ReleaseBranch\MpAdmin\tuser.xhrb'...
Done.
f:\borland\bcc55\bin\bcc32.exe -c -O2 -If:\xharbour_1.2.1_6741\include;f:\borland\bcc55\include;f:\ads8\acesdk -o\mp\ReleaseBranch\MpAdmin\tuser.obj \mp\ReleaseBranch\MpAdmin\tuser.xhrb
Borland C++ 5.5.1 for Win32 Copyright (c) 1993, 2000 Borland
\mp\releasebranch\mpadmin\tuser.xhrb:
f:\borland\bcc55\bin\ilink32.exe -Gn -aa -Tpe -s -I\mp\ReleaseBranch\MpAdmin @MAKE0000.@@@
Turbo Incremental Link 5.00 Copyright (c) 1997, 2000 Borland
Error: Unresolved external 'std::_String_base::_Xran() const' referenced from F:\XHARBOUR_1.2.1_6741\LIB\HBZIP.LIB|ziparchive
Error: Unresolved external 'std::_String_base::_Xlen() const' referenced from F:\XHARBOUR_1.2.1_6741\LIB\HBZIP.LIB|ziparchive
Error: Unresolved external 'std::locale::id::_Id_cnt' referenced from F:\XHARBOUR_1.2.1_6741\LIB\HBZIP.LIB|ziparchive
Error: Unresolved external 'std::locale::_Getfacet(unsigned int) const' referenced from F:\XHARBOUR_1.2.1_6741\LIB\HBZIP.LIB|ziparchive
Error: Unresolved external 'std::_Locinfo::~_Locinfo()' referenced from F:\XHARBOUR_1.2.1_6741\LIB\HBZIP.LIB|ziparchive
Error: Unresolved external 'std::_Locinfo::_Locinfo(const char *)' referenced from F:\XHARBOUR_1.2.1_6741\LIB\HBZIP.LIB|ziparchive
Error: Unresolved external '__Getctyptab' referenced from F:\XHARBOUR_1.2.1_6741\LIB\HBZIP.LIB|ziparchive
Error: Unresolved external 'std::locale::facet::_Register()' referenced from F:\XHARBOUR_1.2.1_6741\LIB\HBZIP.LIB|ziparchive

** error 2 ** deleting \mp\\MpAdmin.exe


As a test, I built xharbour from cvs sources and recompiled the same app. I got no errors. I would rather use an xharbour built for fw. Can you help?

Thank you,


Reinaldo.

Decided to build xharbour from cvs and
User avatar
reinaldocrespo
 
Posts: 979
Joined: Thu Nov 17, 2005 5:49 pm
Location: Fort Lauderdale, FL

Re: Error E0025 Error in #if expression

Postby James Bott » Wed Oct 13, 2010 2:52 pm

Reinaldo,

Yes, you have to use Borland 5.82.

Regards,
James
User avatar
James Bott
 
Posts: 4840
Joined: Fri Nov 18, 2005 4:52 pm
Location: San Diego, California, USA


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Enrico Maria Giordano, Google [Bot] and 96 guests