<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[MySQL in C++ - nicht aufgelöste Symbole]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich versuche mit C++ auf meinen MySQL Server zuzugreifen - bislang erfolglos.<br />
nachdem ich alle anderen Probleme beseitigen konnte hakt es nun am Linker mit 4 nichtaufgelösten Symbolen. Ich bin auch schon fleißig am verzweifeln... ich habe die Lib - ordner und die include ordner ordnungsgemäß eingebunden - denke ich zumindest.</p>
<p>ich verwende C++ in Visual Studio 2013 und den MySQL Server 5.6.17. Der C++ Connector ist installiert (obwohl mir nicht ganz klar ist wozu, da alle Headerfiles im Server selbst mit drin ist) die dll's libmysql.dll und mysqlcppconn.dll habe ich in mein Debug Ordner kopiert.</p>
<p>vielen Dank für Hilfe</p>
<p>(Ich habe auch hier im Forum ähnliche probleme und Lösungen gefunden, jedoch lösen die alle nicht mein Problem)</p>
<p>Enrico<br />
[code&quot;c++&quot;]<br />
#include &lt;iostream&gt;<br />
#include &lt;my_global.h&gt;<br />
#include &lt;mysql.h&gt;<br />
#pragma comment(lib,&quot;mysqlcppconn.lib&quot;)<br />
#pragma comment(lib,&quot;libmysql.lib&quot;)</p>
<p>using namespace std;</p>
<p>int main() {<br />
MYSQL_RES *mTabelle;<br />
MYSQL_ROW mRecord;<br />
MYSQL *mConnection, mDB;<br />
int mError;<br />
mysql_init(&amp;mDB);<br />
mConnection =<br />
mysql_real_connect(&amp;mDB, &quot;localhost&quot;, &quot;root&quot;, &quot;&quot;, &quot;test&quot;, 0, 0, 0);<br />
if (mConnection == NULL) {<br />
printf(&quot;Es konnte keine Verbindung zur Datenbank hergestellt werden: %s&quot;, mysql_error(&amp;mDB));<br />
return 1;<br />
} else {<br />
printf(&quot;Es wurde erfolgreich eine Verbindung hergestellt!&quot;);<br />
}<br />
mysql_close(mConnection);<br />
return 0;<br />
}<br />
[/code]<br />
und noch das Build Protokoll:</p>
<p>Der Buildvorgang wurde am 05.05.2014 11:55:01 gestartet.<br />
1&gt;Projekt &quot;c:\Users\...\documents\visual studio 2013\Projects\mySQL test\mySQL test\mySQL test.vcxproj&quot; auf Knoten &quot;2&quot;, Build Ziel(e).<br />
1&gt;ClCompile:<br />
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /I&quot;C:\Program Files\MySQL\MySQL Server 5.6\include&quot; /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _LIB /D CPPCONN_PUBLIC_FUNC= /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo&quot;Debug\&quot; /Fd&quot;Debug\vc120.pdb&quot; /Gd /TP /analyze- /errorReport:prompt main.cpp<br />
main.cpp<br />
1&gt;c:\users\...\documents\visual studio 2013\projects\mysql test\mysql test\main.cpp(15): warning C4101: 'mRecord': Unreferenzierte lokale Variable<br />
1&gt;c:\users\...\documents\visual studio 2013\projects\mysql test\mysql test\main.cpp(17): warning C4101: 'mError': Unreferenzierte lokale Variable<br />
1&gt;c:\users\...\documents\visual studio 2013\projects\mysql test\mysql test\main.cpp(14): warning C4101: 'mTabelle': Unreferenzierte lokale Variable<br />
Link:<br />
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:&quot;c:\users\...\documents\visual studio 2013\Projects\mySQL test\Debug\mySQL test.exe&quot; /INCREMENTAL /NOLOGO /LIBPATH:&quot;C:\Program Files\MySQL\MySQL Server 5.6\lib&quot; /LIBPATH:&quot;C:\Program Files\MySQL\Connector C++ 1.1.3\lib\opt&quot; &quot;mysqlcppconn-static.lib&quot; libmysql.lib mysqlcppconn.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:&quot;level='asInvoker' uiAccess='false'&quot; /manifest:embed /DEBUG /PDB:&quot;c:\users\...\documents\visual studio 2013\Projects\mySQL test\Debug\mySQL test.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:&quot;c:\users\..\documents\visual studio 2013\Projects\mySQL test\Debug\mySQL test.lib&quot; /MACHINE:X86 Debug\main.obj<br />
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;_mysql_error@4&quot; in Funktion &quot;_main&quot;.<br />
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;_mysql_init@4&quot; in Funktion &quot;_main&quot;.<br />
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;_mysql_real_connect@32&quot; in Funktion &quot;_main&quot;.<br />
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;_mysql_close@4&quot; in Funktion &quot;_main&quot;.<br />
1&gt;c:\users\...\documents\visual studio 2013\Projects\mySQL test\Debug\mySQL test.exe : fatal error LNK1120: 4 nicht aufgelöste Externe<br />
1&gt;Die Erstellung des Projekts &quot;c:\Users\...\documents\visual studio 2013\Projects\mySQL test\mySQL test\mySQL test.vcxproj&quot; ist abgeschlossen, Build Ziel(e) -- FEHLER.</p>
<p>Fehler beim Buildvorgang.</p>
<p>Verstrichene Zeit 00:00:00.93</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/325486/mysql-in-c-nicht-aufgelöste-symbole</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 14:23:19 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/325486.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 05 May 2014 10:20:49 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to MySQL in C++ - nicht aufgelöste Symbole on Mon, 05 May 2014 10:20:49 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich versuche mit C++ auf meinen MySQL Server zuzugreifen - bislang erfolglos.<br />
nachdem ich alle anderen Probleme beseitigen konnte hakt es nun am Linker mit 4 nichtaufgelösten Symbolen. Ich bin auch schon fleißig am verzweifeln... ich habe die Lib - ordner und die include ordner ordnungsgemäß eingebunden - denke ich zumindest.</p>
<p>ich verwende C++ in Visual Studio 2013 und den MySQL Server 5.6.17. Der C++ Connector ist installiert (obwohl mir nicht ganz klar ist wozu, da alle Headerfiles im Server selbst mit drin ist) die dll's libmysql.dll und mysqlcppconn.dll habe ich in mein Debug Ordner kopiert.</p>
<p>vielen Dank für Hilfe</p>
<p>(Ich habe auch hier im Forum ähnliche probleme und Lösungen gefunden, jedoch lösen die alle nicht mein Problem)</p>
<p>Enrico<br />
[code&quot;c++&quot;]<br />
#include &lt;iostream&gt;<br />
#include &lt;my_global.h&gt;<br />
#include &lt;mysql.h&gt;<br />
#pragma comment(lib,&quot;mysqlcppconn.lib&quot;)<br />
#pragma comment(lib,&quot;libmysql.lib&quot;)</p>
<p>using namespace std;</p>
<p>int main() {<br />
MYSQL_RES *mTabelle;<br />
MYSQL_ROW mRecord;<br />
MYSQL *mConnection, mDB;<br />
int mError;<br />
mysql_init(&amp;mDB);<br />
mConnection =<br />
mysql_real_connect(&amp;mDB, &quot;localhost&quot;, &quot;root&quot;, &quot;&quot;, &quot;test&quot;, 0, 0, 0);<br />
if (mConnection == NULL) {<br />
printf(&quot;Es konnte keine Verbindung zur Datenbank hergestellt werden: %s&quot;, mysql_error(&amp;mDB));<br />
return 1;<br />
} else {<br />
printf(&quot;Es wurde erfolgreich eine Verbindung hergestellt!&quot;);<br />
}<br />
mysql_close(mConnection);<br />
return 0;<br />
}<br />
[/code]<br />
und noch das Build Protokoll:</p>
<p>Der Buildvorgang wurde am 05.05.2014 11:55:01 gestartet.<br />
1&gt;Projekt &quot;c:\Users\...\documents\visual studio 2013\Projects\mySQL test\mySQL test\mySQL test.vcxproj&quot; auf Knoten &quot;2&quot;, Build Ziel(e).<br />
1&gt;ClCompile:<br />
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\CL.exe /c /I&quot;C:\Program Files\MySQL\MySQL Server 5.6\include&quot; /ZI /nologo /W3 /WX- /Od /Oy- /D WIN32 /D _DEBUG /D _CONSOLE /D _LIB /D CPPCONN_PUBLIC_FUNC= /D _UNICODE /D UNICODE /Gm /EHsc /RTC1 /MDd /GS /fp:precise /Zc:wchar_t /Zc:forScope /Fo&quot;Debug\&quot; /Fd&quot;Debug\vc120.pdb&quot; /Gd /TP /analyze- /errorReport:prompt main.cpp<br />
main.cpp<br />
1&gt;c:\users\...\documents\visual studio 2013\projects\mysql test\mysql test\main.cpp(15): warning C4101: 'mRecord': Unreferenzierte lokale Variable<br />
1&gt;c:\users\...\documents\visual studio 2013\projects\mysql test\mysql test\main.cpp(17): warning C4101: 'mError': Unreferenzierte lokale Variable<br />
1&gt;c:\users\...\documents\visual studio 2013\projects\mysql test\mysql test\main.cpp(14): warning C4101: 'mTabelle': Unreferenzierte lokale Variable<br />
Link:<br />
C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\link.exe /ERRORREPORT:PROMPT /OUT:&quot;c:\users\...\documents\visual studio 2013\Projects\mySQL test\Debug\mySQL test.exe&quot; /INCREMENTAL /NOLOGO /LIBPATH:&quot;C:\Program Files\MySQL\MySQL Server 5.6\lib&quot; /LIBPATH:&quot;C:\Program Files\MySQL\Connector C++ 1.1.3\lib\opt&quot; &quot;mysqlcppconn-static.lib&quot; libmysql.lib mysqlcppconn.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /MANIFEST /MANIFESTUAC:&quot;level='asInvoker' uiAccess='false'&quot; /manifest:embed /DEBUG /PDB:&quot;c:\users\...\documents\visual studio 2013\Projects\mySQL test\Debug\mySQL test.pdb&quot; /SUBSYSTEM:CONSOLE /TLBID:1 /DYNAMICBASE /NXCOMPAT /IMPLIB:&quot;c:\users\..\documents\visual studio 2013\Projects\mySQL test\Debug\mySQL test.lib&quot; /MACHINE:X86 Debug\main.obj<br />
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;_mysql_error@4&quot; in Funktion &quot;_main&quot;.<br />
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;_mysql_init@4&quot; in Funktion &quot;_main&quot;.<br />
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;_mysql_real_connect@32&quot; in Funktion &quot;_main&quot;.<br />
1&gt;main.obj : error LNK2019: Verweis auf nicht aufgelöstes externes Symbol &quot;_mysql_close@4&quot; in Funktion &quot;_main&quot;.<br />
1&gt;c:\users\...\documents\visual studio 2013\Projects\mySQL test\Debug\mySQL test.exe : fatal error LNK1120: 4 nicht aufgelöste Externe<br />
1&gt;Die Erstellung des Projekts &quot;c:\Users\...\documents\visual studio 2013\Projects\mySQL test\mySQL test\mySQL test.vcxproj&quot; ist abgeschlossen, Build Ziel(e) -- FEHLER.</p>
<p>Fehler beim Buildvorgang.</p>
<p>Verstrichene Zeit 00:00:00.93</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2397442</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2397442</guid><dc:creator><![CDATA[Pfeffi09]]></dc:creator><pubDate>Mon, 05 May 2014 10:20:49 GMT</pubDate></item><item><title><![CDATA[Reply to MySQL in C++ - nicht aufgelöste Symbole on Mon, 05 May 2014 10:37:38 GMT]]></title><description><![CDATA[<p>/MACHINE:X86 sagt 32 Bit, C:\Program Files\MySQL\MySQL Server 5.6\lib dürfte aber 64 Bit sein</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2397445</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2397445</guid><dc:creator><![CDATA[manni66]]></dc:creator><pubDate>Mon, 05 May 2014 10:37:38 GMT</pubDate></item><item><title><![CDATA[Reply to MySQL in C++ - nicht aufgelöste Symbole on Mon, 05 May 2014 11:01:57 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /><br />
... das ist ja unglaublich.....</p>
<p>Maschine auf 64bit geändert und es läuft....</p>
<p>Danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
<p>Enrico</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2397448</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2397448</guid><dc:creator><![CDATA[Pfeffi09]]></dc:creator><pubDate>Mon, 05 May 2014 11:01:57 GMT</pubDate></item></channel></rss>