<?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++ funktioniert nicht]]></title><description><![CDATA[<p>Hi,<br />
Da ich von meinem Programm aus auf die Mysql Datenbank zugreifen muss hab ich mir mysql++ besorgt.<br />
Hab auch alles nach der Readmy installiert dennoch kommen folgende Fehler:</p>
<blockquote>
<p>../boost/boost/asio/detail/old_win_sdk_compat.hpp:58: error: expected <code>;' before '.' token ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:188: error: expected unqualified-id before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:188: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:188: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:188: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:188: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:208: error: expected unqualified-id before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:208: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:208: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:208: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:208: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:228: error: expected unqualified-id before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:228: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:228: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:228: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:233: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:233: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:233: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:233: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:233: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:238: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:238: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:238: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:238: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:238: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:243: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:243: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:243: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:243: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:243: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:259: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:259: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:259: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:259: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:259: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:279: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:279: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:279: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:279: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:279: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:284: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:284: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:284: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:284: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:284: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:289: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:289: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:289: error: expected</code>)' before &quot;const&quot;</p>
</blockquote>
<p>An den Fehler erkennt man das es an Boost liegt nur was kann ich da ändern?<br />
Auf boost kann ich nicht mehr Verzichten weil ich die in meinem Programm an sehr vielen Stellen einseze!<br />
Zum erstellen der libs hab ich Mysql5 benutzt!</p>
<p>MFG ReduX</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/188580/mysql-funktioniert-nicht</link><generator>RSS for Node</generator><lastBuildDate>Fri, 25 Sep 2026 04:40:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/188580.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 01 Aug 2007 23:18:38 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Mysql++ funktioniert nicht on Wed, 01 Aug 2007 23:19:00 GMT]]></title><description><![CDATA[<p>Hi,<br />
Da ich von meinem Programm aus auf die Mysql Datenbank zugreifen muss hab ich mir mysql++ besorgt.<br />
Hab auch alles nach der Readmy installiert dennoch kommen folgende Fehler:</p>
<blockquote>
<p>../boost/boost/asio/detail/old_win_sdk_compat.hpp:58: error: expected <code>;' before '.' token ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:188: error: expected unqualified-id before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:188: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:188: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:188: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:188: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:208: error: expected unqualified-id before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:208: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:208: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:208: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:208: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:228: error: expected unqualified-id before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:228: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:228: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:228: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:233: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:233: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:233: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:233: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:233: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:238: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:238: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:238: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:238: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:238: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:243: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:243: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:243: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:243: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:243: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:259: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:259: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:259: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:259: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:259: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:279: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:279: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:279: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:279: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:279: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:284: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:284: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:284: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:284: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:284: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:289: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:289: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:289: error: expected</code>)' before &quot;const&quot;</p>
</blockquote>
<p>An den Fehler erkennt man das es an Boost liegt nur was kann ich da ändern?<br />
Auf boost kann ich nicht mehr Verzichten weil ich die in meinem Programm an sehr vielen Stellen einseze!<br />
Zum erstellen der libs hab ich Mysql5 benutzt!</p>
<p>MFG ReduX</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1336960</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1336960</guid><dc:creator><![CDATA[ReduX]]></dc:creator><pubDate>Wed, 01 Aug 2007 23:19:00 GMT</pubDate></item><item><title><![CDATA[Reply to Mysql++ funktioniert nicht on Thu, 02 Aug 2007 05:02:50 GMT]]></title><description><![CDATA[<p>Öhm, also die Annahme, dass Boost &quot;Schuld&quot; ist liegt zwar nahe. Aber bist du dir sicher, dass du nicht irgendwo nen Fehler gemacht hast, bevor du was von boost eingebunden hast? Könnte ein vergessenes &quot;;&quot; hinter einer Klassendefinition oder so sein.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1336982</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1336982</guid><dc:creator><![CDATA[Maffe001]]></dc:creator><pubDate>Thu, 02 Aug 2007 05:02:50 GMT</pubDate></item><item><title><![CDATA[Reply to Mysql++ funktioniert nicht on Thu, 02 Aug 2007 05:48:04 GMT]]></title><description><![CDATA[<p>Hi,<br />
Ich weiß nicht was grad los ist aber irgendwie funktioniert das prog auch nichtmehr wenn ich das mysql++ Zeug rausmachen.<br />
Code:</p>
<pre><code class="language-cpp">#include &lt;iostream.h&gt;
#include &lt;util.h&gt;
#include &lt;mysql++.h&gt;
#include &lt;iomanip&gt;
#include &lt;string&gt;
#include &lt;stdio.h&gt;
#include &lt;ctime&gt;
#include &lt;boost/thread/thread.hpp&gt;
#include &lt;boost/thread/mutex.hpp&gt;
#include &lt;boost/bind.hpp&gt;
#include &lt;boost/asio.hpp&gt;
#include &lt;boost/date_time/posix_time/posix_time.hpp&gt;
#if defined(WIN32) || defined(__WIN32__)
#include &lt;winsock2.h&gt;
#else
#include &lt;sys/types.h&gt;
#include &lt;sys/socket.h&gt;
#include &lt;netinet/in.h&gt;
#include &lt;arpa/inet.h&gt;
#include &lt;netdb.h&gt;
#endif
#define MAX_CLIENTS 1500
using namespace std;
boost::mutex io_guard;
boost::asio::io_service io;
long rc;
  SOCKET acceptSocket;
  SOCKADDR_IN addr;
  char buf[320];
  int auth[MAX_CLIENTS];
  int chan[MAX_CLIENTS];
  int admin[MAX_CLIENTS];
  string nick[MAX_CLIENTS];
  int userid[MAX_CLIENTS];
  FD_SET fdSet;
  SOCKET clients[MAX_CLIENTS];
  int i;

void splitstring(string str, string seperater, string &amp;first, string &amp;second)
{
     int i = (int)str.find(seperater);
     if(i != -1)
     {
          int y = 0;
          if(!str.empty())
          {
               while(y != i)
               {
                    first += str[y++];
               }
               y = y+(int)seperater.length();
               while(y != str.length())
               {
                    second += str[y++];
               }

          }
     }
     else
     {
          first = str;
          second = &quot;NULL&quot;;
     }
}

string make_daytime_string()
{
  time_t now = time(0);
  return ctime(&amp;now);
}

int detect(int user,int t, string angabe)
{
if(auth[i] == 1)
{
    string a;
    string b;
 splitstring(angabe,&quot;!%!%!%!&quot;,a,b);
if(a == &quot;1&quot;)
{
splitstring(b,&quot;!%!%!%!&quot;,b,a);
const char* c = b.c_str();
for(i=0;i&lt;MAX_CLIENTS;i++)
{
if(clients[i]!=0 || clients[i]!=INVALID_SOCKET)
{
if(chan[i] == chan[t]) {
send(userid[i],c,sizeof(c),0);
}
}
}
} else if (a == &quot;2&quot;) {

} else if (a == &quot;3&quot;) {

} else if(a == &quot;4&quot;) {

} else if(a == &quot;5&quot;) {

}
}
}

int channel(void)
{
    for(;;) {
boost::asio::deadline_timer t(io, boost::posix_time::seconds(10));
t.wait();
for(i=0;i&lt;MAX_CLIENTS;i++)
{
if(clients[i]!=0 || clients[i]!=INVALID_SOCKET)
{
   char* angabe = &quot;hallo&quot;;
send(userid[i],angabe,(int)strlen(angabe),0);
}
}
}
}

int user(void)
{
    for(;;) {
boost::asio::deadline_timer t(io, boost::posix_time::seconds(10));
t.wait();
for(i=0;i&lt;MAX_CLIENTS;i++)
{
if(clients[i]!=0 || clients[i]!=INVALID_SOCKET)
{
    char* angabe = &quot;hallo2&quot;;
send(userid[i],angabe,(int)strlen(angabe),0);
}
}
}
}

int userdel(int i)
{
    chan[i]=0;
    auth[i]=0;
    admin[i]=0;
    nick[i]=&quot;0&quot;;
    userid[i]=0;
    clients[i]=INVALID_SOCKET;
}

int usernew(int user,int i)
{
while(clients[i] != INVALID_SOCKET) {
if(FD_ISSET(clients[i],&amp;fdSet))
{
rc=recv(user,buf,320,0);
if(rc==0 || rc==SOCKET_ERROR)
{
boost::thread reaktion( boost::bind(&amp;userdel,i));
closesocket(user);
} else {
string a,b,username,password;
splitstring(buf,&quot;!%!%!%!&quot;,a,b);
if(a == &quot;0&quot;)
{
splitstring(b,&quot;!%!%!%!&quot;,username,b);
splitstring(b,&quot;!%!%!%!&quot;,password,b);
userid[i] = user;
auth[i] = 1;
chan[i] = 0;
cout &lt;&lt; &quot;User engelegt&quot; &lt;&lt; endl;
}
}
}
}
}

int startWinsock(void)
{
  WSADATA wsa;
  return WSAStartup(MAKEWORD(2,0),&amp;wsa);
}

int main()
{
rc=startWinsock();
acceptSocket=socket(AF_INET,SOCK_STREAM,0);
  memset(&amp;addr,0,sizeof(SOCKADDR_IN));
  addr.sin_family=AF_INET;
  addr.sin_port=htons(8015);
  addr.sin_addr.s_addr=INADDR_ANY;
  rc=bind(acceptSocket,(SOCKADDR*)&amp;addr,sizeof(SOCKADDR_IN));
  rc=listen(acceptSocket,10);
for(i=0;i&lt;MAX_CLIENTS;i++)
  {
      chan[i]=0;
    clients[i]=INVALID_SOCKET;
    auth[i]=0;
    admin[i]=0;
    nick[i]=&quot;0&quot;;
    userid[i]=0;
  }

boost::thread reaktion( boost::bind(&amp;channel));
boost::thread reaktion2( boost::bind(&amp;user));
  while(1)
  {

    FD_ZERO(&amp;fdSet);
    FD_SET(acceptSocket,&amp;fdSet);
        for(i=0;i&lt;MAX_CLIENTS;i++)
    {
      if(clients[i]!=INVALID_SOCKET)
      {
        FD_SET(clients[i],&amp;fdSet);
      }
    }
      rc=select(0,&amp;fdSet,NULL,NULL,NULL);
if(FD_ISSET(acceptSocket,&amp;fdSet)) {
      for(i=0;i&lt;MAX_CLIENTS;i++)
      {
        if(clients[i]!=INVALID_SOCKET)
        {
          clients[i]=accept(acceptSocket,NULL,NULL);
          boost::thread reaktion( boost::bind(&amp;usernew,clients[i],i));
          break;
        }
      }
}

    for(i=0;i&lt;MAX_CLIENTS;i++)
    {
      if(clients[i]==INVALID_SOCKET)
      {
        continue;
      }
      if(FD_ISSET(clients[i],&amp;fdSet))
      {
        rc=recv(clients[i],buf,320,0);
        if(rc==0 || rc==SOCKET_ERROR)
        {
         boost::thread reaktion( boost::bind(&amp;userdel,i));
          closesocket(clients[i]);
        }
        else
        {
          buf[rc]='\0';
boost::thread reaktion(boost::bind(&amp;detect,clients[i],i,buf));
        }
      }
    }
  }
}
</code></pre>
<p>Vor ein paar tagen konnte ich das Ding noch ohne Fehler Compilieren!<br />
Aber nun geht garnichts mehr <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /></p>
<p>MFG ReduX</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1336985</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1336985</guid><dc:creator><![CDATA[ReduX]]></dc:creator><pubDate>Thu, 02 Aug 2007 05:48:04 GMT</pubDate></item><item><title><![CDATA[Reply to Mysql++ funktioniert nicht on Thu, 02 Aug 2007 06:31:33 GMT]]></title><description><![CDATA[<p>Eine Vermutung:<br />
Die windows.h fehlt.</p>
<p>Ich hatte auch schonmal eine sehr ähnliche Fehlerliste bei einem inkludierten Header. Irgendwann hab ich dann die windows.h mal davor eingebunden und es lief. Und das die &quot;fehlerhafte&quot; Datei &quot;old_<strong>win</strong>_sdk_compat.hpp&quot; heißt, deutet in die Richtung.</p>
<p>Aber da ich selbst Boost nicht benutze, weiß ich nicht, ob es daran liegt. Probiers aber mal so!</p>
<p>gruß<br />
Martin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1336995</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1336995</guid><dc:creator><![CDATA[mad_martin]]></dc:creator><pubDate>Thu, 02 Aug 2007 06:31:33 GMT</pubDate></item><item><title><![CDATA[Reply to Mysql++ funktioniert nicht on Thu, 02 Aug 2007 09:19:40 GMT]]></title><description><![CDATA[<p>Noch ein Tip: sieh mal zu, dass du in Zeile 77 bis 177 Einrueckungen abringst, dann wird der Code leserlicher und man sieht recht schnell, ob z.B. eine der Klammern fehlt (sowas kann auch zu aeusserst merkwuerdigen Fehlermeldungen fuehren...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1337122</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1337122</guid><dc:creator><![CDATA[pumuckl]]></dc:creator><pubDate>Thu, 02 Aug 2007 09:19:40 GMT</pubDate></item><item><title><![CDATA[Reply to Mysql++ funktioniert nicht on Thu, 02 Aug 2007 09:46:16 GMT]]></title><description><![CDATA[<p>In der Funktion ist mir hier zwar kein Compilerfehler aufgefallen, aber evtl. ein logischer ...</p>
<p>Wie ist INVALID_SOCKET genau definiert?<br />
Wenn es nämlich nicht als 0 definiert ist, dann ist die if in Zeile 8 immer true - und da bin ich mir nicht sicher ob das so gewünscht ist</p>
<pre><code class="language-cpp">int user(void)
{
    for(;;) {
      boost::asio::deadline_timer t(io, boost::posix_time::seconds(10));
      t.wait();
      for(i=0;i&lt;MAX_CLIENTS;i++)
      {
      if(clients[i]!=0 || clients[i]!=INVALID_SOCKET)
        {
          char* angabe = &quot;hallo2&quot;;
          send(userid[i],angabe,(int)strlen(angabe),0);
        }
      }
    }
}
</code></pre>
<p>Nachtrag<br />
bei mir ist INVALID_SOCKET definiert als (SOCKET)(~0) also theorhetisch alle Bits auf 1 ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1337138</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1337138</guid><dc:creator><![CDATA[Checker*amp*Murckser]]></dc:creator><pubDate>Thu, 02 Aug 2007 09:46:16 GMT</pubDate></item><item><title><![CDATA[Reply to Mysql++ funktioniert nicht on Thu, 02 Aug 2007 13:47:51 GMT]]></title><description><![CDATA[<p>Hi,<br />
Danke für euere Hilfe.<br />
Also ich habe jetzt mal INVALID_SOCKET als 0 definiert und den windows header eingebunden, nun kommen folgende Meldungen:</p>
<blockquote>
<p>C:/MinGW/bin/../lib/gcc/mingw32/3.4.5/../../../../include/c++/3.4.5/backward/backward_warning.h:32:2: warning: #warning This file includes at least one deprecated or antiquated header. Please consider using one of the 32 headers found in section 17.4.1.2 of the C++ standard. Examples include substituting the &lt;X&gt; header for the &lt;X.h&gt; header for C++ includes, or &lt;iostream&gt; instead of the deprecated header &lt;iostream.h&gt;. To disable this warning use -Wno-deprecated.<br />
In file included from ../boost/boost/asio/detail/win_local_free_on_block_exit.hpp:27,<br />
from ../boost/boost/asio/system_exception.hpp:33,<br />
from ../boost/boost/asio/detail/win_mutex.hpp:26,<br />
from ../boost/boost/asio/detail/mutex.hpp:27,<br />
from ../boost/boost/asio/detail/service_registry.hpp:25,<br />
from ../boost/boost/asio/io_service.hpp:32,<br />
from ../boost/boost/asio/basic_io_object.hpp:20,<br />
from ../boost/boost/asio/basic_socket.hpp:20,<br />
from ../boost/boost/asio/basic_datagram_socket.hpp:25,<br />
from ../boost/boost/asio.hpp:18,<br />
from C:\chat\main.cpp:11:<br />
../boost/boost/asio/detail/socket_types.hpp:44:1: warning: &quot;FD_SETSIZE&quot; redefined<br />
In file included from ../mysql++/lib/common.h:43,<br />
from ../mysql++/lib/connection.h:38,<br />
from ../mysql++/lib/mysql++.h:56,<br />
from ../mysql++/examples/util.h:31,<br />
from C:\chat\main.cpp:2:<br />
C:/MinGW/include/winsock.h:35:1: warning: this is the location of the previous definition<br />
In file included from ../boost/boost/asio/detail/socket_types.hpp:59,<br />
from ../boost/boost/asio/detail/win_local_free_on_block_exit.hpp:27,<br />
from ../boost/boost/asio/system_exception.hpp:33,<br />
from ../boost/boost/asio/detail/win_mutex.hpp:26,<br />
from ../boost/boost/asio/detail/mutex.hpp:27,<br />
from ../boost/boost/asio/detail/service_registry.hpp:25,<br />
from ../boost/boost/asio/io_service.hpp:32,<br />
from ../boost/boost/asio/basic_io_object.hpp:20,<br />
from ../boost/boost/asio/basic_socket.hpp:20,<br />
from ../boost/boost/asio/basic_datagram_socket.hpp:25,<br />
from ../boost/boost/asio.hpp:18,<br />
from C:\chat\main.cpp:11:<br />
C:/MinGW/include/ws2tcpip.h:121: error: redefinition of <code>struct ip_mreq' C:/MinGW/include/winsock.h:278: error: previous definition of</code>struct ip_mreq'<br />
In file included from ../boost/boost/asio/detail/socket_types.hpp:71,<br />
from ../boost/boost/asio/detail/win_local_free_on_block_exit.hpp:27,<br />
from ../boost/boost/asio/system_exception.hpp:33,<br />
from ../boost/boost/asio/detail/win_mutex.hpp:26,<br />
from ../boost/boost/asio/detail/mutex.hpp:27,<br />
from ../boost/boost/asio/detail/service_registry.hpp:25,<br />
from ../boost/boost/asio/io_service.hpp:32,<br />
from ../boost/boost/asio/basic_io_object.hpp:20,<br />
from ../boost/boost/asio/basic_socket.hpp:20,<br />
from ../boost/boost/asio/basic_datagram_socket.hpp:25,<br />
from ../boost/boost/asio.hpp:18,<br />
from C:\chat\main.cpp:11:<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:58: error: expected <code>;' before '.' token ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:188: error: expected unqualified-id before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:188: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:188: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:188: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:188: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:208: error: expected unqualified-id before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:208: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:208: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:208: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:208: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:228: error: expected unqualified-id before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:228: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:228: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:228: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:233: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:233: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:233: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:233: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:233: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:238: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:238: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:238: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:238: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:238: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:243: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:243: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:243: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:243: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:243: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:259: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:259: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:259: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:259: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:259: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:279: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:279: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:279: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:279: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:279: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:284: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:284: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:284: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:284: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:284: error: expected</code>)' before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:289: error: expected unqualified-id before &quot;const&quot;<br />
../boost/boost/asio/detail/old_win_sdk_compat.hpp:289: error: expected <code>)' before &quot;const&quot; ../boost/boost/asio/detail/old\_win\_sdk_compat.hpp:289: error: expected</code>)' before &quot;const&quot;</p>
</blockquote>
<p>Und hier nochmal der aktuelle Code:</p>
<pre><code class="language-cpp">#include &lt;iostream.h&gt;
#include &lt;util.h&gt;
#include &lt;mysql++.h&gt;
#include &lt;iomanip&gt;
#include &lt;string&gt;
#include &lt;stdio.h&gt;
#include &lt;ctime&gt;
#include &lt;boost/thread/thread.hpp&gt;
#include &lt;boost/thread/mutex.hpp&gt;
#include &lt;boost/bind.hpp&gt;
#include &lt;boost/asio.hpp&gt;
#include &lt;windows.h&gt;
#include &lt;boost/date_time/posix_time/posix_time.hpp&gt;
#if defined(WIN32) || defined(__WIN32__)
#include &lt;winsock2.h&gt;
#else
#include &lt;sys/types.h&gt;
#include &lt;sys/socket.h&gt;
#include &lt;netinet/in.h&gt;
#include &lt;arpa/inet.h&gt;
#include &lt;netdb.h&gt;
#endif
#define MAX_CLIENTS 1500
#define INVALID_SOCKET 0
using namespace std;
boost::mutex io_guard;
boost::asio::io_service io;
long rc;
  SOCKET acceptSocket;
  SOCKADDR_IN addr;
  char buf[320];
  int auth[MAX_CLIENTS];
  int chan[MAX_CLIENTS];
  int admin[MAX_CLIENTS];
  string nick[MAX_CLIENTS];
  int userid[MAX_CLIENTS];
  FD_SET fdSet;
  SOCKET clients[MAX_CLIENTS];
  int i;

void splitstring(string str, string seperater, string &amp;first, string &amp;second)
{
     int i = (int)str.find(seperater);
     if(i != -1)
     {
          int y = 0;
          if(!str.empty())
          {
               while(y != i)
               {
                    first += str[y++];
               }
               y = y+(int)seperater.length();
               while(y != str.length())
               {
                    second += str[y++];
               }

          }
     }
     else
     {
          first = str;
          second = &quot;NULL&quot;;
     }
}

string make_daytime_string()
{
  time_t now = time(0);
  return ctime(&amp;now);
}

int detect(int user,int t, string angabe)
{
if(auth[i] == 1)
{

    string a;
    string b;
 splitstring(angabe,&quot;!%!%!%!&quot;,a,b);

if(a == &quot;1&quot;)
{

splitstring(b,&quot;!%!%!%!&quot;,b,a);
const char* c = b.c_str();
for(i=0;i&lt;MAX_CLIENTS;i++)
{

if(clients[i]!=0 || clients[i]!=INVALID_SOCKET)
{

if(chan[i] == chan[t]) {
send(userid[i],c,sizeof(c),0);

}
}
}
}
else if (a == &quot;2&quot;) {

} else if (a == &quot;3&quot;) {

} else if(a == &quot;4&quot;) {

} else if(a == &quot;5&quot;) {

}
}
}

int channel(void)
{

for(;;) {

boost::asio::deadline_timer t(io, boost::posix_time::seconds(10));
t.wait();
for(i=0;i&lt;MAX_CLIENTS;i++)
{

if(clients[i]!=0 || clients[i]!=INVALID_SOCKET)
{

   char* angabe = &quot;hallo&quot;;
send(userid[i],angabe,(int)strlen(angabe),0);
}
}
}
}

int user(void)
{

    for(;;) {
boost::asio::deadline_timer t(io, boost::posix_time::seconds(10));
t.wait();
for(i=0;i&lt;MAX_CLIENTS;i++)
{

if(clients[i]!=0 || clients[i]!=INVALID_SOCKET)
{

    char* angabe = &quot;hallo2&quot;;
send(userid[i],angabe,(int)strlen(angabe),0);

}
}
}
}

int userdel(int i)
{

    chan[i]=0;
    auth[i]=0;
    admin[i]=0;
    nick[i]=&quot;0&quot;;
    userid[i]=0;
    clients[i]=INVALID_SOCKET;
}

int usernew(int user,int i)
{
while(clients[i] != INVALID_SOCKET) {
if(FD_ISSET(clients[i],&amp;fdSet))
{

rc=recv(user,buf,320,0);
if(rc==0 || rc==SOCKET_ERROR)
{

boost::thread reaktion( boost::bind(&amp;userdel,i));
closesocket(user);

} else {
string a,b,username,password;
splitstring(buf,&quot;!%!%!%!&quot;,a,b);
if(a == &quot;0&quot;)
{
splitstring(b,&quot;!%!%!%!&quot;,username,b);
splitstring(b,&quot;!%!%!%!&quot;,password,b);
userid[i] = user;
auth[i] = 1;
chan[i] = 0;
cout &lt;&lt; &quot;User engelegt&quot; &lt;&lt; endl;
}
}
}
}
}

int startWinsock(void)
{
  WSADATA wsa;
  return WSAStartup(MAKEWORD(2,0),&amp;wsa);
}

int main()
{
rc=startWinsock();
acceptSocket=socket(AF_INET,SOCK_STREAM,0);
  memset(&amp;addr,0,sizeof(SOCKADDR_IN));
  addr.sin_family=AF_INET;
  addr.sin_port=htons(8015);
  addr.sin_addr.s_addr=INADDR_ANY;
  rc=bind(acceptSocket,(SOCKADDR*)&amp;addr,sizeof(SOCKADDR_IN));
  rc=listen(acceptSocket,10);
for(i=0;i&lt;MAX_CLIENTS;i++)
  {
      chan[i]=0;
    clients[i]=INVALID_SOCKET;
    auth[i]=0;
    admin[i]=0;
    nick[i]=&quot;0&quot;;
    userid[i]=0;
  }

boost::thread reaktion( boost::bind(&amp;channel));
boost::thread reaktion2( boost::bind(&amp;user));
  while(1)
  {

    FD_ZERO(&amp;fdSet);
    FD_SET(acceptSocket,&amp;fdSet);
        for(i=0;i&lt;MAX_CLIENTS;i++)
    {
      if(clients[i]!=INVALID_SOCKET)
      {
        FD_SET(clients[i],&amp;fdSet);
      }
    }
      rc=select(0,&amp;fdSet,NULL,NULL,NULL);
if(FD_ISSET(acceptSocket,&amp;fdSet)) {
      for(i=0;i&lt;MAX_CLIENTS;i++)
      {
        if(clients[i]!=INVALID_SOCKET)
        {
          clients[i]=accept(acceptSocket,NULL,NULL);
          boost::thread reaktion( boost::bind(&amp;usernew,clients[i],i));
          break;
        }
      }
}

    for(i=0;i&lt;MAX_CLIENTS;i++)
    {
      if(clients[i]==INVALID_SOCKET)
      {
        continue;
      }
      if(FD_ISSET(clients[i],&amp;fdSet))
      {
        rc=recv(clients[i],buf,320,0);
        if(rc==0 || rc==SOCKET_ERROR)
        {
         boost::thread reaktion( boost::bind(&amp;userdel,i));
          closesocket(clients[i]);
        }
        else
        {
          buf[rc]='\0';
boost::thread reaktion(boost::bind(&amp;detect,clients[i],i,buf));
        }
      }
    }
  }
}
</code></pre>
<p>Hoffe das Hilft weiter...</p>
<p>MFG ReduX</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1337336</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1337336</guid><dc:creator><![CDATA[ReduX]]></dc:creator><pubDate>Thu, 02 Aug 2007 13:47:51 GMT</pubDate></item><item><title><![CDATA[Reply to Mysql++ funktioniert nicht on Thu, 02 Aug 2007 14:23:11 GMT]]></title><description><![CDATA[<p>WTF? Du kannst doch nicht einfach die Konstanten aus der windows.h<br />
umändern!</p>
<p>zu deinen Includes:</p>
<p>#include &lt;iostream&gt;<br />
#include &lt;cstdio&gt;</p>
<p>nicht die veralteten Versionen der Header nehmen<br />
ach ja: winsock2.h wird schon in windows.h eingebunden, nicht nochmal einbinden</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1337354</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1337354</guid><dc:creator><![CDATA[Checker*amp*Murckser]]></dc:creator><pubDate>Thu, 02 Aug 2007 14:23:11 GMT</pubDate></item><item><title><![CDATA[Reply to Mysql++ funktioniert nicht on Thu, 02 Aug 2007 14:21:00 GMT]]></title><description><![CDATA[<p>Hi,<br />
Habs umgeändert aber funktionieren tuts deshalba auch nicht.</p>
<p>MFG ReduX</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1337379</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1337379</guid><dc:creator><![CDATA[ReduX]]></dc:creator><pubDate>Thu, 02 Aug 2007 14:21:00 GMT</pubDate></item><item><title><![CDATA[Reply to Mysql++ funktioniert nicht on Fri, 03 Aug 2007 20:26:14 GMT]]></title><description><![CDATA[<p>Hi,<br />
Edit:<br />
Hab den Fehler gefunden es war asio mit dem Sleep Timer nur warum? die parameter stimmten doch!</p>
<p>MFG ReduX</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1338352</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1338352</guid><dc:creator><![CDATA[ReduX]]></dc:creator><pubDate>Fri, 03 Aug 2007 20:26:14 GMT</pubDate></item><item><title><![CDATA[Reply to Mysql++ funktioniert nicht on Fri, 03 Aug 2007 22:23:38 GMT]]></title><description><![CDATA[<p>Hi,<br />
Wenn ich nun mysql++ einbinde bekomme ich auch 3 link errors:</p>
<pre><code>../mysql++/lib/lockable.h:(.text$_ZN7mysqlpp10Connection5closeEv[mysqlpp::Connection::close()]+0x10): undefined reference to `mysql_close@4'
../mysql++/lib/lockable.h:(.text$_ZN7mysqlpp6ResUse9fetch_rowEv[mysqlpp::ResUse::fetch_row()]+0x6f): undefined reference to `mysql_fetch_row@4'
../mysql++/lib/lockable.h:(.text$_ZN7mysqlpp6ResUse9fetch_rowEv[mysqlpp::ResUse::fetch_row()]+0x83): undefined reference to `mysql_fetch_lengths@4'
</code></pre>
<p>Hat das irgendwas mit meinem Mingw zu tun? weil in der Doku steht das es so wei ich es mache gehen müsste!</p>
<p>MFG ReduX</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1338466</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1338466</guid><dc:creator><![CDATA[ReduX]]></dc:creator><pubDate>Fri, 03 Aug 2007 22:23:38 GMT</pubDate></item><item><title><![CDATA[Reply to Mysql++ funktioniert nicht on Fri, 03 Aug 2007 23:27:21 GMT]]></title><description><![CDATA[<p>Hast du die Library dazugelinkt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1338485</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1338485</guid><dc:creator><![CDATA[The-Kenny]]></dc:creator><pubDate>Fri, 03 Aug 2007 23:27:21 GMT</pubDate></item><item><title><![CDATA[Reply to Mysql++ funktioniert nicht on Sat, 04 Aug 2007 00:41:58 GMT]]></title><description><![CDATA[<p>Hi,<br />
Ja ich habe die Lib dazugelinkt.<br />
Über google habe ich folgendes gefunden:<br />
<a href="http://bugs.mysql.com/bug.php?id=8906" rel="nofollow">http://bugs.mysql.com/bug.php?id=8906</a><br />
Aber ich habe die Libs für den Mingw mit dem dlltool erstellt!</p>
<p>MFG ReduX</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1338493</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1338493</guid><dc:creator><![CDATA[ReduX]]></dc:creator><pubDate>Sat, 04 Aug 2007 00:41:58 GMT</pubDate></item></channel></rss>