Hi,
I get an error while compiling, it's probably something obvious but I'm not good enough to spot my mistake.
I took the minimal app .ccp and .h and put my code in it (the minimal app compiles ok).
I got the following error (many times):
error C2512: 'CGapiSurface' : no appropriate default constructor available
pointing to the following part of the code in the .cpp:
CMyApplication::CMyApplication(const GDAPPCONFIG& config) : CGapiApplication(config)
{
}
Please help me!!!!!
Thanks in advance.
Vincent.
There's a change in the CGapiSurface constructor. This was necessary to move the library to LIB files.
You can as of GapiDraw 3.50 no longer use:
CGapiSurface surf;
-or-
CGapiSurface pSurf = new CGapiSurface();
You have to use:
CGapiSurface surf(m_pGapiDraw);
-or-
CGapiSurface pSurf = new CGapiSurface(m_pGapiDraw);
All GapiDraw objects now require a pointer to the CGapiDraw object.
Hi Johan, thanks for the answer.
I might be stupid be I can't manage to make it work.
Do I have to change every declaration of CGapiSurface, in both .cpp and .h?
Thanks for your answer.
Vincent.
You have to change all the constructors.. Take a look at the new samples shipped with GapiDraw.
Hi Johan,
many thanks for your help again,
I know now I'm stupid (or at least not a good programmer!!!) because I can't get it to work.
Here is my code:
.h:
class CMyApplication : public CGapiApplication
{
// Construction
public:
CMyApplication(const GDAPPCONFIG& config);
// Attributes
protected:
//Surfaces definition
CGapiSurface surf;
//and so on...
.cpp:
CMyApplication::CMyApplication(const GDAPPCONFIG& config) : CGapiApplication(config)
{
CGapiSurface surf(m_pGapiDraw);
//and so on for the other surfaces
}
I still got the [size=9]error C2512: 'CGapiSurface' : no appropriate default constructor available
Pointing to the opening bracket of my constructor in the .cpp
I got one C2512 error for each surface I declare in my .h
I checked the plasma app for win32 and can't see what I'm missing...
I'm sorry to bother you with that kind of stupid question, thank you very much for your help.
Vincent.
CGapiSurface surf;
Should be CGapiSurface* surf;
CGapiSurface surf(m_pGapiDraw);
Should be CGapiSurface surf = new CGapiSurface(m_pGapiDraw);
Hope it helps!
//Johan
Hi Johan,
Many thanks for your help, I finally managed to compile! Alléluïa!!!
But I have now a linking problem:
GapiDraw.lib(GapiSurface.obj) : error LNK2019: unresolved external symbol memcpyArm referenced in function "public: long __cdecl CGapiSurface::BltFast(long,long,class CGapiSurface *,struct tagRECT *,unsigned long,struct _GDBLTFASTFX *)" (?BltFast@CGapiSurface@@QAAJJJPAV1@PAUtagRECT@@KPAU_GDBLTFASTFX@@@Z)
ARMRel/Taptatop.exe : fatal error LNK1120: 1 unresolved externals
I have the same problem when I try to build the minimal app.
I use evc++3.0 and build for smartphone 2002.
Thanks again for your help.
Vincent.
Hello, I am getting the same error when linking.
(Smartphone SDK 2002,GapiDraw 3.5Beta1)
gapidraw.lib(GapiSurface.obj) : error LNK2019: unresolved external symbol memcpyArm referenced in function "public: long __cdecl CGapiSurface::BltFast(long,long,class CGapiSurface *,struct tagRECT *,unsigned long,struct _GDBLTFASTFX *)" (?BltFast@CG
apiSurface@@QAAJJJPAV1@PAUtagRECT@@KPAU_GDBLTFASTFX@@@Z)
Any clues?
I just tried to link with the new Beta3 and I get the same error.
I have surfed the net but can't find anything about any memcpyArm function. In which lib/file is that function defined?
I have done hex search in the the smartphone lib and found only one location of the string memcpyArm, but in the pocket pc lib i have found 7, is the memcpyArm function not defined in the smartphone lib?
Hm, strange. I had no issues compiling for smartphone 2002. I am writing this on my 4700 so I don't have the code with me, but did you include the "afx" something file in the "afx" something folder in the samples folder.

You need to copy this file to your project folder and recompile. Check the readme.txt in the samples folder.
Thanks for the answer, no had not copied the afxres.h file to my project folder. So I did but unfortunately I got the same error.
I have tried the minimal example in 3.51 which in the settings refers to the pocket pc lib by default and therefore I have no problem compiling it. If I change to the smartphone lib I get the same link error.
I compiled my game with the pocket pc lib and surprisingly it runs on my smartphone :)
Whats the difference with the smartphone lib and the ppc lib?