List:MySQL++« Previous MessageNext Message »
From:Bassam A. Al-Khaffaf Date:February 8 2007 9:44am
Subject:Link problem when create SSQLS
View as plain text  
Dear All,

   Using win32 C++ using Visual C++ 2005 express edition, MySQL 5.1 and
MySQL++-2.2.0 on Windows xp pro to develop a network application.

 

The application that I am writing uses many SSQLS that are stored in a
separate header file “Structures.h” that contains all the definitions and
user defined structures. This file is included in almost all the other
header files and the main function file as well.

 

However, I am facing a linking problem with error LNK2005 which means an
already defined identifier whenever I create an SSQLS although I am limiting
the redefinitions by using the following preprocessors

 

#ifndef STRUCTURES_H

#define STRUCTURES_H

 

//some definitions and user defined structs are here

 

sql_create_5(_ATTRIBUTES_LIST, 2, 0,

                  sql_smallint_unsigned, attribute_id,

                  sql_smallint_unsigned, vendor_id,

                  sql_varchar, vendor_name,

                  sql_varchar, attribute_name,

                  sql_smallint_unsigned, type_id);

 

sql_create_2(_VENDORS_LIST, 1, 0,

                   sql_smallint_unsigned, vendor_id,

                   sql_varchar, vendor_name);

#endif

 

I used to bypass these errors by using the command line “/FORCE:MULTIPLE”
in order to allow mutiple definitions of the same identifier.

 

The errors that I am getting are:

 

"public: static char const * * _ATTRIBUTES_LIST::names"
(?names@_ATTRIBUTES_LIST@@2PAPBDA) already defined in Configurations.obj

IncomingRadiusFrame.obj : error LNK2005: "public: static char const * const
_ATTRIBUTES_LIST::_table" (?_table@_ATTRIBUTES_LIST@@2PBDB) already defined
in Configurations.obj

IncomingRadiusFrame.obj : error LNK2005: "public: static char const * *
_VENDORS_LIST::names" (?names@_VENDORS_LIST@@2PAPBDA) already defined in
Configurations.obj

IncomingRadiusFrame.obj : error LNK2005: "public: static char const * const
_VENDORS_LIST::_table" (?_table@_VENDORS_LIST@@2PBDB) already defined in
Configurations.obj

Logs.obj : error LNK2005: "public: static char const * *
_ATTRIBUTES_LIST::names" (?names@_ATTRIBUTES_LIST@@2PAPBDA) already defined
in Configurations.obj

Logs.obj : error LNK2005: "public: static char const * const
_ATTRIBUTES_LIST::_table" (?_table@_ATTRIBUTES_LIST@@2PBDB) already defined
in Configurations.obj

Logs.obj : error LNK2005: "public: static char const * *
_VENDORS_LIST::names" (?names@_VENDORS_LIST@@2PAPBDA) already defined in
Configurations.obj

Logs.obj : error LNK2005: "public: static char const * const
_VENDORS_LIST::_table" (?_table@_VENDORS_LIST@@2PBDB) already defined in
Configurations.obj

OutgoingRadiusFrame.obj : error LNK2005: "public: static char const * *
_ATTRIBUTES_LIST::names" (?names@_ATTRIBUTES_LIST@@2PAPBDA) already defined
in Configurations.obj

OutgoingRadiusFrame.obj : error LNK2005: "public: static char const * const
_ATTRIBUTES_LIST::_table" (?_table@_ATTRIBUTES_LIST@@2PBDB) already defined
in Configurations.obj

OutgoingRadiusFrame.obj : error LNK2005: "public: static char const * *
_VENDORS_LIST::names" (?names@_VENDORS_LIST@@2PAPBDA) already defined in
Configurations.obj

OutgoingRadiusFrame.obj : error LNK2005: "public: static char const * const
_VENDORS_LIST::_table" (?_table@_VENDORS_LIST@@2PBDB) already defined in
Configurations.obj

Radius.obj : error LNK2005: "public: static char const * *
_ATTRIBUTES_LIST::names" (?names@_ATTRIBUTES_LIST@@2PAPBDA) already defined
in Configurations.obj

Radius.obj : error LNK2005: "public: static char const * const
_ATTRIBUTES_LIST::_table" (?_table@_ATTRIBUTES_LIST@@2PBDB) already defined
in Configurations.obj

Radius.obj : error LNK2005: "public: static char const * *
_VENDORS_LIST::names" (?names@_VENDORS_LIST@@2PAPBDA) already defined in
Configurations.obj

Radius.obj : error LNK2005: "public: static char const * const
_VENDORS_LIST::_table" (?_table@_VENDORS_LIST@@2PBDB) already defined in
Configurations.obj

RadiusFrame.obj : error LNK2005: "public: static char const * *
_ATTRIBUTES_LIST::names" (?names@_ATTRIBUTES_LIST@@2PAPBDA) already defined
in Configurations.obj

RadiusFrame.obj : error LNK2005: "public: static char const * const
_ATTRIBUTES_LIST::_table" (?_table@_ATTRIBUTES_LIST@@2PBDB) already defined
in Configurations.obj

RadiusFrame.obj : error LNK2005: "public: static char const * *
_VENDORS_LIST::names" (?names@_VENDORS_LIST@@2PAPBDA) already defined in
Configurations.obj

RadiusFrame.obj : error LNK2005: "public: static char const * const
_VENDORS_LIST::_table" (?_table@_VENDORS_LIST@@2PBDB) already defined in
Configurations.obj

RadiusPacketValidations.obj : error LNK2005: "public: static char const * *
_ATTRIBUTES_LIST::names" (?names@_ATTRIBUTES_LIST@@2PAPBDA) already defined
in Configurations.obj

RadiusPacketValidations.obj : error LNK2005: "public: static char const *
const _ATTRIBUTES_LIST::_table" (?_table@_ATTRIBUTES_LIST@@2PBDB) already
defined in Configurations.obj

RadiusPacketValidations.obj : error LNK2005: "public: static char const * *
_VENDORS_LIST::names" (?names@_VENDORS_LIST@@2PAPBDA) already defined in
Configurations.obj

RadiusPacketValidations.obj : error LNK2005: "public: static char const *
const _VENDORS_LIST::_table" (?_table@_VENDORS_LIST@@2PBDB) already defined
in Configurations.obj

E:\RADIUS Project\Radius 5.0.0\Debug\Radius.exe : fatal error LNK1169: one
or more multiply defined symbols found

 

 

 

 

I wonder how you can help me to solve this issue

 

Your help is much appreciated

 

Regards

Bassam

 

 

 

 


-- 
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.5.432 / Virus Database: 268.17.29/673 - Release Date: 2/6/2007
5:52 PM
 

Thread
Link problem when create SSQLSBassam A. Al-Khaffaf8 Feb
  • Re: Link problem when create SSQLSJonathan Wakely8 Feb
    • RE: Link problem when create SSQLSMatt Dargavel8 Feb
      • RE: Link problem when create SSQLSBassam A. Al-Khaffaf8 Feb