1. C Compiler problem with eulibcURL

Hi,

I just came across a problem with eulibcURL:
I wrote a program using eulibcURL, then I compiled it with the 
Euphoria/Borland, but when I execute it, it will not work. As I 
wasn't sure if it wasn't due to my programming I tried to compile the 
examples in eulibcURL, f.e. download.exw or errmsg_dl.exw. They also 
do not work.

Might I ask you to have a look into this? To tell the truth, my 
knowledge of Curl as well as Euphoria is not sufficient to solve this 
problem, and I would like to use eulibcURL in my program as I see a 
lot of possibilities in it.

This was my Email to Ray; he answered, that he don't program in Euphoria 
no more and that he would like me to ask EUforum for help, what I´m doing
now.

Any ideas, any help available?

Greetings, Thomas

new topic     » topic index » view message » categorize

2. Re: C Compiler problem with eulibcURL

Thomas K. wrote:
> I just came across a problem with eulibcURL:
> I wrote a program using eulibcURL, then I compiled it with the 
> Euphoria/Borland, but when I execute it, it will not work. 

It is not you, it is the EU To C Borland translator. A few times I have 
translated a app that works fine in EU but crashes when translated to C
using Boarland. If you compile your app using Watcom it will work.
But it would be nice to find out why EULibCurl crashes when translated
to C using Borland. 




----If you continue to do what you have always done,
you will get what you have always gotten.----

new topic     » goto parent     » topic index » view message » categorize

3. Re: C Compiler problem with eulibcURL

Ok, thank you, I will try Watcom then!

new topic     » goto parent     » topic index » view message » categorize

4. Re: C Compiler problem with eulibcURL

C Bouzy wrote:
> Thomas K. wrote:
> > I just came across a problem with eulibcURL:
> > I wrote a program using eulibcURL, then I compiled it with the 
> > Euphoria/Borland, but when I execute it, it will not work. 
> 
> It is not you, it is the EU To C Borland translator. A few times I have 
> translated a app that works fine in EU but crashes when translated to C
> using Boarland. If you compile your app using Watcom it will work.
> But it would be nice to find out why EULibCurl crashes when translated
> to C using Borland. 

As I keep explaining, this type of situation is almost invariably 
due to an error in the application program where the programmer has
failed to specify the CDECL calling convention. By luck, the program usually
works with the exw interpreter, or with the Translator and Watcom.
(If it works, it will always work.)

If you change two lines in eulibcURL, in the file wrapper.ew,
adding a "+" at the start of each name to indicate the CDECL
convention, then it stops crashing with Borland and starts working fine. 
(I haven't retested any others, but easy_download.exw started 
working when I made this change.)

------------------------------------------------
-- link_func - taken from win32lib - thanks David
------------------------------------------------
global function link_func(atom dll, sequence name, sequence args, atom result)
         integer handle

handle = define_c_func(dll, "+" & name, args, result) -- add "+" to
         name
         if handle = -1 then
        wait_abort("Couldn't link to C function " & name)
         end if
         return handle

end function

------------------------------------------------
-- link_proc - taken from win32lib - thanks David
------------------------------------------------
global function link_proc(atom dll, sequence name, sequence args)
         integer handle

         handle = define_c_proc(dll, "+" & name, args) -- add "+" to name
         if handle = -1 then
        wait_abort("Couldn't link to C procedure " & name)
         end if
         return handle

end function


Since Ray isn't active here anymore, I will upload this change
to Recent User Contributions after testing it some more.

To be fair, this CDECL feature was not available
when Ray created eulibcURL.

Regards,
   Rob Craig
   Rapid Deployment Software
   http://www.RapidEuphoria.com

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu