Click here to Skip to main content
16,012,508 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralHGLOBAL question Pin
Beer2624-Jul-03 9:59
Beer2624-Jul-03 9:59 
GeneralRe: HGLOBAL question - ignorant response Pin
AlexO24-Jul-03 10:34
AlexO24-Jul-03 10:34 
GeneralRe: HGLOBAL question Pin
peterchen24-Jul-03 10:38
peterchen24-Jul-03 10:38 
GeneralRe: HGLOBAL question Pin
Beer2624-Jul-03 10:47
Beer2624-Jul-03 10:47 
GeneralRe: HGLOBAL question Pin
peterchen24-Jul-03 10:52
peterchen24-Jul-03 10:52 
GeneralRe: HGLOBAL question Pin
Terry O'Nolley24-Jul-03 10:47
Terry O'Nolley24-Jul-03 10:47 
GeneralRe: HGLOBAL question Pin
Beer2624-Jul-03 10:48
Beer2624-Jul-03 10:48 
GeneralInline function causing unresolved symbols. Pin
73Zeppelin24-Jul-03 8:53
73Zeppelin24-Jul-03 8:53 
I'm including a class that has an inline function called
GetOldNodeIndex defined in the header file for that class.
When I try to access it, say in the main() function, the compiler
spills out (seemingly unrelated) unresolved symbol errors....

Here's the class definition
<code>
// SpringNode.h: interface for the CSpringNode class.
//
//////////////////////////////////////////////////////////////////////

#if !defined(AFX_SPRINGNODE_H__7DC1CC9F_C211_478F_B542_9B71B4A3C4EA__INCLUDED_)
#define AFX_SPRINGNODE_H__7DC1CC9F_C211_478F_B542_9B71B4A3C4EA__INCLUDED_

#include "CM3DVector2f.h"	// Added by ClassView
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000


class CSpringNode  
{

public:
	unsigned int m_uiEntryTracker;
	unsigned int m_uiNodeIndex;
	unsigned int m_uiValence;
	
	double m_dEnergy;
	
	CM3DVector2f m_M3DPosition;

	CSpringNode(unsigned int Index, CM3DVector2f& rPosition);

	virtual ~CSpringNode();

	bool operator<(const CSpringNode& rNode) const
	{
		return (m_dEnergy < rNode.m_dEnergy);
	};


protected:
	CSpringNode(){};	// default constructor, do not use


private:
	unsigned int m_uiPreSortIndex;

public:
	unsigned int GetOldNodeIndex() { return (m_uiPreSortIndex); };

};




#endif // !defined(AFX_SPRINGNODE_H__7DC1CC9F_C211_478F_B542_9B71B4A3C4EA__INCLUDED_)

</code>


and the main function
<code>
// TrustRegion.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include "SpringNode.h"
#include "CM3DVector2f.h"


int main(int argc, char* argv[])
{
	CM3DVector2f Vector;
	Vector.x = 5.5;
	Vector.y = -4.6;

	CSpringNode aNode(0, Vector);

	cout << aNode.GetOldNodeIndex() << endl;
	
	return 0;
}
</code>


and the errors:
Compiling...
TrustRegion.cpp
Linking...
nafxcwd.lib(afxmem.obj) : error LNK2005: "void __cdecl operator delete(void *)" (??3@YAXPAX@Z) already defined in LIBCD.lib(dbgdel.obj)
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __endthreadex
nafxcwd.lib(thrdcore.obj) : error LNK2001: unresolved external symbol __beginthreadex
Debug/TrustRegion.exe : fatal error LNK1120: 2 unresolved externals
Error executing link.exe.

TrustRegion.exe - 4 error(s), 0 warning(s)


I should mention that if I remove everything that relates to the
inline function all those errors go away and everything works fine....

Anyone know what's going on here???
GeneralRe: Inline function causing unresolved symbols. Pin
David Crow24-Jul-03 9:04
David Crow24-Jul-03 9:04 
GeneralRe: Inline function causing unresolved symbols. Pin
73Zeppelin24-Jul-03 9:05
73Zeppelin24-Jul-03 9:05 
GeneralRe: Inline function causing unresolved symbols. Pin
David Crow24-Jul-03 9:09
David Crow24-Jul-03 9:09 
GeneralRe: Inline function causing unresolved symbols. Pin
73Zeppelin24-Jul-03 9:19
73Zeppelin24-Jul-03 9:19 
GeneralRe: Inline function causing unresolved symbols. Pin
David Crow24-Jul-03 9:22
David Crow24-Jul-03 9:22 
GeneralRe: Inline function causing unresolved symbols. Pin
73Zeppelin24-Jul-03 9:24
73Zeppelin24-Jul-03 9:24 
GeneralRe: Inline function causing unresolved symbols. Pin
73Zeppelin24-Jul-03 9:07
73Zeppelin24-Jul-03 9:07 
GeneralRe: Inline function causing unresolved symbols. Pin
Tim Smith24-Jul-03 9:09
Tim Smith24-Jul-03 9:09 
GeneralRe: Inline function causing unresolved symbols. Pin
73Zeppelin24-Jul-03 9:13
73Zeppelin24-Jul-03 9:13 
GeneralRe: Inline function causing unresolved symbols. Pin
John M. Drescher24-Jul-03 9:37
John M. Drescher24-Jul-03 9:37 
GeneralRe: Inline function causing unresolved symbols. Pin
73Zeppelin25-Jul-03 3:03
73Zeppelin25-Jul-03 3:03 
GeneralRe: Inline function causing unresolved symbols. Pin
Dangleberry25-Jul-03 3:36
sussDangleberry25-Jul-03 3:36 
GeneralRe: Inline function causing unresolved symbols. Pin
73Zeppelin25-Jul-03 3:43
73Zeppelin25-Jul-03 3:43 
GeneralRe: Inline function causing unresolved symbols. Pin
John M. Drescher25-Jul-03 4:07
John M. Drescher25-Jul-03 4:07 
GeneralRe: Inline function causing unresolved symbols. Pin
Abin24-Jul-03 14:16
Abin24-Jul-03 14:16 
GeneralRe: Inline function causing unresolved symbols. Pin
73Zeppelin25-Jul-03 2:41
73Zeppelin25-Jul-03 2:41 
QuestionHow to pass an &quot;enum&quot; value as a parameter. Pin
WREY24-Jul-03 8:51
WREY24-Jul-03 8:51 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.