Results 1 to 6 of 6

Thread: Error Including Symbian C++ APIs

  1. #1
    Join Date
    Aug 2011
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Angry Error Including Symbian C++ APIs

    Hi there,

    Recently, I'm developing a Symbian App using Qt.
    There is big problem driving me crazy :

    I'm Using Qt 4.7 and I wanna Use Text-to-Speech API of S60.
    Here is the code :

    ttsplayer.h :
    Qt Code:
    1. #ifndef __TTSPLAYER_H__
    2. #define __TTSPLAYER_H__
    3.  
    4. // Include Files
    5. #include <MdaAudioSamplePlayer.h>
    6. #include <e32base.h>
    7.  
    8. class CTtsPlayer : public CBase, public MMdaAudioPlayerCallback
    9. {
    10. public:
    11. // construction
    12. static CTtsPlayer* NewLC();
    13. ~CTtsPlayer();
    14. /** Simplified call'n'forget interface.
    15.   * Synchronous function
    16.   * @leave System-wide error codes. @see MMdaAudioPlayerCallback errors
    17.   */
    18. void PlayTextL( TDesC& aText );
    19. // From the observer interface
    20. public:
    21. virtual void MapcInitComplete(TInt aError, const TTimeIntervalMicroSeconds &aDuration);
    22. virtual void MapcPlayComplete(TInt aError);
    23. private:
    24. void ConstructL();
    25. private:
    26. CMdaAudioPlayerUtility* iPlayer;
    27. TBool iPlaybackInProgress;
    28. CActiveSchedulerWait* iWaiter;
    29. // Playback error code
    30. TInt iErr;
    31. };
    32.  
    33.  
    34. #endif // __TTSPLAYER_H__
    35.  
    36. // End of file
    To copy to clipboard, switch view to plain text mode 

    ttsplayer.cpp :
    Qt Code:
    1. // Include Files
    2.  
    3. #include <e32base.h>
    4. #include <e32std.h>
    5. #include <e32def.h>
    6. #include "TtsPlayer.h"
    7.  
    8. // Prefix telling the audio utility that TTS should be used
    9. _LIT( KTtsPrefix, "(tts)" );
    10.  
    11. CTtsPlayer* CTtsPlayer::NewLC()
    12. {
    13. CTtsPlayer* self = new (ELeave) CTtsPlayer;
    14. CleanupStack::PushL( self );
    15. self->ConstructL();
    16. return self;
    17. }
    18.  
    19. CTtsPlayer::~CTtsPlayer()
    20. {
    21. delete iWaiter;
    22. delete iPlayer;
    23. }
    24.  
    25. void CTtsPlayer::ConstructL()
    26. {
    27. iPlayer = CMdaAudioPlayerUtility::NewL( *this );
    28. iWaiter = new (ELeave) CActiveSchedulerWait;
    29. }
    30.  
    31. void CTtsPlayer::PlayTextL( TDesC& aText )
    32. {
    33. __ASSERT_ALWAYS( iPlaybackInProgress == EFalse, User::Leave( KErrNotReady ) );
    34. HBufC8* playableText = HBufC8::NewLC( aText.Length() + KTtsPrefix().Length() );
    35. playableText->Des().Append( KTtsPrefix );
    36. playableText->Des().Append( aText );
    37. iPlayer->OpenDesL( *playableText );
    38. iPlaybackInProgress = ETrue;
    39. iWaiter->Start();
    40. // At this point playback is already completed or failed
    41. User::LeaveIfError( iErr );
    42. CleanupStack::PopAndDestroy( playableText );
    43. }
    44.  
    45. void CTtsPlayer::MapcInitComplete( TInt aError, const TTimeIntervalMicroSeconds& /*aDuration*/ )
    46. {
    47. iErr = aError;
    48. if( aError != KErrNone )
    49. {
    50. iPlaybackInProgress = EFalse;
    51. // Let the paused PlayTextL complete
    52. iWaiter->AsyncStop();
    53. }
    54. else
    55. {
    56. iPlayer->Play();
    57. }
    58. }
    59.  
    60. void CTtsPlayer::MapcPlayComplete( TInt aError )
    61. {
    62. iErr = aError;
    63. iPlaybackInProgress = EFalse;
    64. // Let the paused PlayTextL complete
    65. iWaiter->AsyncStop();
    66. }
    67. // End of file
    To copy to clipboard, switch view to plain text mode 

    and in the mainwindow.cpp I use this like this :
    Qt Code:
    1. CTtsPlayer* player = CTtsPlayer::NewLC();
    2. _LIT( KTextToSay, "All your voices are belong to us!" );
    3. TBuf<100> bTextToSay( KTextToSay );
    4.  
    5. TRAPD( err, player->PlayTextL( bTextToSay ) );
    6. if( err != KErrNone )
    7. {
    8. qDebug() << QString("TTS playback failed with [%1]").arg(err);
    9. }
    10. else
    11. {
    12. qDebug() << "TTS playback completed successfully" ;
    13. }
    14. CleanupStack::PopAndDestroy( player );
    To copy to clipboard, switch view to plain text mode 

    and I also added these files(ttsplayer.cpp,ttsplayer.h) to symbian in .pro file.
    But Now my problem is errors below :
    :-1: error: Recipe compile failed with exit code 1.
    :-1: error: The make-engine exited with errors.

    Please Help.
    Thanks in advance.
    Last edited by amir; 4th September 2011 at 09:28.

  2. #2
    Join Date
    May 2011
    Posts
    239
    Thanks
    4
    Thanked 35 Times in 35 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Symbian S60

    Default Re: Error Including Symbian C++ APIs

    I really have no idea. But if those are errors reported in the "Build issues" tab, you may have some detailed and important information in the "Compile Output" tab, which might actually tell you what the problem is and where it is.

  3. #3
    Join Date
    Aug 2011
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Error Including Symbian C++ APIs

    Here is the compile output :

    Sorry but My Project name is private and I used "(MyPrivateProjectName)" instead.

    Running build steps for project (MyPrivateProjectName)...
    Configuration unchanged, skipping qmake step.
    Starting: "D:\QtSDK\Symbian\SDKs\Symbian3Qt473\epoc32\tools\ make.exe" release-gcce -w
    D:\QtSDK\Symbian\SDKs\Symbian3Qt473\epoc32\tools\m ake.exe: Entering directory `D:/QtProj/(MyPrivateProjectName)'
    sbs -c arm.v5.urel.gcce4_4_1
    target : epoc32\release\armv5\urel\(MyPrivateProjectName).e xe [arm.v5.urel.gcce4_4_1]
    d:/qtsdk/symbian/tools/gcce4/bin/../lib/gcc/arm-none-symbianelf/4.4.1/../../../../arm-none-symbianelf/bin/ld.exe: warning: D:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/release/armv5/urel/usrt3_1.lib(ucppinit.o) uses variable-size enums yet the output is to use 32-bit enums; use of enum values across objects may fail
    D:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/build/(MyPrivateProjectName)/c_e6b93d046398cd60/(MyPrivateProjectName)_exe/armv5/urel/ttsplayer.o: In function `CTtsPlayer::PlayTextL(TDesC16&)':
    D:/QtProj/(MyPrivateProjectName)/ttsplayer.cpp:50: undefined reference to `CMdaAudioPlayerUtility::OpenDesL(TDesC8 const&)'
    D:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/build/(MyPrivateProjectName)/c_e6b93d046398cd60/(MyPrivateProjectName)_exe/armv5/urel/ttsplayer.o: In function `CTtsPlayer::ConstructL()':
    D:/QtProj/(MyPrivateProjectName)/ttsplayer.cpp:40: undefined reference to `CMdaAudioPlayerUtility::NewL(MMdaAudioPlayerCallb ack&, int, int)'
    collect2: ld returned 1 exit status


    sbs : warnings: 0
    sbs : errors: 2

    built 'arm.v5.urel.gcce4_4_1'

    Run time 3 seconds

    sbs: build log in D:\QtSDK\Symbian\SDKs\Symbian3Qt473\epoc32\build\M akefile.2011-09-04-12-12-08.24-7004.log

    FAILED linkandpostlink for arm.v5.urel.gcce4_4_1: epoc32\release\armv5\urel\(MyPrivateProjectName).e xe
    mmp: (MyPrivateProjectName)_exe.mmp
    mingw32-make[1]: *** [D:/QtSDK/Symbian/SDKs/Symbian3Qt473/epoc32/release/armv5/urel/(MyPrivateProjectName).exe] Error 1
    sbs: error: The make-engine exited with errors.
    D:\QtSDK\Symbian\SDKs\Symbian3Qt473\epoc32\tools\m ake.exe: Leaving directory `D:/QtProj/(MyPrivateProjectName)'
    D:\QtSDK\Symbian\SDKs\Symbian3Qt473\epoc32\tools\m ake.exe: *** [release-gcce] Error 1
    The process "D:\QtSDK\Symbian\SDKs\Symbian3Qt473\epoc32\tools\ make.exe" exited with code 2.
    Error while building project (MyPrivateProjectName) (target: Symbian Device)
    When executing build step 'Make'


    Thanks a lot for answering me.

  4. #4
    Join Date
    Aug 2011
    Posts
    5
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Unix/X11 Windows Symbian S60

    Default Re: Error Including Symbian C++ APIs

    Can anyone tell me what should I do?

    Thanks.

  5. #5
    Join Date
    Sep 2011
    Posts
    3
    Qt products
    Qt4 Qt/Embedded
    Platforms
    Symbian S60 Maemo/MeeGo

    Default Re: Error Including Symbian C++ APIs

    You need to link against the library which provides the missing symbols - add the following to your .pro file:
    Qt Code:
    1. LIBS += -lmediaclientaudio
    To copy to clipboard, switch view to plain text mode 
    The CMdaAudioPlayerUtility page in the developer library tells you which library to link against.

  6. #6
    Join Date
    Oct 2011
    Posts
    1
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    Symbian S60 Maemo/MeeGo

    Default Re: Error Including Symbian C++ APIs

    Hi,

    I am developing an TTS app on Qt-SDK 1.1.3, I am using the TTS utility developed by Artem Marchenko for this.
    The sources are same as which Amir has pasted here.

    Now, I am facing a linking problem. I followed the suggestions above but still it didn't help.

    I have added the mediaclientaudio library in the .pri file, but still getting the linking errors:

    Qt Code:
    1. /QtSDK/Symbian/SDKs/Symbian1Qt473/EPOC32/BUILD/QtProjects/myappilcationname_EXE/GCCE/UREL/TtsPlayer.o: In function `CTtsPlayer::ConstructL()':
    2. ttsplayer.cpp:(.text+0xf6): undefined reference to `CMdaAudioPlayerUtility::NewL(MMdaAudioPlayerCallback&, int, TMdaPriorityPreference)'
    3. /QtSDK/Symbian/SDKs/Symbian1Qt473/EPOC32/BUILD/QtProjects/myappilcationname_EXE/GCCE/UREL/TtsPlayer.o: In function `CTtsPlayer::PlayTextL(TDesC16&)':
    4. ttsplayer.cpp:(.text+0x160): undefined reference to `CMdaAudioPlayerUtility::OpenDesL(TDesC8 const&)'
    5. make[2]: *** [\QtSDK\Symbian\SDKs\Symbian1Qt473\epoc32\release\gcce\urel\myappilcationname.exe] Error 1
    6. make[1]: *** [TARGETFLASHCARDS_EXE] Error 2
    To copy to clipboard, switch view to plain text mode 


    In my application.pri file, i have added
    Qt Code:
    1. LIBS += -lcone -leikcore -lavkon -lmediaclientaudio
    To copy to clipboard, switch view to plain text mode 

    Can anyone suggest me how to resolve this issue? I am stuck at this point.

    Thanks,
    Sudhir


    Added after 30 minutes:


    Another update, If I select the build variant as Symbian3, then i am getting an strange error as below:
    Qt Code:
    1. Recipe compile failed with exit code 1.
    2. The make-engine exited with errors.
    To copy to clipboard, switch view to plain text mode 
    This is the same which Amir got...

    Can anyone help me to get out this issue please?


    Added after 51 minutes:


    Hi,

    I opened the MdaAudioSamplePlayer.h from the Qt-Creator to found that there are some errors in that file.

    I am attaching the screenshot here, you can see that there is an
    Unexpected token *
    popup note when i focus on the error lines.

    Qt-Mda-Link-Error.jpg

    Please help,

    Thanks
    Last edited by sudhir_ttl; 8th December 2011 at 11:54.

Similar Threads

  1. Error including <libnotify/notify.h>
    By Marwa Shams in forum Qt Programming
    Replies: 5
    Last Post: 7th August 2011, 13:24
  2. : error: [\NokiaQtSDK\Symbian\SDK\epoc32\release\gcce\udeb\V ideo.exe] Error 1
    By ranjit.kadam in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 1st May 2011, 23:11
  3. Problem while using the S60 extension APIs and the Qt Mobility APIs
    By sudhir.linux in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 3rd January 2011, 13:48
  4. Replies: 0
    Last Post: 8th December 2010, 13:44
  5. Replies: 2
    Last Post: 24th July 2010, 10:41

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.