compile errors - send a SMS

compile errors - send a SMS

Postby Jeff Barnes » Thu Apr 11, 2024 2: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: Select all  Expand view

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)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: compile errors

Postby Antonio Linares » Thu Apr 11, 2024 2: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: compile errors

Postby Jeff Barnes » Thu Apr 11, 2024 2: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)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: compile errors

Postby Jeff Barnes » Thu Apr 11, 2024 2:45 pm

If I try with harbour I get these errors:

Code: Select all  Expand view

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)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: compile errors

Postby Antonio Linares » Thu Apr 11, 2024 2: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: compile errors

Postby Enrico Maria Giordano » Thu Apr 11, 2024 2:49 pm

Jeff, it looks as you are mixing Harbour and xHarbour libraries. Please double check.
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: compile errors

Postby Enrico Maria Giordano » Thu Apr 11, 2024 2:56 pm

Jeff Barnes wrote:If I try with harbour I get these errors:

Code: Select all  Expand view

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.
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: compile errors

Postby Enrico Maria Giordano » Thu Apr 11, 2024 2: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
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: compile errors

Postby Jeff Barnes » Thu Apr 11, 2024 3:01 pm

This is the code I'm trying to compile.

Code: Select all  Expand view

#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)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: compile errors

Postby Jeff Barnes » Thu Apr 11, 2024 3:05 pm

Same errors if I add in xhb.lib
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: compile errors

Postby Antonio Linares » Thu Apr 11, 2024 3: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
User avatar
Antonio Linares
Site Admin
 
Posts: 42099
Joined: Thu Oct 06, 2005 5:47 pm
Location: Spain

Re: compile errors

Postby Enrico Maria Giordano » Thu Apr 11, 2024 3:16 pm

This is the error:

Code: Select all  Expand view
#include "C:\Harbour\Include\hbcurl.ch"


Please replace it with

Code: Select all  Expand view
#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
User avatar
Enrico Maria Giordano
 
Posts: 8715
Joined: Thu Oct 06, 2005 8:17 pm
Location: Roma - Italia

Re: compile errors

Postby Jeff Barnes » Thu Apr 11, 2024 3: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)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: compile errors

Postby Jeff Barnes » Thu Apr 11, 2024 3: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)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Re: compile errors

Postby Jeff Barnes » Thu Apr 11, 2024 4:02 pm

scratch the last message.
I forgot to update libcurl.dll

No errors now.

By adding this code, does it affect anything?

Code: Select all  Expand view

#pragma BEGINDUMP
void __get_std_stream() {}
void _chdir() {}
#pragma ENDDUMP
 
Thanks,
Jeff Barnes

(FWH 16.11, xHarbour 1.2.3, Bcc730)
User avatar
Jeff Barnes
 
Posts: 929
Joined: Sun Oct 09, 2005 1:05 pm
Location: Ontario, Canada

Next

Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: Google [Bot] and 82 guests