×

Discussion Board

Page 1 of 3 123 LastLast
Results 1 to 15 of 41
  1. #1
    Registered User
    Join Date
    Mar 2012
    Posts
    32

    Symbian Belle and libCurl

    Hi there,

    well, I gave up on secure sockets and thought I would try to incorporate libCurl instead. I've managed to build libCurl for Symbian and my application code seems happy enought to build. However, when I try to run on a phone the application fails to starts. So, I guess I have two questiosn here.

    Firstly (and I speak as a complete newbie here), when an appilcation fails to start, is there any way of finding out why not?

    Secondly, has anyone tried libCurl with Belle? As I mentioned above, the code is happy to build and all the required libraries appear to be present, so I'm hoping the failure to start is being caused by something else, but I'm prepared to believe otherwise.

  2. #2
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,737

    Re: Symbian Belle and libCurl

    Enable the error messages, that may reveal something: http://www.developer.nokia.com/Commu...ded_panic_code
    Have you built the library as a statically linked one? If not, make sure that the .dll is also installed on the device.
    In this latter case also check the capability requirements, the .dll can not have less capabilities than the .exe.

  3. #3
    Registered User
    Join Date
    Mar 2012
    Posts
    32

    Re: Symbian Belle and libCurl

    I tried initially with curl as a dll, but when I built a sis file with the supplied pkg file it failed to install; I got an error message about a bad certificate. I'm now trying to link curl as a static library, but I'm getting linker errors. The curl code didn't come with a mmp file to create a static library, so perhaps it was never intended to be used this way.

    I think the application was failing to start due to a "stupid user" error. I thought the LIBRARY command in the mmp file would link the curl library statically. I now realise that it doesn't, which is why I'm now trying the STATICLIBRARY command and getting linker errors.

    Thanks for the link. I'll try that too.

  4. #4
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,737

    Re: Symbian Belle and libCurl

    You can try the .dll, just check the CAPABILITY line in the .mmp file. For self-signing, it can contain the first group listed in http://www.developer.nokia.com/Commu...i/Capabilities
    Also, for self-signing, the UID has to be unprotected, something from the 0xAxxxxxxx or 0xExxxxxxx range.

  5. #5
    Registered User
    Join Date
    Mar 2012
    Posts
    32

    Re: Symbian Belle and libCurl

    I've been trying to get curl to link as a static library and finding issues. I had to change the definition of __sfileno in one header file (changed from IMPORT_C to a definition) but now I'm having a problem with fcntl. It's in a header file, but doesn't appear to be in any of the libraries I'm building against. I found some discussion on this elsewhere and it appears the solution is to just not use it in the code. I'm wondering if this will also prevent me from running curl as a dll as it won't find fcntl anywhere when it tries to run.

  6. #6
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,737

    Re: Symbian Belle and libCurl

    It is not clear from your posts, but if you are trying to port code with Linux/GNU/POSIX/etc. roots, you should use the OpenC/C++ subsystem. The include folder epoc32\include\stdapis (and _not_ libc, which is the obsolete POSIX-like subsystem), and libc.lib, libstdcpp.lib, etc. (and _not_ estlib.lib).
    In the Belle SDK it is pretty much integrated, and unfortunately the documentation and the examples do not seem to be there. For older SDK-s it is a plugin, available from https://www.developer.nokia.com/Deve...ian_C++/Tools/, you may want to download it and try to install it separately (perhaps it is possible without installing a complete SDK for it), then you will have the documentation and the examples.

  7. #7
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    200

    Re: Symbian Belle and libCurl

    Here's a source I've used, you could use it as a reference?
    http://svn.gna.org/viewcvs/warmux/trunk/build/lib/curl/

    It compiles and links at least with S60v5 and Symbian^3 SDK's, but I'm not sure about complete usability since only one or two features are actually used.

    edit: ssl and zlib are disable in this build
    Last edited by mikkovtr; 2012-03-16 at 20:12.

  8. #8
    Registered User
    Join Date
    Mar 2012
    Posts
    32

    Re: Symbian Belle and libCurl

    Quote Originally Posted by wizard_hu_ View Post
    It is not clear from your posts, but if you are trying to port code with Linux/GNU/POSIX/etc. roots, you should use the OpenC/C++ subsystem. The include folder epoc32\include\stdapis (and _not_ libc, which is the obsolete POSIX-like subsystem), and libc.lib, libstdcpp.lib, etc. (and _not_ estlib.lib).
    In the Belle SDK it is pretty much integrated, and unfortunately the documentation and the examples do not seem to be there. For older SDK-s it is a plugin, available from https://www.developer.nokia.com/Deve...ian_C++/Tools/, you may want to download it and try to install it separately (perhaps it is possible without installing a complete SDK for it), then you will have the documentation and the examples.
    We have an application for IOS and WebOS that uses curl. I am trying to update a Symbian version of the application to also curl. The mmp file for curl has the following:

    SYSTEMINCLUDE ../../../include /epoc32/include/stdapis /epoc32/include

    LIBRARY euser.lib libc.lib

    which I think means it is going to the correct places and using the correct libraries, if I understand your comments correctly. I am slightly concerned that I can't get our application to link with curl due to linker error whemn it's a static library. It makes me think a dll version of curl won't run either as it won't be abe to find all it needs once it's installed. The Posix issue arises because curl says it is built on top of PIPS. However, the latest download for curl appears to pre-date Belle, so was perhaps never tested against it. I suspect what I am trying to do would work just fine with older versions of Symbian. I shall persevere. it must be possible to do this.

  9. #9
    Registered User
    Join Date
    Mar 2012
    Posts
    32

    Re: Symbian Belle and libCurl

    I started again at the beginning in case I had made a silly mistake somewhere, but I've returned to the same point. When I build curl as a library and then do a static link to the application code I get a linker error in epoc32\include\stdapis\stdio.h, at the line "IMPORT_C int __sfileno(FILE* p);". Since other IMPORT_C's appear to be okay, for example "IMPORT_C int fileno(FILE *);" in the previous line, this suggests to me that __sfileno doesn't exist in a Belle library. Is there a way for me to check this? Alternatively, is the linker telling me that I am doing something wrong in the build process? I'm a bit surprised to find an issue in a system header.

  10. #10
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    200

    Re: Symbian Belle and libCurl

    do you have LIBRARY libc.lib in your application mmp file?

  11. #11
    Registered User
    Join Date
    Mar 2012
    Posts
    32

    Re: Symbian Belle and libCurl

    Ooops, no. I previously went through the curl mmp file and the application mmp file to make sure the same libraries were referenced, but I appear to have missed that one. However, I now get armlink.exe saying it has encountered problems and has to shut down, and the following:

    Error 5 sbs: error: The make-engine exited with errors.

    I haven't been able to find anything to tell me what an Error 5 is. Any ideas.

    Incidentally, I can happily build curl, but I then have to edit curl.h before the application code will build. I have to remove the inclusion of <sys/select.h>. It's all very mysterious; but that's Symbian in a nutshell.

  12. #12
    Registered User
    Join Date
    Mar 2012
    Posts
    32

    Re: Symbian Belle and libCurl

    I should add that I get the error when I specify libcurl.lib to be a static library in the application mmp file. If I specify it as a library the build completes successfully. So, when I build curl as a library, do I have to do something different in it's mmp file if I want to link it as a static library? Alternatively, is there something I need to do in the application mmp file other than using STATICLIBRARY libcurl.lib?

  13. #13
    Regular Contributor
    Join Date
    Nov 2009
    Posts
    200

    Re: Symbian Belle and libCurl

    Quote Originally Posted by davidmcc View Post
    Incidentally, I can happily build curl, but I then have to edit curl.h before the application code will build. I have to remove the inclusion of <sys/select.h>. It's all very mysterious; but that's Symbian in a nutshell.
    This could be related to includes (and order of includes) in application mmp file. Particularly check where you have SYSTEMINCLUDE \epoc32\include\stdapis and try moving forward in the order.


    When curl is a static library you need to have (I think) CAPABILITY NetworkServices in application mmp file. curl mmp needs to have TARGETTYPE lib when building as a static library.

    Here is a example of curl mmp http://svn.gna.org/viewcvs/warmux/tr...87&view=markup for static library. By changing targettype to dll and uncommenting CAPABILITY it should be a shared library (haven't really tested). LIBRARY, UID and EPOCALLOWDLLDATA commands are not needed in static library build, they are just forgotten there.

    If using a dll, remember to include dll file in pkg file.

  14. #14
    Registered User
    Join Date
    Mar 2012
    Posts
    32

    Re: Symbian Belle and libCurl

    Quote Originally Posted by wizard_hu_ View Post
    It is not clear from your posts, but if you are trying to port code with Linux/GNU/POSIX/etc. roots, you should use the OpenC/C++ subsystem. The include folder epoc32\include\stdapis (and _not_ libc, which is the obsolete POSIX-like subsystem), and libc.lib, libstdcpp.lib, etc. (and _not_ estlib.lib).
    In the Belle SDK it is pretty much integrated, and unfortunately the documentation and the examples do not seem to be there. For older SDK-s it is a plugin, available from https://www.developer.nokia.com/Deve...ian_C++/Tools/, you may want to download it and try to install it separately (perhaps it is possible without installing a complete SDK for it), then you will have the documentation and the examples.
    The application mmp file was using libc for includes, and estlib.lib. I've converted the file to use stdapis for includes and the latest libraries, but the code now fails to compile because it tries to use CloseSTDLIB(), which only appears in reent.h in the libc/sys folder. I found a comment on a forum saying this function call is no longer required, do you know if that is true?

  15. #15
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,737

    Re: Symbian Belle and libCurl

    Quote Originally Posted by davidmcc View Post
    The application mmp file was using libc for includes, and estlib.lib. I've converted the file to use stdapis for includes and the latest libraries, but the code now fails to compile because it tries to use CloseSTDLIB(), which only appears in reent.h in the libc/sys folder. I found a comment on a forum saying this function call is no longer required, do you know if that is true?
    Yes, it is true. If you are using the Open C/C++ API set, this call does not exist.
    Generally estlib.lib should not be used at all, and in particular it can not be used with libc.lib because they are implementing the same API.

Similar Threads

  1. Replies: 2
    Last Post: 2012-01-12, 13:33
  2. Why called Symbian Anna, Symbian Belle?
    By patrickz in forum Symbian
    Replies: 7
    Last Post: 2011-08-25, 11:03
  3. how to set iap using libcurl?
    By hareluya_no_1 in forum Symbian Networking & Messaging (Closed)
    Replies: 2
    Last Post: 2011-05-08, 14:38
  4. Libcurl
    By fmcgeough in forum Open C/C++
    Replies: 2
    Last Post: 2009-05-12, 17:27

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
×