bug on mingw linker ?????

199 views
Skip to first unread message

José M. C. Quintas

unread,
Feb 14, 2023, 7:00:34 PM2/14/23
to harbou...@googlegroups.com
Today I link my application, with hwgui use.

I receive error about a not found function, but function was there.

1) sefazclass.hbc indicates paths for one of my libraries

2) libjpa.hbc indicates paths for one of my libraries

3) hwgui.hbc indicates paths for hwgui libraries

4) gtwvg.hbc harbour library

and others.

There are some modules using hwgui library.

Situation:

I use the hwgui function on libjpa: hwg_GetWindowRect()

On linker: function not found, hit of hbmk2: add hwgui.hbc

But it was there.

Add on jpa.prg

REQUEST hwg_GetWindowRect

And linker was sucessfull.

Do not add any library, and any hbc, use same as before.

Why mingw linker do not found the function, if all libraries was
indicated on linker?

To use a function from one library on another library is not a common
situation?

José M. C. Quintas

José F. Giménez

unread,
Feb 16, 2023, 1:10:11 AM2/16/23
to harbou...@googlegroups.com
Hí José,

gcc linker is a "only one pass" linker. That means that it searches for
symbols in each library only one time, just in the order they are
listed, and it sometimes causes that problem.

Consider this case: you have 2 libraries A and B and one symbol X, that
resides in library A but is called from a function from library B. So,
when the linker searches for symbols in library A, it skip symbol X
because it's not used yet. Later, when linking library B it notices that
symbol X is needed, but it doesn't exist in library B (or later
libraries), so an error is generated (it never returns to previous
libraries to re-search for symbols).

The solution is to add the library with missed symbols two or more
times. I.e. add libraries A + B + A

Regards,

Jose F. Gimenez
https://www.xailer.com

ivanil.m...@gmail.com

unread,
Feb 17, 2023, 6:56:38 AM2/17/23
to Harbour Users
I don't know if that's the case; But I couldn't use git's harbor; it started to give some problems in classes, the methods of the class disappeared, I still couldn't determine the problem, that's why I didn't divulge it, returning to the November harbor everything is fine. Some colleagues might say that you have to compile everything again, so yes, when I rebuild the git harbor I recreate each and every lib used, it's part of my procedure; Maybe if you're using the new harbor, we have something in common. 
Big hug.

José M. C. Quintas

unread,
Feb 17, 2023, 7:34:22 AM2/17/23
to harbou...@googlegroups.com

Thanks for the answer, but in this case error is mine.

I have individual projects and a master group of probjects.

Individual projects was ok, but do not pay attention when compile group of projects, that error was not on same EXE.


About your error:

Do not know if is the same error, but since last 2 or 3 years, I have an inexplicable error, random times a function returns 0.

May be:

FUNCTION A(); RETURN "A".

A := aClass():New()

On one day/month/time, the function returns 0 and not "A".

May be any function of the application.

If return was a class, return is 0, and methods does not exists - seems your error about methods disappear from class.

Until now, I do not know what causes this error.

On this week, error was on the login screen, the first screen of the application.

Same application, same EXE, runs all days, but in an indefined day/month/time gives the error.

Running again, no error.

May occurs on any function, any computer, any network, any local, any EXE.

The same function that works all days, one day returns 0 - ANY function of application, not allways the same.


José M. C. Quintas

--
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
Unsubscribe: harbour-user...@googlegroups.com
Web: https://groups.google.com/group/harbour-users
---
You received this message because you are subscribed to the Google Groups "Harbour Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to harbour-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/harbour-users/cf84b601-76ac-46a3-ae9d-a4f142ecfb7en%40googlegroups.com.

Gerald Drouillard

