Click here to Skip to main content
14,768,008 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: C++ syntax: any idea to avoid overwriting functions of base class? Pin
Richard MacCutchan3-Apr-10 0:17
mveRichard MacCutchan3-Apr-10 0:17 
GeneralRe: C++ syntax: any idea to avoid overwriting functions of base class? Pin
includeh103-Apr-10 9:22
Memberincludeh103-Apr-10 9:22 
GeneralRe: C++ syntax: any idea to avoid overwriting functions of base class? Pin
Richard MacCutchan3-Apr-10 10:22
mveRichard MacCutchan3-Apr-10 10:22 
GeneralRe: C++ syntax: any idea to avoid overwriting functions of base class? Pin
Leif Simon Goodwin4-Apr-10 3:09
mvaLeif Simon Goodwin4-Apr-10 3:09 
AnswerRe: C++ syntax: any idea to avoid overwriting functions of base class? Pin
Bernódus Kristinsson24-Apr-10 15:27
MemberBernódus Kristinsson24-Apr-10 15:27 
Questioncan't run unicode/normalize example Pin
permutations2-Apr-10 17:09
Memberpermutations2-Apr-10 17:09 
AnswerRe: can't run unicode/normalize example Pin
Adam Roderick J2-Apr-10 19:17
MemberAdam Roderick J2-Apr-10 19:17 
QuestionRedefination error [modified] Pin
darc koder2-Apr-10 10:47
Memberdarc koder2-Apr-10 10: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 11:18
mveRick York2-Apr-10 11:18 
GeneralRe: Redefination error Pin
darc koder2-Apr-10 11:40
Memberdarc koder2-Apr-10 11:40 
GeneralRe: Redefination error Pin
Rick York2-Apr-10 11:52
mveRick York2-Apr-10 11:52 
AnswerRe: Redefination error Pin
Tim Craig2-Apr-10 15:09
MemberTim Craig2-Apr-10 15:09 
AnswerRe: Redefination error Pin
«_Superman_»2-Apr-10 16:27
professional«_Superman_»2-Apr-10 16:27 
QuestionDuplicate Handle to get Real Process Handle Pin
ForNow2-Apr-10 9:29
MemberForNow2-Apr-10 9:29 
AnswerRe: Duplicate Handle to get Real Process Handle Pin
Richard MacCutchan2-Apr-10 10:30
mveRichard MacCutchan2-Apr-10 10:30 
QuestionCComboBox "right allign text" option moves the list box selection arrow to the left (VC 6.0 MFC) Pin
Vaclav_2-Apr-10 9:24
MemberVaclav_2-Apr-10 9: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 10:32
mveRichard MacCutchan2-Apr-10 10: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 16:41
MemberVaclav_2-Apr-10 16:41 
Questionlimited user in xp Pin
Boost20102-Apr-10 7:49
MemberBoost20102-Apr-10 7:49 
QuestionRe: limited user in xp Pin
David Crow2-Apr-10 9:01
MemberDavid Crow2-Apr-10 9:01 
AnswerRe: limited user in xp Pin
Boost20102-Apr-10 9:21
MemberBoost20102-Apr-10 9:21 
GeneralRe: limited user in xp Pin
David Crow2-Apr-10 9:24
MemberDavid Crow2-Apr-10 9:24 
GeneralRe: limited user in xp Pin
Boost20102-Apr-10 9:37
MemberBoost20102-Apr-10 9:37 
GeneralRe: limited user in xp Pin
David Crow2-Apr-10 9:40
MemberDavid Crow2-Apr-10 9:40 
GeneralRe: limited user in xp Pin
Boost20102-Apr-10 9:43
MemberBoost20102-Apr-10 9: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.