Click here to Skip to main content
15,886,017 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C++ syntax: any idea to avoid overwriting functions of base class? Pin
Richard MacCutchan2-Apr-10 23:17
mveRichard MacCutchan2-Apr-10 23:17 
GeneralRe: C++ syntax: any idea to avoid overwriting functions of base class? Pin
includeh103-Apr-10 8:22
includeh103-Apr-10 8:22 
GeneralRe: C++ syntax: any idea to avoid overwriting functions of base class? PinPopular
Richard MacCutchan3-Apr-10 9:22
mveRichard MacCutchan3-Apr-10 9:22 
GeneralRe: C++ syntax: any idea to avoid overwriting functions of base class? Pin
Leif Simon Goodwin4-Apr-10 2:09
Leif Simon Goodwin4-Apr-10 2:09 
AnswerRe: C++ syntax: any idea to avoid overwriting functions of base class? Pin
Bernódus Kristinsson24-Apr-10 14:27
Bernódus Kristinsson24-Apr-10 14:27 
Questioncan't run unicode/normalize example Pin
permutations2-Apr-10 16:09
permutations2-Apr-10 16:09 
AnswerRe: can't run unicode/normalize example Pin
Adam Roderick J2-Apr-10 18:17
Adam Roderick J2-Apr-10 18:17 
QuestionRedefination error [modified] Pin
darc koder2-Apr-10 9:47
darc koder2-Apr-10 9:47 
i'm stuck with this problem

well i made this header "shapes.h"



#ifndef SHAPES_H
#define SHAPES_H

#define maxC 80
#define maxV 25
#define maxP 150

struct circles
{
int count;
float radius[maxC];
b2Vec2 center[maxC];
};

struct polygon
{
int count;
int vertex_count[maxV];
b2Vec2 vertex[maxP][maxV];
};

circles cl;
polygon pg;

#endif



sry for lame data structure but had to take like that

i've included it in my main.cpp

and thr's another header "simulate.h"

that needs to be included in "main.cpp"


now the problem is i have to include "shapes.h" in "simulate.h" too.. but when i do that i get error

1>simulate.obj : error LNK2005: "struct polygon pg" (?pg@@3Upolygon@@A) already defined in main.obj
1>simulate.obj : error LNK2005: "struct circles cl" (?cl@@3Ucircles@@A) already defined in main.obj
1>editor/Debug\editor.exe : fatal error LNK1169: one or more multiply defined symbols found

i tried removing "shapes.h" from "main.cpp" with "simulate.h" included in "main.cpp" and "shapes.h" included in "simulate.h" but still get the same error.

please help... i'm using Visual Studio 2008
modified on Friday, April 2, 2010 3:57 PM

AnswerRe: Redefination error Pin
Rick York2-Apr-10 10:18
mveRick York2-Apr-10 10:18 
GeneralRe: Redefination error Pin
darc koder2-Apr-10 10:40
darc koder2-Apr-10 10:40 
GeneralRe: Redefination error Pin
Rick York2-Apr-10 10:52
mveRick York2-Apr-10 10:52 
AnswerRe: Redefination error Pin
Tim Craig2-Apr-10 14:09
Tim Craig2-Apr-10 14:09 
AnswerRe: Redefination error Pin
«_Superman_»2-Apr-10 15:27
professional«_Superman_»2-Apr-10 15:27 
QuestionDuplicate Handle to get Real Process Handle Pin
ForNow2-Apr-10 8:29
ForNow2-Apr-10 8:29 
AnswerRe: Duplicate Handle to get Real Process Handle Pin
Richard MacCutchan2-Apr-10 9:30
mveRichard MacCutchan2-Apr-10 9:30 
QuestionCComboBox "right allign text" option moves the list box selection arrow to the left (VC 6.0 MFC) Pin
Vaclav_2-Apr-10 8:24
Vaclav_2-Apr-10 8:24 
AnswerRe: CComboBox "right allign text" option moves the list box selection arrow to the left (VC 6.0 MFC) Pin
Richard MacCutchan2-Apr-10 9:32
mveRichard MacCutchan2-Apr-10 9:32 
GeneralRe: CComboBox "right allign text" option moves the list box selection arrow to the left (VC 6.0 MFC) Pin
Vaclav_2-Apr-10 15:41
Vaclav_2-Apr-10 15:41 
Questionlimited user in xp Pin
Boost20102-Apr-10 6:49
Boost20102-Apr-10 6:49 
QuestionRe: limited user in xp Pin
David Crow2-Apr-10 8:01
David Crow2-Apr-10 8:01 
AnswerRe: limited user in xp Pin
Boost20102-Apr-10 8:21
Boost20102-Apr-10 8:21 
GeneralRe: limited user in xp Pin
David Crow2-Apr-10 8:24
David Crow2-Apr-10 8:24 
GeneralRe: limited user in xp Pin
Boost20102-Apr-10 8:37
Boost20102-Apr-10 8:37 
GeneralRe: limited user in xp Pin
David Crow2-Apr-10 8:40
David Crow2-Apr-10 8:40 
GeneralRe: limited user in xp Pin
Boost20102-Apr-10 8:43
Boost20102-Apr-10 8:43 

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.