F
fcvcnet
Hi all,
I defined a class, as fellows:
// Segment.h
#pragma once
#include "MyPoint.h"
enum TLSC {PARALLEL, INTERSECT, COINSIDE,INTERSECTATDIASTOLE}
twolinesolutioncases;
class CSegment
{
public:
CSegment(void);
void Clear();
public:
~CSegment(void);
private:
....
....
....
friend TLSC InterSect(const CSegment &sgmt1, const CSegment &sgmt2,
CMyPoint &intersectpoint);
....
};
And at the file segment.cpp below I defined a function to be a global
function
// Segment.cpp
#include "StdAfx.h"
#include "Segment.h"
CSegment::CSegment(void)
: m_pointlist(0)
, m_index(0)
, m_createdirection(true)
{
}
CSegment::~CSegment(void)
{
}
....
TLSC InterSect(const CSegment &sgmt1, const CSegment &sgmt2, CMyPoint
&intersectpoint)
{
double ua,ub;//ub can be delete
double a,b,c;
....
if (0==c)
{
if (a==b==0)
{
return COINSIDE;
}
return PARALLEL;
}
....
if ( ua < 0 || ua > 1 || ub < 0 || ub > 1)
{
return INTERSECTATDIASTOLE;
}
....
return INTERSECT;
}
when I compile ,
Segment.cpp
Linking...
borderView.obj : error LNK2005: "enum TLSC twolinesolutioncases"
(?twolinesolutioncases@@3W4TLSC@@A) already defined in border.obj
Segment.obj : error LNK2005: "enum TLSC twolinesolutioncases"
(?twolinesolutioncases@@3W4TLSC@@A) already defined in border.obj
E:\border\0312\border\Debug\border.exe : fatal error LNK1169: one or more
multiply defined symbols found
Build log was saved at
"file://e:\border\0312\border\border\Debug\BuildLog.htm"
border - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
How to solove this errors?
Thanks.
I defined a class, as fellows:
// Segment.h
#pragma once
#include "MyPoint.h"
enum TLSC {PARALLEL, INTERSECT, COINSIDE,INTERSECTATDIASTOLE}
twolinesolutioncases;
class CSegment
{
public:
CSegment(void);
void Clear();
public:
~CSegment(void);
private:
....
....
....
friend TLSC InterSect(const CSegment &sgmt1, const CSegment &sgmt2,
CMyPoint &intersectpoint);
....
};
And at the file segment.cpp below I defined a function to be a global
function
// Segment.cpp
#include "StdAfx.h"
#include "Segment.h"
CSegment::CSegment(void)
: m_pointlist(0)
, m_index(0)
, m_createdirection(true)
{
}
CSegment::~CSegment(void)
{
}
....
TLSC InterSect(const CSegment &sgmt1, const CSegment &sgmt2, CMyPoint
&intersectpoint)
{
double ua,ub;//ub can be delete
double a,b,c;
....
if (0==c)
{
if (a==b==0)
{
return COINSIDE;
}
return PARALLEL;
}
....
if ( ua < 0 || ua > 1 || ub < 0 || ub > 1)
{
return INTERSECTATDIASTOLE;
}
....
return INTERSECT;
}
when I compile ,
Segment.cpp
Linking...
borderView.obj : error LNK2005: "enum TLSC twolinesolutioncases"
(?twolinesolutioncases@@3W4TLSC@@A) already defined in border.obj
Segment.obj : error LNK2005: "enum TLSC twolinesolutioncases"
(?twolinesolutioncases@@3W4TLSC@@A) already defined in border.obj
E:\border\0312\border\Debug\border.exe : fatal error LNK1169: one or more
multiply defined symbols found
Build log was saved at
"file://e:\border\0312\border\border\Debug\BuildLog.htm"
border - 3 error(s), 0 warning(s)
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
How to solove this errors?
Thanks.