views:

211

answers:

2

I've been trying to write a small application which will work with mysql in C++. I am using MySQL server 5.1.41 and MySQL C++ connector 1.0.5. Everything compiles fine when i write console applications, but when i try to compile windows forms application exactly the same way (same libraries, same paths, same project properties) i get this errors:

Error   1   error LNK2001: unresolved external symbol "public: virtual int __clrcall sql::mysql::MySQL_Savepoint::getSavepointId(void)" (?getSavepointId@MySQL_Savepoint@mysql@sql@@$$FUAMHXZ)  test1.obj   test1
Error   2   error LNK2001: unresolved external symbol "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __clrcall sql::mysql::MySQL_Savepoint::getSavepointName(void)" (?getSavepointName@MySQL_Savepoint@mysql@sql@@$$FUAM?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ)   test1.obj   test1

following instructions from here, i've got this:

Undecoration of :- "?getSavepointId@MySQL_Savepoint@mysql@sql@@UEAAHXZ"
is :- "public: virtual int __cdecl sql::mysql::MySQL_Savepoint::getSavepointId(void) __ptr64"

Undecoration of :- "?getSavepointName@MySQL_Savepoint@mysql@sql@@UEAA?AV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@XZ"
is :- "public: virtual class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> > __cdecl sql::mysql::MySQL_Savepoint::getSavepointName(void) __ptr64"

but what should i do now?

A: 

Looks like an issue with calling conventions. I am not very familiar with managed C++, but this might help you.

Luke
A: 

Project + Properties, General, change Common Language Runtime support to /clr from /clr:pure

gohary
Thank you very much, i've waited so long
Blin