FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin para Harbour/xHarbour De *.C Para *.Obj en BCC74 no funciona más.
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: De *.C Para *.Obj en BCC74 no funciona más.
Posted: Sat Nov 18, 2023 02:47 PM
Enrico Maria Giordano wrote:hbcurl.lib, but I don't know how to use it, sorry.
Enrico, there is a .LIB or .CH missing for xHarbour.

Enrico, falta un .LIB o .CH para xHarbour.
Code (fw): Select all Collapse
Embarcadero C++ 7.70 for Win32 Copyright (c) 1993-2023 Embarcadero Technologies, Inc.
FWHCURL.c:
Turbo Incremental Link 6.97 Copyright (c) 1997-2022 Embarcadero Technologies, Inc.
Error: Unresolved external '_curl_global_init_mem' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_global_cleanup' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_formfree' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_cleanup' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_reset' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_duphandle' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_init' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_pause' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_perform' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_send' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_recv' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_formadd' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_slist_append' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_setopt' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_getinfo' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_slist_free_all' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_escape' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_unescape' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_version' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_version_info' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_strerror' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_getdate' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_escape' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_unescape' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_free' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unable to perform link
* Linking errors *
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: De *.C Para *.Obj en BCC74 no funciona más.
Posted: Sat Nov 18, 2023 02:54 PM

Can I see the source code you are trying to compile, please?

Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: De *.C Para *.Obj en BCC74 no funciona más.
Posted: Sat Nov 18, 2023 03:08 PM
Enrico Maria Giordano wrote:Can I see the source code you are trying to compile, please?
Code (fw): Select all Collapse
// C:\FWH\SAMPLES\FWHCURL.PRG

#include "FiveWin.ch"
#include "fileio.ch"
#include "C:\XHBBCC74\contrib\hbcurl\hbcurl.ch"

FUNCTION Main()

   curl_global_init()

   ? "Hello world"

   ? callPHP( "www.fivetechsoft.com/getip.php" )

   curl_global_cleanup()

RETURN NIL

FUNCTION callPHP( cUrl )

   LOCAL hCurl, uValue

   IF .NOT. Empty( hCurl := curl_easy_init() )

      curl_easy_setopt( hCurl, HB_CURLOPT_URL, cUrl )

      curl_easy_setopt( hCurl, HB_CURLOPT_DL_BUFF_SETUP )

      IF curl_easy_perform( hCurl ) == 0

         uValue = curl_easy_dl_buff_get( hCurl )

      ENDIF

   ENDIF

RETURN uValue

// fin / end
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: De *.C Para *.Obj en BCC74 no funciona más.
Posted: Sat Nov 18, 2023 03:29 PM
Thank you. You have to generate libcurl.lib from
Code (fw): Select all Collapse
implib -a libcurl.lib libcurl.dll
And then link both hbcurl.lib and libcurl.lib to your EXE. And put libcurl.dll in the same directory of your EXE or in the windows\system directory.
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: De *.C Para *.Obj en BCC74 no funciona más.
Posted: Sat Nov 18, 2023 04:08 PM

If you need all the required files just ask me.

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: De *.C Para *.Obj en BCC74 no funciona más.
Posted: Sat Nov 18, 2023 06:52 PM
karinha wrote:
Code (fw): Select all Collapse
// C:\FWH\SAMPLES\FWHCURL.PRG
There is no FWHCURL.PRG in FWH. Anyway, this is the correct and working sample:
Code (fw): Select all Collapse
#include "Fivewin.ch"
#include "Hbcurl.ch"


FUNCTION MAIN()

    CURL_GLOBAL_INIT()

    ? CALLPHP( "https://www.fivetechsoft.com/getip.php" )

    CURL_GLOBAL_CLEANUP()

    RETURN NIL


FUNCTION CALLPHP( cUrl )

    LOCAL hCurl, cRet

    hCurl = CURL_EASY_INIT()

    IF !EMPTY( cUrl )
        CURL_EASY_SETOPT( hCurl, HB_CURLOPT_URL, cUrl )

        CURL_EASY_SETOPT( hCurl, HB_CURLOPT_DL_BUFF_SETUP )

        CURL_EASY_SETOPT( hCurl, HB_CURLOPT_SSL_VERIFYPEER, 0 )

        IF CURL_EASY_PERFORM( hCurl ) = 0
            cRet = CURL_EASY_DL_BUFF_GET( hCurl )
        ENDIF

        CURL_EASY_CLEANUP( hCurl )
    ENDIF

    RETURN cRet
Posts: 1818
Joined: Wed Oct 26, 2005 02:49 PM
Re: De *.C Para *.Obj en BCC74 no funciona más.
Posted: Sun Nov 19, 2023 10:42 AM
Enrico buenos días como estas?

Primero que todo quiero agradecerte por el avance que has venido haciendo en xharbour :D

