FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour compile errors - send a SMS
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
compile errors - send a SMS
Posted: Thu Apr 11, 2024 02:18 PM
Hi all,

I'm trying to compile a sample of using curl with Twilio.
I've linked in hbcurl.lib, libcurl.lib and hbcurl.ch

I get the following errors. Anyone know what I'm missing?
Code (fw): Select all Collapse
Turbo Incremental Link 6.80 Copyright (c) 1997-2017 Embarcadero Technologies, Inc.
Error: Unresolved external '_hb_gcMark' referenced from C:\HARBOUR\LIB\HBCURL.LIB|core
Error: Unresolved external '_hb_gcAllocate' referenced from C:\HARBOUR\LIB\HBCURL.LIB|core
Error: Unresolved external '_hb_storclen_buffer' referenced from C:\HARBOUR\LIB\HBCURL.LIB|core
Error: Unresolved external '_hb_parnldef' referenced from C:\HARBOUR\LIB\HBCURL.LIB|core
Error: Unable to perform link
* Linking errors *
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: compile errors
Posted: Thu Apr 11, 2024 02:26 PM

Dear Jeff,

Are you using xHarbour or Harbour ?

It seems as those libraries are for Harbour and not for xHarbour, thus those unresolved externals availables only for Harbour

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: compile errors
Posted: Thu Apr 11, 2024 02:43 PM

Hi Antonio

I'm using xharbour. Are there any libs for using curl with xharbour?

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: compile errors
Posted: Thu Apr 11, 2024 02:45 PM
If I try with harbour I get these errors:
Code (fw): Select all Collapse
Turbo Incremental Link 6.80 Copyright (c) 1997-2017 Embarcadero Technologies, Inc.
Error: Unresolved external '_HB_FUN_HB_BLEN' referenced from C:\FWH1611\LIB\FIVEH.LIB|OLEFUNCS
Error: Unresolved external '_HB_FUN___OLEVARIANTNEW' referenced from C:\FWH1611\LIB\FIVEH.LIB|ADOFUNCS
Error: Unresolved external '_HB_FUN_OCCURS' referenced from C:\FWH1611\LIB\FIVEH.LIB|XBROWSE
Error: Unresolved external '_hb_extIsNil' referenced from C:\FWH1611\LIB\FIVEHC.LIB|RICHEDIT
Error: Unresolved external '_HB_FUN_HB_TSTOUTC' referenced from C:\FWH1611\LIB\FIVEH.LIB|VALTOSTR
Error: Unable to perform link
* Linking errors *
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: compile errors
Posted: Thu Apr 11, 2024 02:49 PM

Dear Jeff,

Could you please post the source code of the example here so we can test it ?

thanks

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: compile errors
Posted: Thu Apr 11, 2024 02:49 PM

Jeff, it looks as you are mixing Harbour and xHarbour libraries. Please double check.

Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: compile errors
Posted: Thu Apr 11, 2024 02:56 PM
Jeff Barnes wrote:If I try with harbour I get these errors:
Code (fw): Select all Collapse
Turbo Incremental Link 6.80 Copyright (c) 1997-2017 Embarcadero Technologies, Inc.
Error: Unresolved external '_HB_FUN_HB_BLEN' referenced from C:\FWH1611\LIB\FIVEH.LIB|OLEFUNCS
Error: Unresolved external '_HB_FUN___OLEVARIANTNEW' referenced from C:\FWH1611\LIB\FIVEH.LIB|ADOFUNCS
Error: Unresolved external '_HB_FUN_OCCURS' referenced from C:\FWH1611\LIB\FIVEH.LIB|XBROWSE
Error: Unresolved external '_hb_extIsNil' referenced from C:\FWH1611\LIB\FIVEHC.LIB|RICHEDIT
Error: Unresolved external '_HB_FUN_HB_TSTOUTC' referenced from C:\FWH1611\LIB\FIVEH.LIB|VALTOSTR
Error: Unable to perform link
* Linking errors *
Try to link xhb.lib and let us know the result.
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: compile errors
Posted: Thu Apr 11, 2024 02:56 PM
Antonio Linares wrote:Dear Jeff,

Could you please post the source code of the example here so we can test it ?

thanks
+1
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: compile errors
Posted: Thu Apr 11, 2024 03:01 PM
This is the code I'm trying to compile.
Code (fw): Select all Collapse
#include "FiveWin.ch"
#include "directry.ch"
#include "FileIO.ch"
#include "Common.ch"
#include "hbclass.ch"
#include "C:\Harbour\Include\hbcurl.ch"

#define ACCOUNT_SID  "XxxxxxxxXxXXXX"
#define AUTH_TOKEN   "Twilio-Acc-Token"
#define TEL_FROM     "YourTwilioNumber"
#define TEL_TO       "555-555-5555"

FUNCTION SendSMS()
   LOCAL hCurl, nError, httpcode
   LOCAL cUrl     := "https://api.twilio.com/2010-04-01/Accounts/" + ACCOUNT_SID + "/Messages.json"
   LOCAL cPostFields := 'To='    + TEL_TO +;
                        "&From=" + TEL_FROM +;
                        "&Body=" + Time() + " SMS From TestTwilio.exe"

   curl_global_init()

   IF ! EMPTY( hCurl := curl_easy_init() )
      curl_easy_setopt( hCurl, HB_CURLOPT_POST, 1 )
      curl_easy_setopt( hCurl, HB_CURLOPT_URL, cUrl )
      curl_easy_setopt( hcurl, HB_CURLOPT_POSTFIELDS, cPostFields )
      curl_easy_setopt( hCurl, HB_CURLOPT_USERPWD, ACCOUNT_SID + ':' + AUTH_TOKEN )
      curl_easy_setopt( hCurl, HB_CURLOPT_DL_BUFF_SETUP )
      curl_easy_setopt( hCurl, HB_CURLOPT_VERBOSE, 1 )
      curl_easy_setopt( hCurl, HB_CURLOPT_SSL_VERIFYPEER, .F. )
      nError := curl_easy_perform( hCurl )
      curl_easy_getinfo( hCurl, HB_CURLINFO_RESPONSE_CODE, @httpcode )
   ENDIF
   curl_global_cleanup()
RETURN NIl
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: compile errors
Posted: Thu Apr 11, 2024 03:05 PM

Same errors if I add in xhb.lib

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 44158
Joined: Thu Oct 06, 2005 05:47 PM
Re: compile errors
Posted: Thu Apr 11, 2024 03:09 PM
Dear Jeff,

You can download from https://github.com/FiveTechSoft/harbour_and_xharbour_builds the most recent Harbour and xHarbour builds just to be sure you have all the right libs

In the list of builds, please look for the most recent dates
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 9020
Joined: Thu Oct 06, 2005 08:17 PM
Re: compile errors
Posted: Thu Apr 11, 2024 03:16 PM
This is the error:
Code (fw): Select all Collapse
#include "C:\Harbour\Include\hbcurl.ch"
Please replace it with
Code (fw): Select all Collapse
#include "hbcurl.ch"
Compiles fine here. And please use latest Harbour and xHarbour builds:

https://github.com/FiveTechSoft/harbour_and_xharbour_builds
http://xharbour.org/index.asp?page=download/windows/binaries_win
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: compile errors
Posted: Thu Apr 11, 2024 03:25 PM

I've updated the harbour files and made the changes mentioned above.

Done to 1 error now:

Turbo Incremental Link 6.80 Copyright (c) 1997-2017 Embarcadero Technologies, Inc.

Error: Unresolved external '___get_std_stream' referenced from C:\HARBOUR\LIB\HBVM.LIB|fm

Error: Unable to perform link

  • Linking errors *
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: compile errors
Posted: Thu Apr 11, 2024 03:59 PM

I found this in the fourms...

pragma BEGINDUMP

void __get_std_stream() {}

void _chdir() {}

pragma ENDDUMP

I added that and it compiles but when I run the program I get an error:

"The procedure entry point curl_mime_addpart could not be

located in the dynamic link library C:\Certus\CertusPIN2.exe"

Any ideas?

Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)
Posts: 933
Joined: Sun Oct 09, 2005 01:05 PM
Re: compile errors
Posted: Thu Apr 11, 2024 04:02 PM
scratch the last message.
I forgot to update libcurl.dll

No errors now.

By adding this code, does it affect anything?
Code (fw): Select all Collapse
#pragma BEGINDUMP
void __get_std_stream() {}
void _chdir() {}
#pragma ENDDUMP
Thanks,

Jeff Barnes



(FWH 16.11, xHarbour 1.2.3, Bcc730)