On Wed, 12 May 2010, Pritpal Bedi wrote:

Hi Pritpal,

> >> > I thought that you want to introduce full separation of compiled
> > the #pragma low level behavior strictly depends on
> > current compiler implementation. It may change in
> My current requirement is to just get rid of the unresolved 
> external "_errno" which is called in ppcore.c in pp.lib in xHarbour 
> of year 2007 October.

Looking at your message I can only say to you mixed C source code
compiled with and without MT BCC switches. Looks that BCC generates
incompatible code for both modes and they cannot be mixed to create
final binaries.
You have to decide which mode you want to use and recompile xHarbour
core code and your own project with the same MT switches. The problem
is exploited at link time so different CRTLs are used for MT and ST
mode. If BCC does not set automatically library dependencies in .obj
files then you will have to inform linker about valid RTL.
In BCC32.EXE -tWM switch is used to enable MT mode. If you link your
application using BCC32.EXE too then such switch used during compile
and link time is enough. If you are using ILINK32.EXE then probably
you will have to set valid CRTL library manually. cw32mt.lib is MT
safe CRTL which should be used for code compiled with -tWM BCC switch
and cw32.lib is ST CRTL.

> I have tweaked hbMK2 ( my local copy ) to send PRG sources 
> to harbour.exe one-by-one and is sufficient to cover all discussed 
> above, though I would like to see this happen in a proper manner 
> in Harbour.
> Because this project has to be compiled with older xHarbour which 
> I wanted to do so through hbIDE, and where I think we will not be 
> touching the compiler code at all, I am looking for some out of the 
> compiler code solution.

Important is only using valid MT compile and link time switches
for xHarbour core code and your own code. Please remember that
some problems may not be exploited at link time as the errno you
reported and only not fully functional binaries are created.
Probably the xHarbour code you are using was compiled without
-tWM flag. In such case you should force ST mode in HBMK2 too
probably by disabling -tWM BCC compile time switch and changing
in linker command CW32MT to CW32. I do not know if BCC support
opposite to -tWM switch which can disable -tWM used before and
if HBMK2 recognize it and updates default library list passed
to ILINK32.EXE. Probably not.
Alternatively you can recompile whole xHarbour code with -tWM
but it may also force some modifications in xHarbour makefile.bc
to enable MT safe CRTL at link time without setting HB_MT. This
is probably the safest way because allows to use non HVM MT code
using CRTL in final application.

> In one of my prgs I am calling this code:
[...]
> Maybe this code is the culprit. May be I 
> need to do it somehow differently. The above 
> code belongs to CacheRDD I developed on top of  UsrRDD.
> I tried to introduce 
>    int errno()
>    {
>       return 0;
>    }
> but other type of warnings are there, so I believe this is 
> not the solution.
> Any help is appreciated. 
> I am really struck at this.

It's completely unimportant which code exploited the problem in
visible way. Important is only that you are mixing files compiled
for ST and MT mode (with and without -tWM flag) during linking
final application and this is the source of your problem.
All what you have to do is eliminating it.

best regards,
Przemek
_______________________________________________
Harbour mailing list (attachment size limit: 40KB)
Harbour@harbour-project.org
http://lists.harbour-project.org/mailman/listinfo/harbour

Reply via email to