[galib] galib Digest, Vol 34, Issue 2

Dickinson, Bill dickinsw at CMG.MFLDCLIN.EDU
Thu Apr 27 16:12:50 EDT 2006


Mike

I'm not familiar with ex23.c but the errors appear to me to suggest that
you have a library in your link definitions that 
contains the same object modules already defined in the AutoTester
project settings.  In other words, the methods appearing in the errors
are already present in some part of the build step before the linker is
invoked.  It could be that they are already included in the project
build settings AND you are linking in a library that also contains the
object modules for the same routines.  

Examine your build settings to see if there is overlap.  If so,
eliminate one source of them - either remove them from the project build
and include the library, or vice versa.   

Hope this helps.

Bill Dickinson  

-----Original Message-----
From: galib-bounces at mit.edu [mailto:galib-bounces at mit.edu] On Behalf Of
galib-request at mit.edu
Sent: Tuesday, April 25, 2006 10:42 PM
To: galib at mit.edu
Subject: galib Digest, Vol 34, Issue 2


Send galib mailing list submissions to
	galib at mit.edu

To subscribe or unsubscribe via the World Wide Web, visit
	http://mailman.mit.edu/mailman/listinfo/galib
or, via email, send a message with subject or body 'help' to
	galib-request at mit.edu

You can reach the person managing the list at
	galib-owner at mit.edu

When replying, please edit your Subject line so it is more specific than
"Re: Contents of galib digest..."


Today's Topics:

   1. Multiple definitions in MS Visual Studio 2003, V7.1.3088
      (Mike Cooling)
   2. Multiple definitions in MS Visual Studio 2003, V7.1.3088
      (Mike Cooling)


----------------------------------------------------------------------

Message: 1
Date: Wed, 26 Apr 2006 13:46:54 +1200
From: "Mike Cooling" <m.cooling at auckland.ac.nz>
Subject: [galib] Multiple definitions in MS Visual Studio 2003,
	V7.1.3088
To: <galib at mit.edu>
Message-ID: <000101c668d3$4c364110$53d0d882 at bioeng.auckland.ac.nz>
Content-Type: text/plain; charset="us-ascii"

Hi

 

I'm trying to compile an exercise (ex23.c) from Galib in MS Visual
Studio 2003, V7.1.3088, on a Windows XP machine.

 

I've tried Kevin Druhan's solution, including changing the #includes to
read *.hpp *.cpp. I can get a very simple example to run fine this way.

 

However, with ex23.c I errors thus:

 

AutoTester error LNK2005: "int __cdecl GARealArithmeticCrossover(class
GAGenome const &,class GAGenome const &,class GAGenome *,class GAGenome
*)"
(?GARealArithmeticCrossover@@YAHABVGAGenome@@0PAV1 at 1@Z) already defined
in AutoTester.obj

AutoTester error LNK2005: "int __cdecl GARealBlendCrossover(class
GAGenome const &,class GAGenome const &,class GAGenome *,class GAGenome
*)"
(?GARealBlendCrossover@@YAHABVGAGenome@@0PAV1 at 1@Z) already defined in
AutoTester.obj

AutoTester error LNK2005: "int __cdecl GARealGaussianMutator(class
GAGenome &,float)" (?GARealGaussianMutator@@YAHAAVGAGenome@@M at Z) already
defined in AutoTester.obj

AutoTester error LNK2005: "public: __thiscall
GA1DArrayAlleleGenome<float>::GA1DArrayAlleleGenome<float>(class
GAAlleleSetArray<float> const &,float (__cdecl*)(class GAGenome &),void
*)"
(??0?$GA1DArrayAlleleGenome at M@@QAE at ABV?$GAAlleleSetArray at M@@P6AMAAVGAGen
ome@
@@ZPAX at Z) already defined in AutoTester.obj

AutoTester error LNK2005: "public: __thiscall
GA1DArrayAlleleGenome<float>::GA1DArrayAlleleGenome<float>(unsigned
int,class GAAlleleSet<float> const &,float (__cdecl*)(class GAGenome
&),void *)"
(??0?$GA1DArrayAlleleGenome at M@@QAE at IABV?$GAAlleleSet at M@@P6AMAAVGAGenome@
@@ZP
AX at Z) already defined in AutoTester.obj

AutoTester error LNK2005: "public: float __thiscall
GAAlleleSet<float>::allele(unsigned int)const "
(?allele@?$GAAlleleSet at M@@QBEMI at Z) already defined in AutoTester.obj

AutoTester error LNK2005: "public: float __thiscall
GAAlleleSet<float>::allele(void)const "
(?allele@?$GAAlleleSet at M@@QBEMXZ) already defined in AutoTester.obj

AutoTester error LNK2005: "public: virtual __thiscall
GA1DArrayAlleleGenome<float>::~GA1DArrayAlleleGenome<float>(void)"
(??1?$GA1DArrayAlleleGenome at M@@UAE at XZ) already defined in AutoTester.obj

AutoTester error LNK2005: "public: virtual char const * __thiscall
GA1DArrayAlleleGenome<float>::className(void)const "
(?className@?$GA1DArrayAlleleGenome at M@@UBEPBDXZ) already defined in
AutoTester.obj

AutoTester error LNK2005: "public: virtual int __thiscall
GA1DArrayAlleleGenome<float>::classID(void)const "
(?classID@?$GA1DArrayAlleleGenome at M@@UBEHXZ) already defined in
AutoTester.obj

AutoTester error LNK2005: "public: virtual int __thiscall
GA1DArrayAlleleGenome<float>::read(class std::basic_istream<char,struct
std::char_traits<char> > &)"
(?read@?$GA1DArrayAlleleGenome at M@@UAEHAAV?$basic_istream at DU?$char_traits
@D at s
td@@@std@@@Z) already defined in AutoTester.obj

AutoTester fatal error LNK1169: one or more multiply defined symbols
found

 

I have also tried leaving the .c files as .c files, setting the Project
and File options to /TP, and including the folder that contains the ./ga
folder in the Projects VC++ Directories (so I don't have to change

<ga/whatever.c> to "whatever.cpp". In this case I still get the above
errors.

 

What am I missing? If there is anyone out there using MS Vis Studio and
can help please let me know.

 

Thanks for your time,

Mike Cooling

PhD Student

Bioengineering Institute

University of Auckland

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://mailman.mit.edu/pipermail/galib/attachments/20060426/8d2495e9/att
achment-0001.htm

------------------------------

Message: 2
Date: Wed, 26 Apr 2006 15:20:18 +1200
From: "Mike Cooling" <m.cooling at auckland.ac.nz>
Subject: [galib] Multiple definitions in MS Visual Studio 2003,
	V7.1.3088
To: <galib at mit.edu>
Message-ID: <000801c668e0$582af0d0$53d0d882 at bioeng.auckland.ac.nz>
Content-Type: text/plain; charset="us-ascii"

The solution to the following problem (which I was having):

 

I'm trying to compile an exercise (ex23.c) from Galib in MS Visual
Studio 2003, V7.1.3088, on a Windows XP machine.

 

I've tried Kevin Druhan's solution, including changing the #includes to
read *.hpp *.cpp. I can get a very simple example to run fine this way.

 

However, with ex23.c I errors thus:

 

AutoTester error LNK2005: "int __cdecl GARealArithmeticCrossover(class
GAGenome const &,class GAGenome const &,class GAGenome *,class GAGenome
*)"
(?GARealArithmeticCrossover@@YAHABVGAGenome@@0PAV1 at 1@Z) already defined
in AutoTester.obj

AutoTester error LNK2005: "int __cdecl GARealBlendCrossover(class
GAGenome const &,class GAGenome const &,class GAGenome *,class GAGenome
*)"
(?GARealBlendCrossover@@YAHABVGAGenome@@0PAV1 at 1@Z) already defined in
AutoTester.obj

AutoTester error LNK2005: "int __cdecl GARealGaussianMutator(class
GAGenome &,float)" (?GARealGaussianMutator@@YAHAAVGAGenome@@M at Z) already
defined in AutoTester.obj

AutoTester error LNK2005: "public: __thiscall
GA1DArrayAlleleGenome<float>::GA1DArrayAlleleGenome<float>(class
GAAlleleSetArray<float> const &,float (__cdecl*)(class GAGenome &),void
*)"
(??0?$GA1DArrayAlleleGenome at M@@QAE at ABV?$GAAlleleSetArray at M@@P6AMAAVGAGen
ome@
@@ZPAX at Z) already defined in AutoTester.obj

AutoTester error LNK2005: "public: __thiscall
GA1DArrayAlleleGenome<float>::GA1DArrayAlleleGenome<float>(unsigned
int,class GAAlleleSet<float> const &,float (__cdecl*)(class GAGenome
&),void *)"
(??0?$GA1DArrayAlleleGenome at M@@QAE at IABV?$GAAlleleSet at M@@P6AMAAVGAGenome@
@@ZP
AX at Z) already defined in AutoTester.obj

AutoTester error LNK2005: "public: float __thiscall
GAAlleleSet<float>::allele(unsigned int)const "
(?allele@?$GAAlleleSet at M@@QBEMI at Z) already defined in AutoTester.obj

AutoTester error LNK2005: "public: float __thiscall
GAAlleleSet<float>::allele(void)const "
(?allele@?$GAAlleleSet at M@@QBEMXZ) already defined in AutoTester.obj

AutoTester error LNK2005: "public: virtual __thiscall
GA1DArrayAlleleGenome<float>::~GA1DArrayAlleleGenome<float>(void)"
(??1?$GA1DArrayAlleleGenome at M@@UAE at XZ) already defined in AutoTester.obj

AutoTester error LNK2005: "public: virtual char const * __thiscall
GA1DArrayAlleleGenome<float>::className(void)const "
(?className@?$GA1DArrayAlleleGenome at M@@UBEPBDXZ) already defined in
AutoTester.obj

AutoTester error LNK2005: "public: virtual int __thiscall
GA1DArrayAlleleGenome<float>::classID(void)const "
(?classID@?$GA1DArrayAlleleGenome at M@@UBEHXZ) already defined in
AutoTester.obj

AutoTester error LNK2005: "public: virtual int __thiscall
GA1DArrayAlleleGenome<float>::read(class std::basic_istream<char,struct
std::char_traits<char> > &)"
(?read@?$GA1DArrayAlleleGenome at M@@UAEHAAV?$basic_istream at DU?$char_traits
@D at s
td@@@std@@@Z) already defined in AutoTester.obj

AutoTester fatal error LNK1169: one or more multiply defined symbols
found

 

I have also tried leaving the .c files as .c files, setting the Project
and File options to /TP, and including the folder that contains the ./ga
folder in the Projects VC++ Directories (so I don't have to change

<ga/whatever.c> to "whatever.cpp". In this case I still get the above
errors.

 

Is to remove the files GARealGenome.cpp and GAStringGenome.cpp from the
Solution (right click in Solution Explorer and Remove).

 

Thanks to Matthew Wall for the answer,

 

Regards,

 

 

 

-----Original Message-----
From: Mike Cooling [mailto:m.cooling at auckland.ac.nz] 
Sent: Wednesday, 26 April 2006 1:47 p.m.
To: 'galib at mit.edu'
Subject: Multiple definitions in MS Visual Studio 2003, V7.1.3088

 

Hi

 

I'm trying to compile an exercise (ex23.c) from Galib in MS Visual
Studio 2003, V7.1.3088, on a Windows XP machine.

 

I've tried Kevin Druhan's solution, including changing the #includes to
read *.hpp *.cpp. I can get a very simple example to run fine this way.

 

However, with ex23.c I errors thus:

 

AutoTester error LNK2005: "int __cdecl GARealArithmeticCrossover(class
GAGenome const &,class GAGenome const &,class GAGenome *,class GAGenome
*)"
(?GARealArithmeticCrossover@@YAHABVGAGenome@@0PAV1 at 1@Z) already defined
in AutoTester.obj

