cURL / Mailing Lists / curl-library / Single Mail

curl-library

RE: Another WinCE issue

From: Jacques Dubé <jdube_at_spintl.com>
Date: Wed, 15 Jun 2016 17:09:32 -0400

Henri,
First before everything, thanks for the quick reply. I'm however happy to tell you that I actually managed to resolve the issue (I think. The basic function PUT, POST and GET from REST work, but I have not tested everything yet). I'll first answer some of your questions before telling you how I made it work:
 1. Do you use early binding or late binding?
A1. It is a early binding. I did it with the linker input option first, then used the #pragma comment(lib) instead after

 2. This is conflicting. If you cannot enter main, how are you calling curl_global_init? Do not call it from a static initialization function.
A2. Mainly, I was testing if the library function was correctly mapped. So in the init() of the application (MFC), I only add 1 function : curl_global_init(). Commenting the line allowed the program to launch. Uncommenting it caused failure as described.

How did I fix it?
I'm not entirelly sure I fixed everything since I writed this mail 30 seconds after seeing the program working as intended, but the functions I wanted seems to work fine. Mainly, I have around 4 version of Visual Studio on my machine, and I managed to use VS2008 for WinCE after some tweek. So I used the machine that the company use to make the BSP (which have only Visual Studio 2005 installed). I deleted every files and started from scratch. I compiled wcecompat on it the same ways as described, then compiled cURL with the VC8 project with the following minor difference:
1. Since config-win32ce disable LDAP, I removed the references to it in the linker
2. I did not copy every settings of the project. Only those that were required to compile (location of source code, using standard library instead of MFC, etc. The basic.)
3. In config-win32ce, I only uncommented HAVE_ERRNO_H
4. In config-win32ce, I added :
        #ifndef HAVE_ERRNO_H
        #define ENOSPC 1
        #define ENOMEM 2
        #define EAGAIN 3
        #endif
          Thoses where already defined in the errno.h of wcecompat, but where set to undef if already defined. To the constant's value did not match between cURL and the library

After that, everything seemed to work with the exception of the curl_easy_perform infinite loop issue with wcecompat (which was resolved there : http://stackoverflow.com/questions/22640158/libcurl-on-windows-ce-curl-easy-perform-doesnt-return)

Also, there was very few warnings this time. (Only 4 >= signed/unsigned mismatch). I'll send you the compiled version in another mail to be sure that this one don't bounce back.

-----Message d'origine-----
De : curl-library [mailto:curl-library-bounces_at_cool.haxx.se] De la part de Henri Hein
Envoyé : Wednesday, June 15, 2016 3:14 PM
À : 'libcurl development'
Objet : Re: Another WinCE issue

 
 
On Tue, Jun 14, 2016 at 11:04 AM, Jacques Dubé <jdube_at_spintl.com> wrote:
> However, now that I have a compiled version of cURL, my program can’t
> link it : in other word it compile but don’t work. Since I’m not well
> versed in open source projects, I need to call for help here. How can
> I obtain a WinCE version of cURL that actually work (I just need the basic, no SSL stuff)?

Based on your other comments, I think you mean that you successfully built the libcurl DLL, but that it won't load at runtime.

Do you use early binding or late binding? IOW, do you link with libcurl.lib, or do you use LoadLibrary to load libcurl.dll?
Try to make a small sample that uses LoadLibrary() to load libcurl.dll, then report the result of LoadLibrary() and GetLastError().

> · The library compiled, but I get a lot of warning (signed/unsigned
> mismatch, cast truncate, etc.)

The team is doing a great job minimizing warnings, but it is pretty tough to eliminate them completely, given the range of toolchains and SDKs the codebase has to work with.

> · The process won't start on CE as soon as I call curl_global_init
> (can’t even reach the first line of the main in debug)

This is conflicting. If you cannot enter main, how are you calling curl_global_init? Do not call it from a static initialization function.

> · The application and the dll are in the same work folder. Also
> tried to put the dll in the Windows folder, same result

It does not sound like it has an issue finding the dll, but in loading it. Try to build the curl dll and generate a .map file, then examine the map file to see which symbols and modules you might be missing at runtime.

HTH,
  - Henri

 
 

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html

-------------------------------------------------------------------
List admin: https://cool.haxx.se/list/listinfo/curl-library
Etiquette: https://curl.haxx.se/mail/etiquette.html
Received on 2016-06-15