Por otro lado ya descargamos la nueva versión de xharbour para bbc770. Intentamos compilar el ejemplo para curl, pero nos sale el error que relacionamos a continuación. Creemos que es por que no encuentra el archivo de cabecera hbcurl.ch, no lo encuentro en la carpeta de FW2310 ni en la distribución de xharbour que acabamos de descargar.

#include "Hbcurl.ch" <-en donde lo podemos descargar? o si lo tienes, lo puedes publicar. De antemano gracias
Code (fw): Select all Collapse
┌────────────────────────────────────────────────────────────────────────────┐
?FiveWin for xHarbour 23.10 - Oct. 2023          Harbour development power  │▄
?(c) FiveTech 1993-2023 for Microsoft Windows 9X/NT/200X/ME/XP/Vista/7/8/10 │█
└────────────────────────────────────────────────────────────────────────────┘?
  ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀?
Compiling...
xHarbour 1.3.0 Intl. (SimpLex) (Build 20231104)
Copyright 1999-2023, http://www.xharbour.org http://www.harbour-project.org/
Compiling 'leandro2.prg' and generating preprocessed output to 'leandro2.ppo'...
* Compile errors *

C:\fwh2310\samples>
Saludos
LEANDRO AREVALO
Bogotá (Colombia)
https://hymlyma.com
https://hymplus.com/
leandroalfonso111@gmail.com
leandroalfonso111@hotmail.com

[ Turbo Incremental Link64 6.98 Embarcadero 7.70 ] [ FiveWin 25.01 ] [ xHarbour 64 bits) ]
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: De *.C Para *.Obj en BCC74 no funciona más.
Posted: Sun Nov 19, 2023 10:48 AM

I'm working to include hbcurl.ch, libcurl.lib and libcurl.dll in the distribution packages.

Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: De *.C Para *.Obj en BCC74 no funciona más.
Posted: Sun Nov 19, 2023 01:16 PM
Please try with this new build and let me know:

http://www.xharbour.org/files/download/windows/xhb10276_bcc770.zip

This includes all the required libs and ddls for ssl and curl.
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: De *.C Para *.Obj en BCC74 no funciona más.
Posted: Sun Nov 19, 2023 01:44 PM
Please download it again, I forgot libcurl.dll. :-)

http://www.xharbour.org/files/download/windows/xhb10276_bcc770.zip
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: De *.C Para *.Obj en BCC74 no funciona más.
Posted: Mon Nov 20, 2023 02:42 PM
Enrico Maria Giordano wrote:Please download it again, I forgot libcurl.dll. :-)

http://www.xharbour.org/files/download/windows/xhb10276_bcc770.zip
master Enrico:
Code (fw): Select all Collapse
Lines 42, Functions/Procedures 2, pCodes 83
Embarcadero C++ 7.70 for Win32 Copyright (c) 1993-2023 Embarcadero Technologies, Inc.
FWHCURL.c:
Turbo Incremental Link 6.97 Copyright (c) 1997-2022 Embarcadero Technologies, Inc.
Error: Unresolved external '_curl_global_init_mem' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_global_cleanup' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_formfree' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_cleanup' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_reset' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_duphandle' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_init' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_pause' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_perform' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_send' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_recv' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_formadd' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_slist_append' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_setopt' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_getinfo' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_slist_free_all' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_escape' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_unescape' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_version' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_version_info' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_easy_strerror' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_getdate' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_escape' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_unescape' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unresolved external '_curl_free' referenced from C:\XHBBCC77\LIB\HBCURL.LIB|hbcurl
Error: Unable to perform link
* Linking errors *
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: De *.C Para *.Obj en BCC74 no funciona más.
Posted: Mon Nov 20, 2023 02:49 PM

You have to link libcurl.dll.

Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: De *.C Para *.Obj en BCC74 no funciona más.
Posted: Mon Nov 20, 2023 03:12 PM
Enrico Maria Giordano wrote:You have to link libcurl.dll.
OK!! Funcionó! Super many thanks.
Code (fw): Select all Collapse
echo %hdirl%\hbcurl.lib + >> b32.bc
echo %hdirl%\libcurl.lib + >> b32.bc
Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 8523
Joined: Tue Dec 20, 2005 07:36 PM
Re: De *.C Para *.Obj en BCC74 no funciona más.
Posted: Mon Nov 20, 2023 03:28 PM
Enrico, mira esta classe hecha por el colega João Alpande:

http://www.pctoledo.com.br/forum/viewtopic.php?f=4&t=27288&p=162640#p162639

Gracias, thanks.

Regards, saludos.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
Posts: 9022
Joined: Thu Oct 06, 2005 08:17 PM
Re: De *.C Para *.Obj en BCC74 no funciona más.
Posted: Mon Nov 20, 2023 03:48 PM

Great! Sorry, I'm not familiar with curl (I've never used it).