Programming a multiplayer FPS in DirectX

Started by
31 comments, last by HiddenHaxor 14 years, 5 months ago
Quote:Original post by Gage64
Go to Project -> Properties -> C/C++ -> Code Generation, and select a different option for the Runtime Library on the right (I'm not sure which one).


Just tried them all.

They all come up with the same error at the end, just some have even more errors including the libcp.lib one.`



Please Help,


Thanks in advance,


Joe
__________________________http://www.dev-hq.co.ukhttp://forum.dev-hq.co.uk
Advertisement
Add 'libcp.lib' and 'libcpd.lib' to your ignore library option and it should work. They are not needed.
Where do I find this ignore list?

(I'm looking around at the moment and will tell you if I can have found, but you might be faster at telling me.)


Thanks,


Joe
__________________________http://www.dev-hq.co.ukhttp://forum.dev-hq.co.uk
Project -> Properties -> Linker -> Input -> Ignore Specific Library.
I've been working through this book as well, and have come up with several solutions to get code compile. So far for every chapter i've had tor:

1) include windows.h
2) define IDC_STATIC -1 in resources.h
3) remove anything related to dplay.

If you have any other issues with this book, feel free to PM me.
Sorry for my late reply, I was away for a bit.

I will try the whole dplay thing in a sec. But as far as I can see its more of a resource problem at the moment. Therefore firstly I will post my errors after ignoring the libraries:


1>Engine.lib(SceneObject.obj) : warning LNK4075: ignoring '/EDITANDCONTINUE' due to '/OPT:ICF' specification
1>LINK : warning LNK4098: defaultlib 'LIBCMTD' conflicts with use of other libs; use /NODEFAULTLIB:library
1>GameMaterial.obj : error LNK2019: unresolved external symbol "public: __thiscall Material::Material(void)" (??0Material@@QAE@XZ) referenced in function "public: __thiscall GameMaterial::GameMaterial(void)" (??0GameMaterial@@QAE@XZ)
1>.\Release/Game.exe : fatal error LNK1120: 1 unresolved externals



Please Help,

Thanks in advance,


Joe
__________________________http://www.dev-hq.co.ukhttp://forum.dev-hq.co.uk
Have you defined a constructor for the Material class?

You need to define one, like so:

// I'm guessing you have a file called Material.cpp where Material is defined, if so this goes in thereMaterial::Material() {     // init code here}
Quote:Original post by mattd
Have you defined a constructor for the Material class?

You need to define one, like so:

*** Source Snippet Removed ***


I got the code from a book so I imagine its correct.

However I did check and yes there is a GameMaterial.cpp and inside this line looks like the one that you typed:

GameMaterial::GameMaterial() : Material()



Please Help..


Thanks In Advance,


Joe
__________________________http://www.dev-hq.co.ukhttp://forum.dev-hq.co.uk
That's a constructor for the GameMaterial class, not the Material class, so close, but no cigar :)

Check the error you posted:
Quote:1>GameMaterial.obj : error LNK2019: unresolved external symbol "public: __thiscall Material::Material(void)" (??0Material@@QAE@XZ) referenced in function "public: __thiscall GameMaterial::GameMaterial(void)" (??0GameMaterial@@QAE@XZ)

Like it says, it's looking for the Material constructor, because GameMaterial refers to it.

Can you post the source code for the Material class?
Well since I get mixed up so easily. Here is some of the section with all those type of classes in:

//-----------------------------------------------------------------------------
// The game material class constructor.
//-----------------------------------------------------------------------------
GameMaterial::GameMaterial() : Material()
{
// The default material doesn't have any step sounds.
m_stepSounds = NULL;
}

//-----------------------------------------------------------------------------
// The game material class constructor.
//-----------------------------------------------------------------------------
GameMaterial::GameMaterial( char *name, char *path ) : Material( name, path )
{
// Load the script for this material.
Script *script = new Script( name, path );

// Store the step sounds.
m_stepSounds = new LinkedList< Sound >;
char stepSound[16] = { "step_sound0" };
while( script->GetStringData( stepSound ) != NULL )
{
m_stepSounds->Add( new Sound( script->GetStringData( stepSound ) ) );
sprintf( stepSound, "step_sound%d", m_stepSounds->GetTotalElements() );
}

// Destory the material's script.
SAFE_DELETE( script );
}

//-----------------------------------------------------------------------------
// The game material class destructor.
//-----------------------------------------------------------------------------
GameMaterial::~GameMaterial()
{
// Destroy the step sounds list.
SAFE_DELETE( m_stepSounds );
}
__________________________http://www.dev-hq.co.ukhttp://forum.dev-hq.co.uk

This topic is closed to new replies.

Advertisement