PocketMatrix forums

A read-only archive of the PocketMatrix forums (2001–2014). Posting and accounts are closed.

GapiDraw 3.6 Issues

InexorableTash · 27 May 2006, 03:39 UTC
Summary:

    Desktop VS8 builds need to be UNICODE
    Compiler warnings in GapiApplication.cpp
    Linking warnings in all sample applications
    Heap corruption in DLL


I've noticed some issues with GapiDraw 3.6 and VS 2005. These are all blindingly obvious, so they should either be easy to repro or there is something really broken in my configuration.

(1)
Change: Desktop builds with VS 2005 need to define UNICODE/_UNICODE (Configuration Properties > C/C++ > General > Use UNICODE Response Files = Yes). If you don't you'll get linker errors. This is probably a good thing - unless you're targetting Win9x there's no reason not to compile for Unicode, but it was unexpected. Should be in big letters in the release notes.

(2)
Warnings compiling GapiApplication.cpp:
Code:

Warning 4100: unreferenced formal parameter

This isn't new, but it's annoying. Builds should compile cleanly on Warning Level 4 w/ no warnings. This can be fixed by removing parameter names from default implementations of virtual methods: dwKey, keylist, p, etc.

(3)
Warnings when linking, e.g. with a copy of Minimal:
Code:

gapidraw.lib(GapiSurface.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
LINK : warning LNK4075: ignoring '/INCREMENTAL' due to '/LTCG' specification
LINK : warning LNK4098: defaultlib 'MSVCRT' conflicts with use of other libs; use /NODEFAULTLIB:library
gapidraw.lib(*.obj) : warning LNK4204: 'c:\dev\GapiDraw\samples\win32\Copy of Minimal\vs2005-pc\Debug\vc80.pdb' is missing debugging information for referencing module; linking object as if no debug info

The first three are related and can be addressed by changing project configurations. The last (actually a ton of errors - one for each .OBJ in the GapiDraw source) appears to be a change in how the debugging information is included in the DLL. Again, projects should always compile cleanly with no warnings.

(4)
If using DLL (e.g. change Linker > General > Additional Library Directories = ../../../../dll/vs2005-pc), the following runtime errors manifest:
Code:

Windows has triggered a breakpoint in Minimal.exe.
This may be due to a corruption of the heap, and indicates a bug in Minimal.exe or any of the DLLs it has loaded.
The output window may have more diagnostic information

I see this in my application when I call the delete operator on any GapiDraw object. In the Minimal sample, it appears to happen in the constructor. This appears to be heap corruption in the GapiDraw.DLL, but I haven't traced it through at the assembly level.
ten foot ninja · 28 May 2006, 22:17 UTC
I also noticed some issuses with the symbian release, it seems somewhat random, but after a minute or two my whole phone will lock up and i'll have to pull the battery out to reset. This doesn't happen all the time, but i know it will happen when my music doesn't work properly... sounds won't get played after i load all my map tiles and level maps (which i do at the beginning of every level. i load other images before on app startup such as main menu bg). and when i disable the default beep when a user hits a key on the number pad, i know the phone will hang if i can still hear the default beep after i supposedly disabled it. Its a pretty nasty bug as the whole phone will lock up even after i exit my game(!).

i rolled back to 3.5 and everything is fine now. My impression is that its active scheduler related.
Thanks for the feedback. I will investigate.
I tried compiling the vs2005-mobile samples using VS 2005. The builds are fine for PocketPC 2003 and Smartphone 2003. When building the Windows Mobile 5 versions, the build just skips and nothing is created.

Code:

1>------ Skipped Build: Project: Minimal ------
1>
========== Build: 0 succeeded or up-to-date, 0 failed, 1 skipped ==========
InexorableTash · 08 Aug 2006, 03:13 UTC
Unless I missed something, all of the issues I reported above remain unchanged in the new 3.6 package.
These items are still on my work list. We will soon release GapiDraw 3.6a which should work correctly on the Motorola Q Smartphone, and will try to get as much of these fixes in there at the same time.

Thanks again for the report!

//Johan
Ok for all you reading this post (620 reads so far) weare working on resolving these issues. Most of them have been resolved this far and we will shortly release an update to GapiDraw: 3.6a which also includes a fix for the Moto Q device.

Current status:

1. Release notes has now been updated.

2. I could not make a solution to GapiApplication that compiles without warnings on lvl4. If anyone has a solution to this please feel free to send me a PM.

3. I cannot reproduce these issues. All samples compile very clean in my Visual Studio 2005 environment. Anyone else who can reproduce this?

4. This error is caused if you use the RELEASE DLL of Visual Studio 2005 PC in a DEBUG build of the sample file. We will in GapiDraw 3.6a include a DEBUG build of GapiDraw for Visual Studio 2005 PC which resolves this issue.

//Johan
Ok we just released GapiDraw 3.6a today which resolves some of these issues and more.

Current status:

1. Release notes has now been updated.

2. GapiApplication now compiles with no warnings when warning level is set to W4.

3. There were some debugging info remaining in the release build which has now been removed, which should cause GapiDraw to compile more nicely.

4. This issue was caused by using GapiDraw as a DLL and making a DEBUG build of an application in a stationary PC environment. Since GapiDraw was built in Release mode this caused memory issues. GapiDraw 3.6a now includes DEBUG DLL files, using one of these files will remove this memory issue.

//Johan
InexorableTash · 21 Aug 2006, 06:35 UTC
Yep, 3.6a addresses these issues. Yay, thanks Johan! You can compile Minimal on warning level 4 cleanly if you modify the Minimal project properties as follows:

General > Whole Program Optimization: Use Link Time Code Generation

C/C++ > Debug Information Format : Program Database (/Zi)

Linker > Ignore Specific Library: MSVCRT

Linker > Enable Incremental Linking: Default (no)

(Thus far I've only tried out Minimal. It'll be a few days before I have a chance to try retrofitting my hobby project.)
Thanks for these tips. :-) I'm gonna modify the sample projects and upload an updated version of 3.6a.