×

Discussion Board

Results 1 to 11 of 11
  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    35

    WINSCW compile time option

    hai,
    I'm porting my proj (developed in 'C') to Symbian.

    I've huge no of compile errors while compiling for Emulator

    For eg.,
    char *ptr = malloc(10);

    Error: Can't convert 'void *' to 'char *'

    In 'C' its a just warning. But in C++ its giving error.

    For GCCE compiler, by adding the following option '-fpermissive', the error got downgraded to warning.

    File: GCCE.mk

    C_LANG_OPTION: -x c++ -fpermissive

    But I'm unable to find similar type of flags for WINSCW compiler.

    I've added the follwing line in MMP file, but still no use.

    OPTION CW -w implicit -lang c++ -fpermissive

    Environment: S60_3rd_MR, WINSCW, Carbide 2.0

    How can I supress this type of typecast errors.

    Any help greately appreciated.

    regards
    -Siva

  2. #2
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: WINSCW compile time option

    try using OpenC/C++

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    35

    Re: WINSCW compile time option

    Can u give detailed solution b'coz i am not getting u.

  4. #4
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: WINSCW compile time option

    Quote Originally Posted by sivareddy_jntu View Post
    Can u give detailed solution b'coz i am not getting u.
    as you are poring a C project to Symbian.c++, it is suggest that you use OpenC/C++ PlugIn.found in http://www.forum.nokia.com/Resources...0_3rd_Edition/

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    35

    Re: WINSCW compile time option

    I have downloaded specified archieve file and try extract data2.cab it is giving error as "The archieve is either unknown formatt or damaged".

  6. #6
    Super Contributor
    Join Date
    Mar 2004
    Location
    Singapore
    Posts
    9,968

    Re: WINSCW compile time option

    Quote Originally Posted by sivareddy_jntu View Post
    I have downloaded specified archieve file and try extract data2.cab it is giving error as "The archieve is either unknown formatt or damaged".
    looks like your download file has problem. you might want to try again or on another machine

  7. #7
    Registered User
    Join Date
    Aug 2003
    Location
    Oulu, Finland
    Posts
    1,122

    Re: WINSCW compile time option

    Quote Originally Posted by sivareddy_jntu View Post
    hai,
    In 'C' its a just warning. But in C++ its giving error.
    Why not fix the warning/error by casting the void* to whatever variable type you are assigning it to, in this case char*?

    Also if you're porting C, then you should compile your sources as C. There are at least two ways to achieve this:

    1. Rename the source files to have a .c suffix.

    2. Add the following to your MMP file:
    Code:
    OPTION CW -lang c
    OPTION GCCE -x c
    Note that these options affect all files in the MMP file. Therefore option 1 is preferable

    Lauri

  8. #8
    Registered User
    Join Date
    May 2009
    Posts
    35

    Re: WINSCW compile time option

    I have many files nearly 2000 . Among 2000 files 500 files showing errors.These errors are being showed in WINSCW only but not in GCCE.Thus i want to know is there any setting to disable all these errors.And i have some c header files and others are CPP header files .So while doing as u said carbide giving error like "Declaration syntax error Epoc32\include\e32cmn.h".

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Budapest, Hungary
    Posts
    28,572

    Re: WINSCW compile time option

    You should keep standard C and Symbian C++ code in separate files. Especially since C code can not really do anything with C++ inserts, normally it happens in the other direction: C++ (including Symbian C++) code calls into C, using extern "C".

  10. #10
    Registered User
    Join Date
    May 2009
    Posts
    35

    Re: WINSCW compile time option

    I have kept cpp and c standards in separate files but my project has both c and cpp files.While compiling with GCCE compiler i am not getting any error but warnings.If i compile with winscw am getting errors which are warnings in GCCE.How do i get suppressed by WINSCW these errors???.And main problem is why GCCE is giving warnings,WINSCW is giving errors.And where to do changes and how to do inorder to get same behaviour on both compilers.


    Any help woulb be appreciated greatly.
    Regards
    Siav.
    Last edited by sivareddy_jntu; 2009-05-14 at 06:24.

  11. #11
    Registered User
    Join Date
    May 2009
    Posts
    35

    Re: WINSCW compile time option

    Hi,

    Thanks all for your prompt responses.

    As you sugested, I have kept standard C and Symbian C++ code in sepeare files.

    My project has Framework where all O.S related stuff will be implemented.
    Rest of the project (C code) will use that FWK by including respective FWK header file, which inturn contains Symbian header files. Thus my 'C' code will have 'C++' tokens.

    If I compile my 'C' file as 'C' file , it results in compilation error for 'C++' part.

    Eg., fwk_socket.c - contains Symbian RSocket related code
    fwk_socket.h - Contains generic prototypes of sockets like
    fwk_udp_socket_create etc.
    it includes'ES_SOCK.H'

    myapp.c:
    #include "fwk_socket.h"
    .....
    .....
    .....
    ret_l = fwk_udp_socket_create(.......);
    .....
    .....
    .....

    If you think this approach is not right one, please suggest the alternative.


    [B]Secondly, with GCCE, I did compile 'C' files as 'C++' file, and by adding '-fpermissive' option to C_LANG_OPTION in GCCE.mk , I suppressed typecast errors to warnings.[/B]

    Is there any similar way to do it on WINSCW (Emulator)
    or in otherwords, how can I set compiler options for WINSCW....

    Setting the following line in MMP
    OPTION CW -lang C++ -f permissive is not helping....

    Thanks for your time....







    Quote Originally Posted by sivareddy_jntu View Post
    I have kept cpp and c standards in separate files but my project has both c and cpp files.While compiling with GCCE compiler i am not getting any error but warnings.If i compile with winscw am getting errors which are warnings in GCCE.How do i get suppressed by WINSCW these errors???.And main problem is why GCCE is giving warnings,WINSCW is giving errors.And where to do changes and how to do inorder to get same behaviour on both compilers.


    Any help woulb be appreciated greatly.
    Regards
    Siav.

Similar Threads

  1. Date / time from Internal GPS on E90 wrong?
    By MainMeat in forum Symbian
    Replies: 5
    Last Post: 2009-01-19, 10:02
  2. Build problem on ARMV5 and GCCE with Carbide c++ 2.0 (S60 3rd Edition FP1)
    By pinkhardlionel in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 10
    Last Post: 2009-01-14, 09:02
  3. Replies: 0
    Last Post: 2008-01-03, 17:58
  4. Why 3rd project can't compile for emulator debug always
    By inter_fan in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2007-04-03, 09:00
  5. Bizarre calendar/time zone change handling in Nokia 9500
    By noetus in forum General Development Questions
    Replies: 0
    Last Post: 2005-09-19, 19: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
  •