unread,
Feb 17, 2023, 8:07:39 AM2/17/23
to harbou...@googlegroups.com
I am having issues with my builds also.
It is very strange.  I use objects all over the place and just recently, not sure if it is harbour or msys64, but I am getting  "message not found" when accessing certain "data" elements.
I am debugging with this object right now.  It seems like assigning data to :error_msg seems fine.  But when trying to get the value like in the following:
if !empty(::error_msg)
will cause a message not found.
Adding a _ makes it work though:  if !empty(::_error_msg)

__objGetValueList(self) just before the empty call shows it there.

{{"OCURL", <Class of LIBCURL type>, }
{"MATCHINGADDRESS", "", }
{"HRESULT", {"error_message":"This IP, site or mobile application is not authorized to use this API key. Request received from IP address xxx with empty referer","results":[],"status":"REQUEST_DENIED"}, }
{"CRESULTS", "{
   "error_message" : "This IP, site or mobile application is not authorized to use this API key. Request received from IP address xxx, with empty referer",
   "results" : [],
   "status" : "REQUEST_DENIED"
}
", }
{"ERROR_MSG", "[REQUEST_DENIED]Google request was denied.", }
}

Here is the object.
class google_maps_geocode
hidden:
exported:
      method county(nResult) inline ::get_ac('administrative_area_level_2','',nResult)
      method state(nResult) inline ::get_ac('administrative_area_level_1','',nResult)
      method street_number(nResult) inline ::get_ac('street_number','',nResult)
      method route(nResult) inline ::get_ac('route','',nResult)
      method street_name(nResult) inline ::get_ac('street_name','',nResult)
      method city(nResult) inline ::locality(nResult)
      method locality(nResult) inline ::get_ac('locality','',nResult)
      method country(nResult) inline ::get_ac('country','',nResult)
      method zipcode(nResult) inline ::postal_code(nResult)
      method postal_code(nResult)  inline ::get_ac('postal_code','',nResult)
      method postal_code_suffix(nResult)  inline ::get_ac('postal_code_suffix','',nResult)
      method lat(nResult) inline ::get({'geometry','location','lat'},,nResult)
      method lng(nResult) inline ::get( {'geometry','location','lng'},,nResult)
      method address(nResult) inline ::get( 'formatted_address','',nResult)
      method bounds(nResult) inline ::get( {'geometry','bounds'},,nResult)
      method viewport(nResult) inline ::get( {'geometry','viewport'},,nResult)
      method location_type(nResult) inline ::get( {'geometry','location_type'},'',nResult)
      method location(nResult) inline ::get( {'geometry','location'},,nResult)
      method place_id(nResult) inline ::get( 'place_id','',nResult)
      method types(nResult) inline ::get( 'types',{},nResult)
      access results inline hvalue(::hresult,'results',{})
      method get
      method get_ac  //address_component
      method address_lookup
      //method muni_lookup(cAddress)
      //method findmuni(cAddress,nCounty)
      //method asString
      method set_json
      data oCurl
      data matchingaddress init ''
      data hResult
      data cResults
      data error_msg
   endclass

Appliserver

unread,
Feb 17, 2023, 10:17:03 AM2/17/23
to harbou...@googlegroups.com

If you use threads, an entire new class of errors can appear: deadlocks, race conditions...

Dan

José M. C. Quintas

unread,
Feb 17, 2023, 10:25:27 AM2/17/23
to harbou...@googlegroups.com

This is another interesting point:

Errors occurs with and without multithread.

But using multithread, I receive less errors.

José M. C. Quintas

Gerald Drouillard

unread,
Feb 27, 2023, 4:03:05 PM2/27/23
to harbou...@googlegroups.com
Renaming 
    data error_msg
to 
   data errormsg 
fixed the problem for me.  "Error_msg" must be some kind of reserved word in windows mingw64 harbour now.

José M. C. Quintas

unread,
Feb 27, 2023, 4:13:41 PM2/27/23
to harbou...@googlegroups.com

Found errors on Windows API #defines used.

Now waiting some days to check result of changes.

José M. C. Quintas

Reply all
Reply to author
Forward
0 new messages