×

Discussion Board

Results 1 to 14 of 14
  1. #1
    Registered User
    Join Date
    Jul 2007
    Posts
    32

    Can't compile SDLexe.dll

    I'm try to builg SDL 2.4.4 from Marcus Mertrama. SDL.dll and sdlmain.lib are builded fine for WINSCW and GCCE.
    When builded SDLexe.dll I get error :
    for WINSCW :

    Code:
    mwldsym2.exe: Undefined symbol: 'void DrawBitmapFilter::Draw(unsigned short *, unsigned long const *, class TSize const &, class TSize const &, int, int) (?Draw@DrawBitmapFilter@@YAXPAGPBKABVTSize@@2HH@Z)'
    mwldsym2.exe: referenced from 'int CZoomer::BitBlt(class CBitmapContext &, class CFbsBitmap &, class TRect const &, class TSize const &) (?BitBlt@CZoomer@@UAEHAAVCBitmapContext@@AAVCFbsBitmap@@ABVTRect@@ABVTSize@@@Z)' in zoomer.cpp:62
    for GCCE :

    Code:
    /Symbian/S60_5th_Edition_SDK_v1.0/EPOC32/BUILD/Symbian/Projects/SDL/SDL-1.2.14/Symbian/S60v5/group/SDLEXE/GCCE/UREL/zoomer.o: In function `CZoomer::BitBlt(CBitmapContext&, CFbsBitmap&, TRect const&, TSize const&)':
    zoomer.cpp:(.text+0x1e2): undefined reference to `DrawBitmapFilter::Draw(unsigned short*, unsigned long const*, TSize const&, TSize const&, int, int)'
    make[1]: *** [\Symbian\S60_5th_Edition_SDK_v1.0\epoc32\release\gcce\urel\sdlexe.dll] Error 1
    I'm using S60_5th_Edition_SDK_v1.0 with GCCE 4.4.1 with abld build system

  2. #2
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Can't compile SDLexe.dll

    undefined reference generally means that you are missing the implementation for something. Thus do check which library includes the DrawBitmapFilter:raw and include it in your project.

  3. #3
    Registered User
    Join Date
    Jul 2007
    Posts
    32

    Re: Can't compile SDLexe.dll

    I have "#include "drawbitmapfilter.h" " already Compilation zoomer.cpp from Carbide context menu was fine... drawbitmapfilter.cpp also included in project
    Last edited by SuperZANAC; 2013-07-19 at 11:27.

  4. #4
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Can't compile SDLexe.dll

    can you check that the implementation for the fucntion is really as expected: 'void DrawBitmapFilter:raw(unsigned short *, unsigned long const *, class TSize const &, class TSize const &, int, int) and you have not defined it as virtual in your header file.

  5. #5
    Registered User
    Join Date
    Jul 2007
    Posts
    32

    Re: Can't compile SDLexe.dll

    from header :

    Code:
    namespace DrawBitmapFilter
    	{
    	void Draw(TUint16* aTarget, const TUint32* aSrc,
     						const TSize& aTargetSize, const TSize& aSrcSize,
    						TInt aTargetStride, TInt aSrcStride);
    	void Draw(TUint32* aTarget, const TUint32* aSrc,
     						const TSize& aTargetSize, const TSize& aSrcSize,
      					TInt aTargetStride, TInt aSrcStride);
    	}
    implementation :

    Code:
    void Draw(TUint16* aTarget, const TUint32* aSrc,
     	const TSize& aTargetSize, const TSize& aSrcSize,
      	TInt aTargetStride, TInt aSrcStride)
    	{
    	TInt i;
    
    	TInt sourcePos = 0; 
    
    
    	ASSERT(aTargetSize.iHeight > 0);
    	ASSERT(aTargetSize.iWidth > 0);
    	
    	ASSERT(aSrcSize.iHeight > 1);
    	ASSERT(aSrcSize.iWidth > 1);
    
    	
      	const TUint32* source = aSrc;
      	const TInt sourcePitch = aSrcStride >> 2;
      	
      	  	
      	TUint16* target = aTarget;
      	const TInt targetPitch = aTargetStride >> 1;
      	
      	const TInt sh = ((aSrcSize.iHeight - 1) << 16) / aTargetSize.iHeight; 
      	const TInt sw = ((aSrcSize.iWidth - 1) << 16) /aTargetSize.iWidth; 
    
    	const TInt sourceDelta = sh;
    
    	for(i = 0; i < aTargetSize.iHeight ; i++)  	
    		{				
    		TInt steps = 0;
    		
    		sourcePos += sourceDelta;
    		
    		while(sourcePos >> 16 > 0) //this does source sampling
    			{	
    			++steps;				   	
    			source += sourcePitch;
    			sourcePos -= 1 << 16;  //jump remainder
    			}	
    		
    		DrawScanLineFilter(target, source, aTargetSize.iWidth, sw, sourcePitch, steps);	
    	
    		target += targetPitch;		
    
    		}
    		
    	}
    DrawScanLineFilter also implemented

    Here is SDL in sourceforge

  6. #6
    Nokia Developer Moderator
    Join Date
    Mar 2003
    Location
    Lempäälä/Finland
    Posts
    29,167

    Re: Can't compile SDLexe.dll

    looks ok, anyway then, is that source file really incldued in the project ?

    Gotta also admit that I hadly ever use namespaces that way, with object oriented stuff its generally worked better to have a class defiend for all functions, and then using the class either by deriving or by instantiating it as private member variable, depending what is needed.

    anyway, can you try whether changing void Draw to void DrawBitmapFilter:raw would make any difference.

  7. #7
    Registered User
    Join Date
    Jul 2007
    Posts
    32

    Re: Can't compile SDLexe.dll

    I already have "using namespace:rawBitmapFilter "
    Last edited by SuperZANAC; 2013-07-19 at 17:14.

  8. #8
    Registered User
    Join Date
    Jul 2007
    Posts
    32

    Re: Can't compile SDLexe.dll

    Thanks, symbianyucca I changed void Draw to void DrawBitmapFilter:raw. It's compiled now. I don't understand why directive "using namespace::" doesn't work

  9. #9
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,683

    Re: Can't compile SDLexe.dll

    "using namespace xy;" works in the other direction: when an "missing" function is encountered for the current namespace, the compiler tries to check for the function in the used namespace too. However you got a linker error.
    The header declared the two Draw methods into DrawBitmapFilter namespace.
    Then your .cpp file provided a definition for a non-scoped Draw method. Then the linker could not find the "promised" DrawBitmapFilter:raw method.
    You can either specify the scope as you have done at the end, or you could also surround the definition(s) with a namespace DrawBitmapFilter {...} block.

  10. #10
    Registered User
    Join Date
    Jul 2007
    Posts
    32

    Re: Can't compile SDLexe.dll

    wizard_hu, thanks.

    I try to build test apps and get many errors like this :
    Code:
    mwldsym2.exe: Undefined symbol: '_SDL_FreeSurface'
    mwldsym2.exe: referenced from '_SDL_main' in sdltest.cpp:139
    For example SDL_FreeSurface defined in SDL_video.h :
    Code:
    extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface);
    This header included in proect via SDL.h.

  11. #11
    Registered User
    Join Date
    Jul 2007
    Posts
    32

    Re: Can't compile SDLexe.dll

    When I open sdl.lib I see many like this : "__imp___._.absent_export_23" instead of "SDL_* @ 23 NONAME". When I delete old and refreeze I found in it many lines like this : "__E32Dll @ 23 NONAME ABSENT". I found Wormux which used tweaked version SDL 2.4.4 from Marcus Mertrama. Builds and freezing is fine. XFlame demo compiles and works in emulator.
    I hope to find what wrong with this lirary...

  12. #12
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,683

    Re: Can't compile SDLexe.dll

    Quote Originally Posted by SuperZANAC View Post
    I try to build test apps and get many errors like this :
    Code:
    mwldsym2.exe: Undefined symbol: '_SDL_FreeSurface'
    mwldsym2.exe: referenced from '_SDL_main' in sdltest.cpp:139
    That is an undefined symbol, referenced from line 139 of sdltest.cpp.
    For example SDL_FreeSurface defined in SDL_video.h :
    Code:
    extern DECLSPEC void SDLCALL SDL_FreeSurface(SDL_Surface *surface);
    This header included in proect via SDL.h.
    That is a declaration. When you write
    Code:
    void hello();
    that is a declaration. You often collect declarations into .h files.
    However a definition is when the function gets a body
    Code:
    void hello()
    {
        printf("Hello!\n\r");
    }
    After you declare a function you can refer it any time, and the code will compile into object file(s). However in order to link the object file(s) into an executable, the definition is required too, otherwise how could the computer imagine what hello() is supposed to do?
    Definitions reside in
    - object file(s), freshly compiled from .c/pp files
    - library file(s), which are also compiled from .c/pp files, just it happened earlier and the (usullay) many resulting object files are collected into (usually) a few .lib files.
    The 'extern' thing in SDL_video.h explicitly says that this function exists, but its definition is going to be somewhere else, so it may happen to be in an other sub-project, producing some partial library.
    As you are compiling SDL itself, you can probably check which .c/pp file defines SDL_FreeSurface, and make sure that this definition gets compiled (e.g. the actual file is part of the project, and the definition is not filtered out somehow, with comments, #ifdef-s, etc.).

  13. #13
    Registered User
    Join Date
    Jul 2007
    Posts
    32

    Re: Can't compile SDLexe.dll

    wizard_hu, by default SDL search its internal headers in proect folders not in "\epoc32\include\SDL". I added ones to system include path and XFlame demo compiles fine in emulator. Build with warmux_sdl.dll is stable. But with sdl.dll XFlame try to catch commandline parameters via popup menu and crashes with errors in popup in Windows XP :
    "Symbian OS Application Error

    A call to User::Panic() has occured ...
    Program STDOUT::XFlame
    Error Line: 196: -18"

    "Symbian OS Application Error

    A call to User::Panic() has occured ...
    Program STDOUT::SDLMain
    Error Line: 196: -18"

    "Symbian OS Application Error

    A call to User::Panic() has occured ...
    Program STDOUT::STDOUT
    Error Line: 196: -18"

  14. #14
    Nokia Developer Moderator
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    28,683

    Re: Can't compile SDLexe.dll

    Negative numbers are here: http://developer.nokia.com/Community/Wiki/Error_codes - so something is not ready to do something.
    As you get this message from Windows (I assume it appears in a grey box, offering debug/continue perhaps some other options), it means that Just In Time debugging is already enabled for the emulator. Start the application in debug mode from Carbide.c++ and you will see the complete stack trace leading to the panic.

Similar Threads

  1. I cant't compile!
    By ongunx in forum Symbian Signed Support, Application Packaging and Distribution and Security
    Replies: 1
    Last Post: 2010-02-02, 21:52
  2. How to compile PY to PYC?
    By JOM in forum Symbian
    Replies: 13
    Last Post: 2008-06-13, 17:07
  3. how can i compile?
    By callioglu in forum Mobile Java Tools & SDKs
    Replies: 2
    Last Post: 2006-10-06, 07:58
  4. Cannot compile SMS example
    By raychow2004 in forum Symbian Networking & Messaging (Closed)
    Replies: 0
    Last Post: 2004-01-25, 10:15

Posting Permissions

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