AutoTester error LNK2005: "int __cdecl GARealBlendCrossover(class
GAGenome const &,class GAGenome const &,class GAGenome *,class GAGenome
*)"
(?GARealBlendCrossover@@YAHABVGAGenome@@0PAV1 at 1@Z) already defined in
AutoTester.obj

AutoTester error LNK2005: "int __cdecl GARealGaussianMutator(class
GAGenome &,float)" (?GARealGaussianMutator@@YAHAAVGAGenome@@M at Z) already
defined in AutoTester.obj

AutoTester error LNK2005: "public: __thiscall
GA1DArrayAlleleGenome<float>::GA1DArrayAlleleGenome<float>(class
GAAlleleSetArray<float> const &,float (__cdecl*)(class GAGenome &),void
*)"
(??0?$GA1DArrayAlleleGenome at M@@QAE at ABV?$GAAlleleSetArray at M@@P6AMAAVGAGen
ome@
@@ZPAX at Z) already defined in AutoTester.obj

AutoTester error LNK2005: "public: __thiscall
GA1DArrayAlleleGenome<float>::GA1DArrayAlleleGenome<float>(unsigned
int,class GAAlleleSet<float> const &,float (__cdecl*)(class GAGenome
&),void *)"
(??0?$GA1DArrayAlleleGenome at M@@QAE at IABV?$GAAlleleSet at M@@P6AMAAVGAGenome@
@@ZP
AX at Z) already defined in AutoTester.obj

AutoTester error LNK2005: "public: float __thiscall
GAAlleleSet<float>::allele(unsigned int)const "
(?allele@?$GAAlleleSet at M@@QBEMI at Z) already defined in AutoTester.obj

AutoTester error LNK2005: "public: float __thiscall
GAAlleleSet<float>::allele(void)const "
(?allele@?$GAAlleleSet at M@@QBEMXZ) already defined in AutoTester.obj

AutoTester error LNK2005: "public: virtual __thiscall
GA1DArrayAlleleGenome<float>::~GA1DArrayAlleleGenome<float>(void)"
(??1?$GA1DArrayAlleleGenome at M@@UAE at XZ) already defined in AutoTester.obj

AutoTester error LNK2005: "public: virtual char const * __thiscall
GA1DArrayAlleleGenome<float>::className(void)const "
(?className@?$GA1DArrayAlleleGenome at M@@UBEPBDXZ) already defined in
AutoTester.obj

AutoTester error LNK2005: "public: virtual int __thiscall
GA1DArrayAlleleGenome<float>::classID(void)const "
(?classID@?$GA1DArrayAlleleGenome at M@@UBEHXZ) already defined in
AutoTester.obj

AutoTester error LNK2005: "public: virtual int __thiscall
GA1DArrayAlleleGenome<float>::read(class std::basic_istream<char,struct
std::char_traits<char> > &)"
(?read@?$GA1DArrayAlleleGenome at M@@UAEHAAV?$basic_istream at DU?$char_traits
@D at s
td@@@std@@@Z) already defined in AutoTester.obj

AutoTester fatal error LNK1169: one or more multiply defined symbols
found

 

I have also tried leaving the .c files as .c files, setting the Project
and File options to /TP, and including the folder that contains the ./ga
folder in the Projects VC++ Directories (so I don't have to change

<ga/whatever.c> to "whatever.cpp". In this case I still get the above
errors.

 

What am I missing? If there is anyone out there using MS Vis Studio and
can help please let me know.

 

Thanks for your time,

Mike Cooling

PhD Student

Bioengineering Institute

University of Auckland

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://mailman.mit.edu/pipermail/galib/attachments/20060426/1da70c79/att
achment.htm

------------------------------

_______________________________________________
galib mailing list
galib at mit.edu
http://mailman.mit.edu/mailman/listinfo/galib


End of galib Digest, Vol 34, Issue 2
************************************




More information about the galib mailing list