List:MySQL++« Previous MessageNext Message »
From:Martin Dommermuth Date:August 3 2007 10:53am
Subject:Linker error in VC7 with mysql++ and std::string
View as plain text  
Hi there, 

I am loosing it! 

I want to write a quite simple app reading data from a special source and
dumping it
into a MySQL DB. 
I got mysql++-2.3.2 and mysql-5.0.45 on Windows XP installed on F:\ (this
seems to make 
problems in some cases)

First I get 2 warnings:
exceptions.h(44) : warning C4275: non dll-interface class 'exception' used
as base 
			 for dll-interface class 'mysqlpp::Exception'
        
const_string.h(89) : warning C4267: 'initializing' : conversion from
'size_t' to 
			   'mysqlpp::const_string::size_type', possible loss
of data
query.h(129) :  warning C4275: non dll-interface class 'std::ios_base' used
as base
                for dll-interface class 'std::basic_ios<_Elem,_Traits>'
        with
        [
            _Elem=char,
            _Traits=std::char_traits<char>
        ]
        xiosbase(181) : see declaration of 'std::ios_base'

Is this a problem? Some sources on the net say, that VC is a bit
hypersensitive 
here. 

My real problem is that as soon as I link against mysql++ and use a
std::string 
I get this linker error:

DB.obj : error LNK2019: unresolved external symbol "__declspec(dllimport)
public: __thiscall 
	std::basic_string<char,struct std::char_traits<char>,
	class std::allocator<char> >::~basic_string<char,struct
std::char_traits<char>,
	class std::allocator<char> >
	(void)"
(__imp_??1?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@QAE@X
Z)
	referenced in function "public: void __thiscall
DB::addReadout(double,double,int,int,int)"
	(?addReadout@DB@@QAEXNNHHH@Z)
[...]
Debug/ubisenseprovider.exe : fatal error LNK1120: 2 unresolved externals

Do I have to tell VC to link against a special lib for std::string? Why does
this work when 
I don't use mysql++? 
And could anyone enlighten me on the "__declspec(dllimport)" stuff? 

Thanks for any tips, I am really becoming desperate here.

Martin


Thread
Linker error in VC7 with mysql++ and std::stringMartin Dommermuth3 Aug
  • Re: Linker error in VC7 with mysql++ and std::stringWarren Young3 Aug
    • RE: Linker error in VC7 with mysql++ and std::string - solvedMartin Dommermuth14 Aug