×

Discussion Board

Results 1 to 6 of 6
  1. #1
    Regular Contributor
    Join Date
    Feb 2010
    Posts
    68

    Question Unable to debug my console application to read exif

    Dear experts,

    Im not able to rub my application it gives me errors to read exif from picture/img

    Code:
    class CFbsBitmap;
    class CExifRead;
    class CImageDecoder;
    /**
     *  CExif_reader
     * 
     */
    class CExif_reader : public CBase
    	{
    public:
    	// Constructors and destructor
    
    	/**
    	 * Destructor.
    	 */
    	~CExif_reader();
    	
    	/**
    	 * Two-phased constructor.
    	 */
    	static CExif_reader* NewL();
    
    	/**
    	 * Two-phased constructor.
    	 */
    	static CExif_reader* NewLC();
    	 void read_exf(TDesC16 & filename);
    	
    	
    private:
    	
    	
    	/**
    	 * Constructor for performing 1st stage construction
    	 */
    	
    	CExif_reader();
    	/**
    	 * EPOC default constructor for performing 2nd stage construction
    	 */
    	void ConstructL();
    	
    private:
    	TFileName iFile;
    	RFs rFile;
    	HBufC8 * iImageMake;  // to get the make of the image
    	HBufC8 * iImageModel; // to get the model of the image
    	HBufC8 * iImageDate; //to get the date of the image
    	CExifRead* read;
    	CFbsBitmap * bitmap;
    	const HBufC16* path;
    	CImageDecoder* readFile;
    
    	};
    
    #endif // EXIF_READER_H
    .cpp
    Code:
    /*
     ============================================================================
     Name		: Exif_reader.cpp
     Author	  : Mohamed Khalel
     Version	 : 1.0
     Copyright   : This application has been developed by Mohamed Khalel
    
     Description : CExif_reader implementation
     ============================================================================
     */
    
    #include "Exif_reader.h"
    #include <exifread.h>
    #include <exifmodify.h>
    #include <f32file.h>
    #include <eikenv.h>
    #include <fbs.h>
    #include <ImageConversion.h>
    
    CExif_reader::CExif_reader()
    	{
    	// No implementation required
    	}
    
    CExif_reader::~CExif_reader()
    	{
    	}
    
    CExif_reader* CExif_reader::NewLC()
    	{
    	CExif_reader* self = new (ELeave) CExif_reader();
    	CleanupStack::PushL(self);
    	self->ConstructL();
    	return self;
    	}
    
    CExif_reader* CExif_reader::NewL()
    	{
    	CExif_reader* self = CExif_reader::NewLC();
    	CleanupStack::Pop(); // self;
    	return self;
    	}
    
    void CExif_reader::ConstructL()
    	{
    
    	}
    
    void CExif_reader::read_exf(TDesC16 &filename)
    	{
    	RFile file;
    		
    		
    	
    		User::LeaveIfError(file.Open(CEikonEnv::Static()->FsSession(),filename,EFileRead));
    		CleanupClosePushL(file);
    		TInt size = 0;
    		file.Size(size);
    		HBufC8* exif_info = HBufC8::NewL(size);
    		CleanupStack::PushL(exif_info);
    		TPtr8 buffer = exif_info->Des();
    		User::LeaveIfError(file.Read(buffer));
    		CleanupStack::Pop(exif_info);
    		CleanupStack::PopAndDestroy();
    		CleanupStack::PushL(exif_info);
    
    		CExifRead * exif_reader = CExifRead::NewL(exif_info->Des());
    		CleanupStack::PushL(exif_reader);
    
    		TInt err = KErrNone ;
    		TRAP (err,iImageMake =  exif_reader->GetMakeL())
    		TRAP (err,iImageModel = exif_reader->GetModelL());
    		TRAP (err,iImageDate = exif_reader->GetDateTimeOriginalL());
    
    		CleanupStack::PopAndDestroy(exif_reader);
    		CleanupStack::PopAndDestroy(exif_info);
    
    	
    	
    	
    	
    	}
    Console
    Code:
    /*
     ============================================================================
     Name		: Exif_consol.cpp
     Author	  : Mohamed Khalel
     Copyright   : This application has been developed by Mohamed Khalel
    
     Description : Exe source file
     ============================================================================
     */
    
    //  Include Files  
    
    #include "Exif_consol.h"
    #include <e32base.h>
    #include <e32std.h>
    #include <e32cons.h>			// Console
    #include "Exif_reader.h"
    
    
    //  Constants
    
    _LIT(KTextConsoleTitle, "Console");
    _LIT(KTextFailed, " failed, leave code = %d");
    _LIT(KTextPressAnyKey, " [press any key]\n");
    
    //  Global Variables
    
    
    
    LOCAL_D CConsoleBase* console; // write all messages to this
    
    
    
    //  Local Functions
    
    LOCAL_C void MainL()
    	{
    	//
    	// add your program code here, example code below
    	//
    	console->Write(_L("Hello, world!\n"));
    	_LIT( path1,"C://img.jpg");
    
    	TDesC16 path_file = path1.operator const TDesC16 &();
    	
    	
    	
    	CExif_reader * read = CExif_reader::NewL();
    	read->read_exf(path_file);
    	}
    
    LOCAL_C void DoStartL()
    	{
    	// Create active scheduler (to run active objects)
    	CActiveScheduler* scheduler = new (ELeave) CActiveScheduler();
    	CleanupStack::PushL(scheduler);
    	CActiveScheduler::Install(scheduler);
    
    	MainL();
    
    	// Delete active scheduler
    	CleanupStack::PopAndDestroy(scheduler);
    	}
    
    //  Global Functions
    
    GLDEF_C TInt E32Main()
    	{
    	// Create cleanup stack
    	__UHEAP_MARK;
    	CTrapCleanup* cleanup = CTrapCleanup::New();
    
    	// Create output console
    	TRAPD(createError, console = Console::NewL(KTextConsoleTitle, TSize(
    			KConsFullScreen, KConsFullScreen)));
    	if (createError)
    		{
    		delete cleanup;
    		return createError;
    		}
    
    	// Run application code inside TRAP harness, wait keypress when terminated
    	TRAPD(mainError, DoStartL());
    	if (mainError)
    		console->Printf(KTextFailed, mainError);
    	console->Printf(KTextPressAnyKey);
    	console->Getch();
    
    	delete console;
    	delete cleanup;
    	__UHEAP_MARKEND;
    	return KErrNone;
    	}

  2. #2
    Nokia Developer Moderator
    Join Date
    Sep 2004
    Location
    Tampere, Finland
    Posts
    11,355

    Re: Unable to debug my console application to read exif

    What errors? Where?
    -- Lucian

    If you are not yet a DVLUP member it is time to correct that mistake :) Click here to join: http://www.dvlup.com/lucian/Invite

  3. #3
    Regular Contributor
    Join Date
    Feb 2010
    Posts
    68

    Re: Unable to debug my console application to read exif

    Quote Originally Posted by ltomuta View Post
    What errors? Where?
    Creation Time Description Resource Path Location Type
    1305464668497 Undefined symbol: 'int RFile::Open(class RFs &, class TDesC16 const &, unsigned int) (?Open@RFile@@QAEHAAVRFs@@ABVTDesC16@@I@Z)' Exif_consol Unknown C/C++ Problem
    1305464668499 Undefined symbol: 'int RFile::Read(class TDes8 &) const (?Read@RFile@@QBEHAAVTDes8@@@Z)' Exif_consol Unknown C/C++ Problem
    1305464668500 Undefined symbol: 'class CExifRead * CExifRead::NewL(class TDesC8 const &) (?NewL@CExifRead@@SAPAV1@ABVTDesC8@@@Z)' Exif_consol Unknown C/C++ Problem
    1305464668501 Undefined symbol: 'class CCoeEnv * CCoeEnv::Static(void) (?Static@CCoeEnv@@SAPAV1@XZ)' Exif_consol Unknown C/C++ Problem
    1305464668502 Undefined symbol: 'void RFile::Close(void) (?Close@RFile@@QAEXXZ)' Exif_consol Unknown C/C++ Problem
    1305464668498 Undefined symbol: 'int RFile::Size(int &) const (?Size@RFile@@QBEHAAH@Z)' Exif_consol Unknown C/C++ Problem
    Last edited by wizard_hu_; 2011-05-15 at 22:20.

  4. #4
    Super Contributor
    Join Date
    Jul 2008
    Posts
    2,020

    Re: Unable to debug my console application to read exif

    Undefined Symbol...

    Do you have all headers in place?
    The lines above are the best I have to offer.If anyone of you is of more advanced knowledge, I ask for your patience and understanding! - unknown arab poet
    http://www.tamoggemon.com - Symbian blog - Windows Phone blog
    My other blogs:
    webOS blog iPhone blog BlackBerry blog Samsung bada blog Android blog

  5. #5
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,567

    Re: Unable to debug my console application to read exif

    Unable to debug... Yeah, it is hard to debug if your application does not even build.
    Check the .lib files required for the classes appearing in the error messages (I have highlighted them for you), you can use the on-line documentation too (http://library.forum.nokia.com), and add them to the .mmp file.
    Note that console code has no CCoeEnv, it may or may not be a problem, depending on what you are doing exactly. For example CCoeEnv::Static()->FsSession() is giving you an RFs, which you can create and Connect yourself
    Code:
    RFs fs;
    User::LeaveIfError(fs.Connect());

  6. #6
    Regular Contributor
    Join Date
    Feb 2010
    Posts
    68

    Re: Unable to debug my console application to read exif

    Quote Originally Posted by wizard_hu_ View Post
    Unable to debug... Yeah, it is hard to debug if your application does not even build.
    Check the .lib files required for the classes appearing in the error messages (I have highlighted them for you), you can use the on-line documentation too (http://library.forum.nokia.com), and add them to the .mmp file.
    Note that console code has no CCoeEnv, it may or may not be a problem, depending on what you are doing exactly. For example CCoeEnv::Static()->FsSession() is giving you an RFs, which you can create and Connect yourself
    Code:
    RFs fs;
    User::LeaveIfError(fs.Connect());
    Thanks alot it helps

Similar Threads

  1. Strange Error in my application to Modify the Exif
    By dr.nokia in forum Symbian C++
    Replies: 9
    Last Post: 2011-04-13, 15:25
  2. Replies: 0
    Last Post: 2010-08-26, 05:24
  3. [moved] How to debug Console Exe from GUI application in TRK?
    By SymbianTH in forum Carbide.c++ IDE and plug-ins (Closed)
    Replies: 2
    Last Post: 2009-10-22, 07:02
  4. How to debug console application with CW3.1 and 3rd edition ?
    By 3rdparty in forum Symbian Tools & SDKs
    Replies: 2
    Last Post: 2006-06-16, 13:54
  5. How to debug console application with CW3.1 and 3rd edition ?
    By 3rdparty in forum Mobile Java Tools & SDKs
    Replies: 0
    Last Post: 2006-02-01, 17:40

Posting Permissions

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