Note that there are some explanatory texts on larger screens.

plurals
  1. PONew to C/C++ Using Android NDK to port Legacy code, getting compile errors
    text
    copied!<p>I have been trying to take some old Symbian C++ code over to Android today using the NDK.</p> <p>I have little to no C or C++ knowledge so its been a chore, however has to be done.</p> <p>My main issue is that I'm having trouble porting what I believe is Symbian specifi code to work using the small C/C++ subset that is available with the Android NDK.</p> <p>Here is a picture of the compilation errors I'm getting using cygwin</p> <p>I was wondering if anyone could point me in the right direction on how to deal with these errors? For instance is TBool/Int/TUint/RPointerArray/RSocket a Symbian primitive and thats why it wont compile or is it something else?</p> <p>Also what is ISO C++?</p> <p>Any tutorials, guides or tips and help would be greatly appreciated.</p> <p>EDIT:</p> <p>Here is a code snippet from the .h file I am trying to import followed by the output for the snippet from the compiler.</p> <p>Could someone guide me on how I would port this Symbian specific code to normal C++? </p> <p>If I got an idea of whats Symbian specific and how to change it I believe I could change then begin to port the rest myself</p> <hr> <pre><code>#ifndef __RTPSTREAM_H__ #define __RTPSTREAM_H__ class CRTPParser; class MDataRecorderObserver { public: virtual void DataRecorded(const TDesC8&amp; aData, TUint aCodec, TUint aFramesizeMs)=0; }; class MRTPStreamDataObserver { public: virtual void AudioDataSent()=0; virtual void DataReceived(const TDesC8&amp; aData,TUint aCodec, TBool aMarker, TUint aSeq, TUint aTime)=0; virtual void DataReceived(const TDesC8&amp; aData)=0; }; </code></pre> <hr> <pre><code>$ make APP=ndk-socket Android NDK: Building for application 'ndk-socket' Compile++ thumb: socket &lt;= apps/ndk-socket/project/jni/rtpstream.cpp In file included from apps/ndk-socket/project/jni/com_ciceronetworks_utils_RTPJn i.h:2, from apps/ndk-socket/project/jni/rtpstream.cpp:4: build/platforms/android-3/arch-arm/usr/include/jni.h:489: note: the mangling of 'va_list' has changed in GCC 4.4 In file included from apps/ndk-socket/project/jni/rtpstream.cpp:11: apps/ndk-socket/project/jni/rtp/RTPStream.h:15: error: ISO C++ forbids declarati on of 'TDesC8' with no type apps/ndk-socket/project/jni/rtp/RTPStream.h:15: error: expected ',' or '...' bef ore '&amp;' token apps/ndk-socket/project/jni/rtp/RTPStream.h:23: error: ISO C++ forbids declarati on of 'TDesC8' with no type apps/ndk-socket/project/jni/rtp/RTPStream.h:23: error: expected ',' or '...' bef ore '&amp;' token apps/ndk-socket/project/jni/rtp/RTPStream.h:24: error: ISO C++ forbids declarati on of 'TDesC8' with no type apps/ndk-socket/project/jni/rtp/RTPStream.h:24: error: expected ',' or '...' bef ore '&amp;' token apps/ndk-socket/project/jni/rtp/RTPStream.h:24: error: 'virtual void MRTPStreamD ataObserver::DataReceived(int)' cannot be overloaded apps/ndk-socket/project/jni/rtp/RTPStream.h:23: error: with 'virtual void MRTPSt reamDataObserver::DataReceived(int)' apps/ndk-socket/project/jni/rtp/RTPStream.h:30: error: 'TInt' has not been deca red </code></pre>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload