PocketMatrix forums

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

Upgrade to 3.0 problem

Hello all... I'm trying to do a quick upgrade of a GD 2.05 project to 3.0, and I've gotten it about 99% of the way, but I'm getting two errors and two warnings that I frankly don't understand. Anyone have a quick answer for me? I know it's just something simple that I'm forgetting, and I got everything else without any problem. Thanks!

--------------------Configuration: game - Win32 Debug--------------------
Compiling...
main.cpp
c:\temp\etc\kgarcade\source\common\main.cpp(35) : error C2259: 'CGame' : cannot instantiate abstract class due to following members:
c:\temp\etc\kgarcade\source\common\main.h(144) : see declaration of 'CGame'
c:\temp\etc\kgarcade\source\common\main.cpp(35) : warning C4259: 'long __thiscall CGapiApplication::CreateVidMemSurfaces(class CGapiDisplay *,struct HINSTANCE__ *)' : pure virtual function was not defined
c:\gapidraw300eval\include\win32\gapiapplication.h(130) : see declaration of 'CreateVidMemSurfaces'
c:\temp\etc\kgarcade\source\common\main.cpp(35) : error C2259: 'CGame' : cannot instantiate abstract class due to following members:
c:\temp\etc\kgarcade\source\common\main.h(144) : see declaration of 'CGame'
c:\temp\etc\kgarcade\source\common\main.cpp(35) : warning C4259: 'long __thiscall CGapiApplication::CreateVidMemSurfaces(class CGapiDisplay *,struct HINSTANCE__ *)' : pure virtual function was not defined
c:\gapidraw300eval\include\win32\gapiapplication.h(130) : see declaration of 'CreateVidMemSurfaces'
Never mind guys, I got it... Seems that I had to define CreateVidMemSurfaces, even though I wasn't using it. Weird, I didn't have to before, and I kinda would have expected it to be the same thing. Ah well, it compiles now. I just have a linker issue now, but I know what that's all about. Later all!
Woops, spoke a litlte too soon... I have one last linker error that so far I haven't figured out (I may in two minutes, but if anyone knows)...

--------------------Configuration: game - Win32 Debug--------------------
Linking...
GapiApplication.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: long __thiscall CGapiDisplay::GetBackBuffer(class CGapiSurface *)" (__imp_?GetBackBuffer@CGapiDisplay@@QAEJPAVCGapiSurface@@@Z)
Debug/game.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

game.exe - 2 error(s), 0 warning(s)
Alright, now this is getting frustrating... I brought the project home and am trying it on a different PC. Now I get the following:

--------------------Configuration: game - Win32 Debug--------------------
Build : warning : failed to (or don't know how to) build 'C:\Program Files\libraries\GapiDraw\include\GapiApplication.cpp'
Compiling...
GapiApplication.cpp
fatal error C1083: Cannot open source file: 'C:\Program Files\libraries\GapiDraw\include\GapiApplication.cpp': No such file or directory
Error executing cl.exe.

game.exe - 1 error(s), 1 warning(s)

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


I don't have and project-specific paths defined, they are all set up under Tools...Options...Directories. This has always worked in the past. The directory I have for includes is 'C:\Program Files\libraries\GapiDraw\include\Win32, which is correct, but this output shows it's trying to get it from the level above. WHAT GIVES?!?
Argh... So I copy everything from ./include/win33 into ./include, and of course it compiles now. And I'm not getting that import problems I was seeing at work.

This strikes me as clearly some sort of pathing issue, maybe some paths stored in the project files that are overriding my VS settings.

If anyone has any ideas, I'd appreciate it, but at least I have it working now on one PC. Now if I can just get it set up on the other tomorrow like this, it'll be OK.
Go back and look for my posts on the 2.10 beta testing that I did. I think I noted that the pathing had changed for GD 3.
I'll go look for that thread, but I did see the pathing changes, and I changed my paths accordingly. The wierd thing though is it's acting as if there is the old path stored somewhere that is overriding the current path. Does that info get stored in the project files, and is it possible it's still there even after I went and removed it from the project-level?

I do have it compiling now at home, so it's not the end of the world, but I need to get it working on my other PC at work so I can work there when I have down time, and the problem is I'm not completely sure why it worked at home but not there to begin wtih.
Is the frame rate and frame time functionality no longer available in 3.0? Both are displaying zero for me. I'm using the following code:

Code:

if (show_fps) {
// FPS
FLOAT fps;
m_timer.GetActualFrameRate(&fps;);
TCHAR szFPS[16];
_stprintf(szFPS, TEXT("%.0f"), fps);
backbuffer->FillRect(CRect(0, 0, 22, 16), RGB(0, 0, 0), 0, NULL);
backbuffer->DrawText(0, -4, szFPS, &font1;, GDDRAWTEXT_LEFT, NULL, NULL, NULL);
}

if (show_frame_time) {
// Frame Time
FLOAT ft;
m_timer.GetActualFrameTime(&ft;);
TCHAR szFT[16];
_stprintf(szFT, TEXT("%.0f"), ft);
backbuffer->FillRect(CRect(218, 0, 240, 16), RGB(0, 0, 0), 0, NULL);
backbuffer->DrawText(240, -4, szFT, &font1;, GDDRAWTEXT_RIGHT, NULL, NULL, NULL);
}


Note that m_timer IS a CGapiTimer at class-level. I realize the m_timer that you used to have available automatically when using CGapiApplication is no longer there... I just left the name m_timer so it was less code to change.
Hi Frank!

I actually made a topic in the 3.0 readme-file describing most of the issues you encountered. :)

"How to get your GapiDraw 2.0 game to compile with the GapiDraw 3.0 API"
http://www.gapidraw.com/doc/301/doc-readme.htm

Seems that I had to define CreateVidMemSurfaces, even though I wasn't using it. Weird, I didn't have to before, and I kinda would have expected it to be the same thing.


We did it this way to make people more aware of vidsurfaces / sysmemsurfaces. We will receive a Zodiac2 shortly from Tapwave and it will also support "vidmem" surfaces... I have added the "need" for vidmemsurfaces to the readme-file.

Is the frame rate and frame time functionality no longer available in 3.0? Both are displaying zero for me.


We changed m_display, m_backbuffer, m_input, m_timer:
m_display -> m_pDisplay
m_input -> m_pInput
m_timer -> m_pTimer

This was done for cross-platform issues.

We also removed m_backbuffer. This was also related to cross-platform issues. To get the backbuffer now you call m_pDisplay->GetBackbuffer(). I have update the readme-file to also reflect this issue.
Ok, I'm still having a single linker error when compiling on my work PC. It IS working at home, which is odd because the environments are virtually identical. I of course copied the entire working project from home and brought it to work today, but no go. Here's the error, which I think is the same as yesterday anyway...

--------------------Configuration: game - Win32 Debug--------------------
Linking...
GapiApplication.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: long __thiscall CGapiDisplay::GetBackBuffer(class CGapiSurface *)" (__imp_?GetBackBuffer@CGapiDisplay@@QAEJPAVCGapiSurface@@@Z)
Debug/game.exe : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.

game.exe - 2 error(s), 0 warning(s)



Anyone have any ideas? Thanks!
Ok, I don't get this... I just did a Rebuild All (which I *HAVE* done before), but this time it worked, and a couple of times since it's worked (as well as a plain Build).

Ok, forget it guys, I give up. It's working now, I don't CARE if I understand WHY at this point!
By the way (as I go for the record of longest thread in the world representing a conversation between one person and... HIMSELF, essentially!)... My frame counter and frame time is now working again after changing to m_pTimer. Thanks Johan!
fzammetti wrote:(as I go for the record of longest thread in the world representing a conversation between one person and... HIMSELF, essentially!)


I think mlepage might still have you beat.
http://www.pocketmatrix.com/forums/view ... 61&start=0

Good effort though. :)

-John
Nope, I beat him by two! WOO-HOO!

I always say, if your going to do something, REALLY DO IT! :)

The thing to note about mlepage though is that I've been a member about a year longer than him, but he's damned near caught up to me in number of posts! :)
What can I say, I sit in front of a computer almost every waking hour. :-)