CURL for HMG latest Version ?

General Help regarding HMG, Compilation, Linking, Samples

Moderator: Rathinagiri

PeteWG
Posts: 176
Joined: Sun Mar 21, 2010 5:45 pm

Re: CURL for HMG latest Version ?

Post by PeteWG »

edk wrote: Thu Sep 22, 2022 12:03 pm Support for IMAP and SMTP protocols from HMG using the latest fork of the libcurl library.

In the attachment I am sending sources, libraries for example of using libCurl in communication with mail servers via IMAP and SMTP protocols.
Great contribution!
Thanks for sharing.

regards,
Pete
User avatar
AUGE_OHR
Posts: 2093
Joined: Sun Aug 25, 2019 3:12 pm
DBs Used: DBF, PostgreSQL, MySQL, SQLite
Location: Hamburg, Germany

Re: CURL for HMG latest Version ?

Post by AUGE_OHR »

hi,

i like to use it for 64 Bit so i try to build LIB
follow Thread http://hmgforum.com/viewtopic.php?p=45764#p45764

i got
c:\hmg.3.4.4\HARBOUR-64\contrib\hbcurl>rem http://hmgforum.com/viewtopic.php?p=45764#p45764
hbmk2: Dependency 'curl' found: c:\curl-7.85.0_5-win64-mingw\include
hbmk2[hbcurl]: Warning: No import library sources were found.
hbmk2: Compiling Harbour sources...
Harbour 3.2.0dev (r1604201603)
Copyright (c) 1999-2016, http://harbour-project.org/
Compiling 'misc.prg'...
Lines 67, Functions/Procedures 2
Generating C source output to '.hbmk\win\mingw64\misc.c'... Done.
hbmk2: Compiling...
../../../easy.c: In function 'HB_FUN_CURL_EASY_SETOPT':
../../../easy.c:2188:25: warning: implicit declaration of function 'hb_fileParamGet' [-Wimplicit-function-declaration]
else if( hb_fileParamGet( 3 ) )
^
../../../easy.c:2189:36: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
hb_curl->ul_file = hb_fileParamGet( 3 );
^
../../../easy.c:2219:36: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
hb_curl->dl_file = hb_fileParamGet( 3 );
^
hbmk2: Creating static library... libhbcurl.a
Drücken Sie eine beliebige Taste . . .
now i copy libhbcurl.a into c:\hmg.3.4.4\HARBOUR-64\lib\win\mingw64\

when build App i got Error while missing libcurl ...
hbmk2: Processing local make script: hbmk.hbm
Harbour 3.2.0dev (r1604201603)
Copyright (c) 1999-2016, http://harbour-project.org/
C:/hmg.3.4.4/mingw-64/bin/../lib/gcc/x86_64-w64-mingw32/5.3.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -llibcurl
collect2.exe: error: ld returned 1 exit status
what i´m doing wrong :?:
did somebody already have those LIB.A for 64 Bit and can share them :?:
have fun
Jimmy
User avatar
tonton2
Posts: 455
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Re: CURL for HMG latest Version ?

Post by tonton2 »

Bonjour tout le monde,
how to know if a directory exists or not in c:\
for a file it's :
If ! file ("c:\sample\demo.prg')
...
endif
here it's working but for a directory it is not working

if not directory ('c:\sample')
...
endif
here it is not working
than's for your help
L'Algerie vous salut
Y.TABET
huiyi_ch
Posts: 173
Joined: Sat May 21, 2016 5:27 am

Re: CURL for HMG latest Version ?

Post by huiyi_ch »

hb_DirExists(<cDir>) ➜ lExists
checks if <cDir> exists. Note: it won't work with wild-cards.
returns .T. if <cDir> exists, otherwise .F.
User avatar
tonton2
Posts: 455
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Re: CURL for HMG latest Version ?

Post by tonton2 »

huiyi_ch wrote: Sat Jan 07, 2023 11:38 am hb_DirExists(<cDir>) ➜ lExists
checks if <cDir> exists. Note: it won't work with wild-cards.
returns .T. if <cDir> exists, otherwise .F.
Thank's ,i am going to try it
L'Algerie vous salut
Y.TABET
User avatar
tonton2
Posts: 455
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Re: CURL for HMG latest Version ?

Post by tonton2 »

huiyi_ch wrote: Sat Jan 07, 2023 11:38 am hb_DirExists(<cDir>) ➜ lExists
checks if <cDir> exists. Note: it won't work with wild-cards.
returns .T. if <cDir> exists, otherwise .F.
can you make an example with c:\sample please
Merci beaucoup
L'Algerie vous salut
Y.TABET
User avatar
tonton2
Posts: 455
Joined: Sat Jun 29, 2013 1:26 pm
Location: Algerie
Contact:

Re: CURL for HMG latest Version ?

Post by tonton2 »

huiyi_ch wrote: Sat Jan 07, 2023 11:38 am hb_DirExists(<cDir>) ➜ lExists
checks if <cDir> exists. Note: it won't work with wild-cards.
returns .T. if <cDir> exists, otherwise .F.
It's OK thank you very much
L'Algerie vous salut
Y.TABET
User avatar
mol
Posts: 3774
Joined: Thu Sep 11, 2008 5:31 am
Location: Myszków, Poland
Contact:

Re: CURL for HMG latest Version ?

Post by mol »

Hi Edward!
I can't compile this project because of missing lib files. What's going on?
EDIT:

I've compiled this project, but at runtime I get:

Nie można kontynuować wykonywania kodu, ponieważ nie znaleziono obiektu (null).DLL Ponowne zainstalowanie programu może rozwiązać ten problem.

Ciekawe, którego .dll brakuje?
User avatar
serge_girard
Posts: 3309
Joined: Sun Nov 25, 2012 2:44 pm
DBs Used: 1 MySQL - MariaDB
2 DBF
Location: Belgium
Contact:

Re: CURL for HMG latest Version ?

Post by serge_girard »

Edward,

I get runtime errors on HB_CURLVERINFO_VERSION + HB_CURLOPT_DEBUGBLOCK....

Have I missed something?

Serge
There's nothing you can do that can't be done...
edk
Posts: 999
Joined: Thu Oct 16, 2014 11:35 am
Location: Poland

Re: CURL for HMG latest Version ?

Post by edk »

Have you replaced the curl libraries in HMG with the newer ones included in my example? The definitions you are writing about are in the file hbcurl.ch, did you include this file in prg?
edk wrote: Thu Sep 22, 2022 12:03 pm Important. The newest libraries for both libcurl and the Harbour fork of this library are required for the program to compile.

The libcurl.dll (version 7.85) and the rest of the .dll files should be placed in the same folder as the executing program. The libCurl fork for Harbour is located in the hmg.3.4.4 subfolder. You need to copy the contents of this folder to your location of hmg.3.4.4 (not tested on other versions) overwriting old files.

The new fork is necessary to be able to read the information headers sent from the IMAP server. Unfortunately, the native functions for reading these headers do not work in this fork, the solution is to process them in debug mode, which slows down the whole process, but well: Beggars can't be choosers ;-)
Post Reply