Discussion Board

Results 1 to 7 of 7
  1. #1
    Registered User lykurg's Avatar
    Join Date
    May 2009
    Posts
    3
    Hi,

    this is a very dump question I know, but I struggle. I use PlayUtility.cpp and PlayUtility.h from the wiki page "Playing audio files" in my Qt-garden project. In the main function I call for testing purpose: CPlayerUtility *p = CPlayerUtility::NewL(_L("E:\\play.wav")); While compilation I get the error:

    mwldsym2.exe: warning: Multiply defined symbol: __InitializeThreadDataIndex in
    mwldsym2.exe: warning: files uc_cwhelp.obj (EEXE.LIB), ThreadLocalData.c.obj (msl_all_static_mse_symbian_d.lib),
    mwldsym2.exe: warning: keeping definition in ThreadLocalData.c.obj
    mwldsym2.exe: warning: Multiply defined symbol: ___get_MSL_init_count in
    mwldsym2.exe: warning: files uc_cwhelp.obj (EEXE.LIB), startup.win32.c.obj (msl_all_static_mse_symbian_d.lib),
    mwldsym2.exe: warning: keeping definition in startup.win32.c.obj
    mwldsym2.exe: warning: Multiply defined symbol: __CleanUpMSL in
    mwldsym2.exe: warning: files uc_cwhelp.obj (EEXE.LIB), startup.win32.c.obj (msl_all_static_mse_symbian_d.lib),
    mwldsym2.exe: warning: keeping definition in startup.win32.c.obj
    mwldsym2.exe: Undefined symbol: 'class CMdaAudioPlayerUtility * CMdaAudioPlayerUtility::NewFilePlayerL(class TDesC16 const &, class MMdaAudioPlayerCallback &, int, enum TMdaPriorityPreference, class CMdaServer *) (?NewFilePlayerL@CMdaAudioPlayerUtility@@SAPAV1@ABVTDesC16@@AAVMMdaAudioPlayerCallback@@HW4TMdaPriorityPreference@@PAVCMdaServer@@@Z)'
    mwldsym2.exe: referenced from 'void CPlayerUtility::ConstructL(class TDesC16 const &) (?ConstructL@CPlayerUtility@@AAEXABVTDesC16@@@Z)' in PlayUtility.cpp:38
    What I am missing? Which library is to additionaly to link?


    Thanks for any hint...


    Lykurg

    For completeness:
    Code:
    #include <e32std.h>
    #include <MdaAudioSamplePlayer.h>
    
    class CPlayerUtility : public CBase, public MMdaAudioPlayerCallback
    	{
    public:
    	static CPlayerUtility* NewL(const TDesC& aFileName);
    	static CPlayerUtility* NewLC(const TDesC& aFileName);
    	~CPlayerUtility();
    private:
    	CPlayerUtility();
    	void ConstructL(const TDesC& aFileName);
    public:
    	void Play();
    	void Stop();
    public:
    	// from MMdaAudioToneObserver
    	void MapcInitComplete(TInt aError,
    			const TTimeIntervalMicroSeconds& aDuration);
    	void MapcPlayComplete(TInt aError);
    private:
    	CMdaAudioPlayerUtility* iPlayUtility;
    	TBool iPlaying, iPrepared;
    	};
    Code:
    #include "PlayUtility.h"
    
    #include <MdaAudioTonePlayer.h>
    #include <eikmenup.h>
    
    CPlayerUtility* CPlayerUtility::NewL(const TDesC& aFileName)
    	{
    	CPlayerUtility* self = NewLC(aFileName);
    	CleanupStack::Pop(self);
    	return self;
    	}
    
    CPlayerUtility* CPlayerUtility::NewLC(const TDesC& aFileName)
    	{
    	CPlayerUtility* self = new (ELeave) CPlayerUtility();
    	CleanupStack::PushL(self);
    	self->ConstructL(aFileName);
    	return self;
    	}
    
    CPlayerUtility::~CPlayerUtility()
    	{
    	if (iPlayUtility)
    		{
    		iPlayUtility->Stop();
    //		iPlayUtility->Close(); // Comment out also because of compiler errors.
    		}
    
    	delete iPlayUtility;
    	}
    
    CPlayerUtility::CPlayerUtility()
    	{
    	}
    
    void CPlayerUtility::ConstructL(const TDesC& aFileName)
    	{
    	iPlayUtility = CMdaAudioPlayerUtility::NewFilePlayerL(aFileName, *this);
    	iPlaying = iPrepared = EFalse;
    	}
    
    void CPlayerUtility::Play()
    	{
    	iPlayUtility->Play();
    	iPlaying = ETrue;
    	}
    
    void CPlayerUtility::Stop()
    	{
    	iPlayUtility->Stop();
    	iPlaying = EFalse;
    	}
    
    void CPlayerUtility::MapcPlayComplete(TInt /*aError*/)
    	{
    	iPlaying = EFalse;
    	}
    
    void CPlayerUtility::MapcInitComplete(TInt aError,
    		const TTimeIntervalMicroSeconds& /*aDuration*/)
    	{
    	if (aError == KErrNone)
    		{
    		iPrepared = ETrue;
    		iPlayUtility->SetVolume(iPlayUtility->MaxVolume());
    		}
    	}

  2. #2
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    That is a linker error, and it is about a missing library. Check the one for CMdaAudioPlayerUtility in the SDK Help, and add it to the .mmp file.

  3. #3
    Registered User lykurg's Avatar
    Join Date
    May 2009
    Posts
    3
    Quote Originally Posted by wizard_hu_ View Post
    Check the one for CMdaAudioPlayerUtility in the SDK Help
    Thanks, that's the point, but there is no library called CMdaAudioPlayerUtility? I have installed the S60_5th_Edition_SDK_v1_0_en. Is that possible?

  4. #4
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    Quote Originally Posted by lykurg View Post
    Thanks, that's the point, but there is no library called CMdaAudioPlayerUtility?
    That is why I have suggested checking it in the SDK Help. The library has some other name, but you will find it
    I have installed the S60_5th_Edition_SDK_v1_0_en. Is that possible?
    Sure, it is one of the oldest API-s, and it is still present in the N97 SDK, so I would definitely expect it to be present in the S60 5th edition one too.
    Quote Originally Posted by SDK Help
    » Symbian OS v9.4 » Symbian OS reference » C++ component reference » Multimedia Multimedia_Framework » CMdaAudioPlayerUtility


    --------------------------------------------------------------------------------

    #include <MdaAudioSamplePlayer.h>
    Link against: ***

    Class CMdaAudioPlayerUtility

    class CMdaAudioPlayerUtility : public CBase, public MMMFClientUtility;

    Description
    Plays sampled audio data.

    The class offers a simple interface to open, play and obtain information from, sampled audio data. The audio data can be supplied either in a file (file-based), as a descriptor (descriptor-based) or as a URL reference (since version 7.0s).
    You already know the .h file (because of the example), but it is good to know, that the headers appear in the help. And the *** section will contain the required .lib file if you check it.

  5. #5
    Registered User lykurg's Avatar
    Join Date
    May 2009
    Posts
    3
    Quote Originally Posted by wizard_hu_ View Post
    That is why I have suggested checking it in the SDK Help.
    I done it, but even now I having trouble reading and searching my local doc...

    Switching to the online docs solved anything. Thanks for holding my Hand while reading the docs!

  6. #6
    Registered User arylson's Avatar
    Join Date
    Jan 2010
    Posts
    2
    Fixed? I'm having the same problem.

  7. #7
    Nokia Developer Moderator wizard_hu_'s Avatar
    Join Date
    Feb 2006
    Location
    Mallorca, Holiday
    Posts
    27,683
    Quote Originally Posted by arylson View Post
    Fixed?
    Based on #5, yes.
    I'm having the same problem.
    Apply the same solution then: check the documentation.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved