U++ Forum - RDF feed
https://www.ultimatepp.org/forums/
MySQL link error
https://www.ultimatepp.org/forums/index.php?t=rview&goto=28286&th=5457#msg_28286
I very new in U++, but it seem to be the best IDE for me.
But I can't go ahead with mysql, because the linker gives me error: LNK2019.
I've setted the mysql lbraries, take it to PATH and many things. Googled many hours and search within this forum but i've stucked...
]]>kagzer2010-08-26T09:26:40-00:00Re: MySQL link error
https://www.ultimatepp.org/forums/index.php?t=rview&goto=28289&th=5457#msg_28289
Could you post entire output of the linker not only LNK2019?
Andrei]]>andrei_natanael2010-08-26T11:04:52-00:00Re: MySQL link error
https://www.ultimatepp.org/forums/index.php?t=rview&goto=28290&th=5457#msg_28290
----- plugin/z ( MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (2 / 3)
----- mysqlconsapp ( MAIN MSC9 DEBUG DEBUG_FULL BLITZ WIN32 MSC ) (3 / 3)
Linking...
mysqlconsapp.obj : error LNK2019: unresolved external symbol "public: bool __thiscall Upp::MySqlSession::Connect(char const *,char const *,char const *,char const *,int,char const *)" (?Connect@MySqlSession@Upp" target="_blank">>@Upp@@QAE_NPBD000H0@Z) referenced in function "void __cdecl ConsoleMainFn_(void)" (?ConsoleMainFn_@@YAX
XZ)
mysqlconsapp.obj : error LNK2019: unresolved external symbol "public: virtual __thiscall Upp::SqlSession::~SqlSession(void)" (??1SqlSession@Upp@@UAE@XZ" target="_blank">>@XZ) referenced in function __unwindfunclet$??0MySqlSession@Upp@@QAE@XZ" target="_blank">>@XZ$0
mysqlconsapp.obj : error LNK2019: unresolved external symbol "public: __thiscall Upp::SqlSession::SqlSession(void)" (??0SqlSession@Upp@@QAE@XZ" target="_blank">>@XZ) referenced in function "public: __thiscall Upp::MySqlSession::MySqlSession(void)" (??0MySqlSession@Upp@@QAE@XZ" target="_blank">>@XZ)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "protected: virtual class Upp::SqlConnection * __thiscall Upp::MySqlSession::CreateConnection(void)" (?CreateConnection@MySqlSession@Upp" target="_blank">>@Upp@@MAEPAVSqlConnection@2" target="_blank">>@2@XZ" target="_blank">>@XZ)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Upp::MySqlSession::Begin(void)" (?Begin@MySqlSession@Upp" target="_blank">>@Upp@@UAEXXZ)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Upp::MySqlSession::Commit(void)" (?Commit@MySqlSession@Upp" target="_blank">>@Upp@@UAEXXZ)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Upp::MySqlSession::Rollback(void)" (?Rollback@MySqlSession@Upp" target="_blank">>@Upp@@UAEXXZ)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall Upp::SqlSession::GetTransactionLevel(void)const " (?GetTransactionLevel@SqlSession@Upp" target="_blank">>@Upp@@UBEHXZ)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "public: virtual class Upp::String __thiscall Upp::SqlSession::Savepoint(void)" (?Savepoint@SqlSession@Upp" target="_blank">>@Upp@@UAE?AVString@2@XZ" target="_blank">>@XZ)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "public: virtual void __thiscall Upp::SqlSession::RollbackTo(class Upp::String const &)" (?RollbackTo@SqlSession@Upp" target="_blank">>@Upp@@UAEXABVString@2" target="_blank">>@2@@Z)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "public: virtual bool __thiscall Upp::MySqlSession::IsOpen(void)const " (?IsOpen@MySqlSession@Upp" target="_blank">>@Upp@@UBE_NXZ)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "public: virtual class Upp::Vector<class Upp::String> __thiscall Upp::MySqlSession::EnumUsers(void)" (?EnumUsers@MySqlSession@Upp" target="_blank">>@Upp@@UAE?AV?$Vector@VString@Upp" target="_blank">>@Upp@@@2@XZ" target="_blank">>@XZ)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "public: virtual class Upp::Vector<class Upp::String> __thiscall Upp::MySqlSession::EnumDatabases(void)" (?EnumDatabases@MySqlSession@Upp" target="_blank">>@Upp@@UAE?AV?$Vector@VString@Upp" target="_blank">>@Upp@@@2@XZ" target="_blank">>@XZ)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "public: virtual class Upp::Vector<class Upp::String> __thiscall Upp::MySqlSession::EnumTables(class Upp::String)" (?EnumTables@MySqlSession@Upp" target="_blank">>@Upp@@UAE?AV?$Vector@VString@Upp" target="_blank">>@Upp@@@2@VString" target="_blank">>@VString@2" target="_blank">>@2@@Z)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "public: virtual class Upp::Vector<class Upp::String> __thiscall Upp::SqlSession::EnumViews(class Upp::String)" (?EnumViews@SqlSession@Upp" target="_blank">>@Upp@@UAE?AV?$Vector@VString@Upp" target="_blank">>@Upp@@@2@VString" target="_blank">>@VString@2" target="_blank">>@2@@Z)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "public: virtual class Upp::Vector<class Upp::String> __thiscall Upp::SqlSession::EnumSequences(class Upp::String)" (?EnumSequences@SqlSession@Upp" target="_blank">>@Upp@@UAE?AV?$Vector@VString@Upp" target="_blank">>@Upp@@@2@VString" target="_blank">>@VString@2" target="_blank">>@2@@Z)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "public: virtual class Upp::Vector<struct Upp::SqlColumnInfo> __thiscall Upp::SqlSession::EnumColumns(class Upp::String,class Upp::String)" (?EnumColumns@SqlSession@Upp" target="_blank">>@Upp@@UAE?AV?$Vector@USqlColumnInfo@Upp" target="_blank">>@Upp@@@2@VString" target="_blank">>@VString@2" target="_blank">>@2@0" target="_blank">>@0@Z" target="_blank">>@Z)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "public: virtual class Upp::Vector<class Upp::String> __thiscall Upp::SqlSession::EnumPrimaryKey(class Upp::String,class Upp::String)" (?EnumPrimaryKey@SqlSession@Upp" target="_blank">>@Upp@@UAE?AV?$Vector@VString@Upp" target="_blank">>@Upp@@@2@VString" target="_blank">>@VString@2" target="_blank">>@2@0" target="_blank">>@0@Z" target="_blank">>@Z)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "public: virtual class Upp::String __thiscall Upp::SqlSession::EnumRowID(class Upp::String,class Upp::String)" (?EnumRowID@SqlSession@Upp" target="_blank">>@Upp@@UAE?AVString@2@V32" target="_blank">>@V32@0" target="_blank">>@0@Z" target="_blank">>@Z)
mysqlconsapp.obj : error LNK2001: unresolved external symbol "public: virtual class Upp::Vector<class Upp::String> __thiscall Upp::SqlSession::EnumReservedWords(void)" (?EnumReservedWords@SqlSession@Upp" target="_blank">>@Upp@@UAE?AV?$Vector@VString@Upp" target="_blank">>@Upp@@@2@XZ" target="_blank">>@XZ)
mysqlconsapp.obj : error LNK2019: unresolved external symbol "bool __cdecl Upp::MySqlPerformScript(class Upp::String const &,struct Upp::StatementExecutor &,class Upp::Gate2<int,int>)" (?MySqlPerformScript@Upp@@YA_NABVString@1@AAUStatementExecutor" target="_blank">>@AAUStatementExecutor@1" target="_blank">>@1@V" target="_blank">>@V?$Gate2@HH@1" target="_blank">>@1@@Z) referenced in function "public: virtual b
ool (__cdecl*__thiscall Upp::MySqlSession::GetRunScript(void)const )(class Upp::String const &,struct Upp::StatementExecutor &,class Upp::Gate2<int,int>)" (?GetRunScript@MySqlSession@Upp" target="_blank">>@Upp@@UBEP6A_NABVString@2@AAUStatementExecutor" target="_blank">>@AAUStatementExecutor@2" target="_blank">>@2@V" target="_blank">>@V?$Gate2@HH@2" target="_blank">>@2@@ZXZ)
mysqlconsapp.obj : error LNK2019: unresolved external symbol "public: void __thiscall Upp::MySqlSession::Close(void)" (?Close@MySqlSession@Upp" target="_blank">>@Upp@@QAEXXZ) referenced in function "public: virtual __thiscall Upp::MySqlSession::~MySqlSession(void)" (??1MySqlSession@Upp@@UAE@XZ" target="_blank">>@XZ)
C:\upp\out\MSC9.Debug.Debug_full\mysqlconsapp.exe : fatal error LNK1120: 22 unresolved externals
There were errors. (0:06.04)
]]>kagzer2010-08-26T12:15:28-00:00Re: MySQL link error
https://www.ultimatepp.org/forums/index.php?t=rview&goto=28291&th=5457#msg_28291
You need to get used to the whole package idiom. Try to figure out what your project is made out of. So if you only have you code and the basics, you need to add a package that allows for Sql. This package is called Sql. You probably need the MySql package instead because you are using mysql.
PS: The fact that you can compile fine, but fail at linking is an unfortunate consequence of the way include paths work and you can include any file, even if you are not using the package if it is in the right location on disk.]]>cbpporter2010-08-26T12:46:29-00:00Re: MySQL link error
https://www.ultimatepp.org/forums/index.php?t=rview&goto=28292&th=5457#msg_28292
#include <Core/Core.h>
#include <MySql/MySql.h>
using namespace Upp;
CONSOLE_APP_MAIN
{
int charSet = GetDefaultCharset() ;
Cout() << "charset:" <<CharsetName( charSet ) << "\n" ;
String s = "SELECT * FROM assyc;" ;
MySqlSession sesion ;
if (sesion.Connect( "username", "password", "database","hostip" ))
{
//
}
}
]]>kagzer2010-08-26T13:54:32-00:00Re: MySQL link error
https://www.ultimatepp.org/forums/index.php?t=rview&goto=28293&th=5457#msg_28293
cbpporter2010-08-26T14:14:21-00:00Re: MySQL link error
https://www.ultimatepp.org/forums/index.php?t=rview&goto=28294&th=5457#msg_28294
It works!
Thank You very much!!!]]>kagzer2010-08-26T14:30:51-00:00Re: MySQL link error
https://www.ultimatepp.org/forums/index.php?t=rview&goto=28863&th=5457#msg_28863
Experimentating on MySQL application, I have this link problem.
Thank you very much]]>ratah2010-09-20T12:37:28-00:00Re: MySQL link error
https://www.ultimatepp.org/forums/index.php?t=rview&goto=51305&th=5457#msg_51305
I have the same problem :
D:/Donnees/PBE-Pgm/TDM-GCC-64/bin/../lib/gcc/x86_64-w64-mingw32/5.1.0/../../../../x86_64-w64-mingw32/bin/ld.exe: cannot find -lmysql
collect2.exe: error: ld returned 1 exit status