Jump to content
  • Advertisement
Sign in to follow this  
Afr0m@n

Half-Life Window Class problem

This topic is 5104 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

When I try to make a new window function, based upon the classes in "vgui_MOTDWindow.cpp" I get a linker problem:( Basically, I've created a header file that has the EXACT same declaration as the CMessageWindowPanel class, but I always get a linker error when I change the name of my new class and try to compile the project:(
//-----------------------------------------------------------------------------
// Purpose: Displays the MOTD and basic server information
//-----------------------------------------------------------------------------
class CCharacterWindowPanel : public CMenuPanel
{
public:
	CCharacterWindowPanel( const char *szTEXT, const char *szTitle, int iShadeFullScreen, int iRemoveMe, int x, int y, int wide, int tall );

private:
	CTransparentPanel *m_pBackgroundPanel;

};

//-----------------------------------------------------------------------------
// Purpose: Creates a new CMessageWindowPanel
// Output : CMenuPanel - interface to the panel
//-----------------------------------------------------------------------------
CMenuPanel *CCharacterWindowPanel_Create( const char *szTEXT, const char *szTitle, int iShadeFullscreen, int iRemoveMe, int x, int y, int wide, int tall )
{
	return new CCharacterWindowPanel( szTEXT, szTitle, iShadeFullscreen, iRemoveMe, x, y, wide, tall );
}
This is the error I get:
--------------------Configuration: cl_dll - Win32 Debug--------------------
Compiling...
vgui_CharacterWindow.cpp
Linking...
   Creating library .\Debug/client.lib and object .\Debug/client.exp
vgui_CharacterWindow.obj : error LNK2001: unresolved external symbol "public: __thiscall CCharacterWindowPanel::CCharacterWindowPanel(char const *,char const *,int,int,int,int,int,int)" (??0CCharacterWindowPanel@@QAE@PBD0HHHHHH@Z)
.\Debug\client.dll : fatal error LNK1120: 1 unresolved externals
Error executing link.exe.
Creating browse info file...
BSCMAKE: warning BK4503 : minor error in .SBR file '.\Debug\vgui_CharacterWindow.sbr' ignored

client.dll - 2 error(s), 1 warning(s)
Can someone plz help me with this?

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
You're not defining the constructor body for the CCharacterWindowPanel class

Share this post


Link to post
Share on other sites
Ok, so I try to compile the function body of my class, but when I do that, I get an error that I've never seen before. Can someone plz help me?

#include "vgui_CharacterWindow.h"

CCharacterWindow :: CCharacterWindow(int iTrans, int iRemoveMe, int x, int y, int wide, int tall) : CMenuPanel(iTrans, iRemoveMe, x,y,wide,tall)
{

}

================================================================

--------------------Configuration: cl_dll - Win32 Debug--------------------
Compiling...
vgui_CharacterWindow.cpp
c:\sierra\half-life\sdk\single-player source\cl_dll\vgui_characterwindow.cpp(14) : error C2143: syntax error : missing ';' before 'PCH creation point'
Error executing cl.exe.
Creating browse info file...

client.dll - 1 error(s), 0 warning(s)

Share this post


Link to post
Share on other sites
IIRC you have to set the precompiled header generation to 'automatic' or something like that in the project settings.

Share this post


Link to post
Share on other sites
Actually, I DID look in the msdn library, but frankly, the "solution" provided didn't make much sense to me, as, as you can see, there's no "PCH Creation Point" in my code, and there is no syntax error:S And also, creating automated header files (using the /YX option) didn't solve the problem:(

Anyone?

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!