<?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[mehrere Errors mit Boost Lib]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich möchte eine Funktion schreiben die einen Datenbankeintrag eines gelöschten Objektes(Datei oder verzeichnis) macht. Dazu habe ich die Methode write(). In der Datenbank soll aber auch die Größe der Datei oder des Verzeichnisses stehen. Dazu habe ich eine Methode getDirSize(). Jetzt wo ich die Funktion dafür fertig geschrieben habe bekomme ich sehr viele Errors. Leider war ich bisher nicht im stande, das selber zu lösen und bräuchte Hilfe. Kann mir wer ein paar Tipps geben?</p>
<pre><code>void trashrm::Database::write(fs::path *objectPath, fs::path *oldPath) {

    //Get the Size of the Directory with all Files in
    if (fs::is_directory(objectPath)) {
        trashrm::Database::getDirSize(objectPath, size);
    }
    else if (fs::is_regular_file(objectPath)) {
        size = fs::file_size(objectPath);
    }

    /*char *sql = &quot;INSERT INTO trashrm (FILENAME, FILESIZE, OLDPATH, DELETEDAT) &quot;
                &quot;VALUES (&quot; + objectPath-&gt;filename() + &quot;, &quot;;*/
}
</code></pre>
<pre><code>void trashrm::Database::getDirSize(fs::path *objectPath, size_t *size) {
    for (fs::recursive_directory_iterator it(objectPath);
        it != fs::recursive_directory_iterator(); ++it) {
        if (fs::is_directory(*it)) {
            trashrm::Database::getDirSize(it, size);
        }
        else {
            size += fs::file_size(*it);
        }
    }
}
</code></pre>
<p>Fehlermeldung</p>
<pre><code>&quot;/usr/bin/make&quot; -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .clean-conf
make[1]: Verzeichnis »/home/benni/NetBeansProjects/Trash RM« wird betreten
rm -f -r build/Debug
rm -f dist/Debug/GNU-Linux-x86/trash_rm
make[1]: Verzeichnis »/home/benni/NetBeansProjects/Trash RM« wird verlassen

CLEAN SUCCESSFUL (total time: 58ms)
&quot;/usr/bin/make&quot; -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Verzeichnis »/home/benni/NetBeansProjects/Trash RM« wird betreten
&quot;/usr/bin/make&quot;  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/trash_rm
make[2]: Verzeichnis »/home/benni/NetBeansProjects/Trash RM« wird betreten
mkdir -p build/Debug/GNU-Linux-x86
rm -f &quot;build/Debug/GNU-Linux-x86/Database.o.d&quot;
g++    -c -g -I/usr/include/boost -MMD -MP -MF &quot;build/Debug/GNU-Linux-x86/Database.o.d&quot; -o build/Debug/GNU-Linux-x86/Database.o Database.cpp
Database.cpp: In member function ‘void trashrm::Database::write(boost::filesystem::path*, boost::filesystem::path*)’:
Database.cpp:60:36: error: no matching function for call to ‘is_directory(boost::filesystem::path*&amp;)’
     if (fs::is_directory(objectPath)) {
                                    ^
Database.cpp:60:36: note: candidates are:
In file included from /usr/include/boost/filesystem.hpp:17:0,
                 from Database.h:14,
                 from Database.cpp:1:
/usr/include/boost/filesystem/operations.hpp:176:15: note: bool boost::filesystem::is_directory(boost::filesystem::file_status)
   inline bool is_directory(file_status f) { return f.type() == directory_file; }
               ^
/usr/include/boost/filesystem/operations.hpp:176:15: note:   no known conversion for argument 1 from ‘boost::filesystem::path*’ to ‘boost::filesystem::file_status’
/usr/include/boost/filesystem/operations.hpp:294:8: note: bool boost::filesystem::is_directory(const boost::filesystem::path&amp;)
   bool is_directory(const path&amp; p)     {return is_directory(detail::status(p));}
        ^
/usr/include/boost/filesystem/operations.hpp:294:8: note:   no known conversion for argument 1 from ‘boost::filesystem::path*’ to ‘const boost::filesystem::path&amp;’
/usr/include/boost/filesystem/operations.hpp:296:8: note: bool boost::filesystem::is_directory(const boost::filesystem::path&amp;, boost::system::error_code&amp;)
   bool is_directory(const path&amp; p, system::error_code&amp; ec)
        ^
/usr/include/boost/filesystem/operations.hpp:296:8: note:   candidate expects 2 arguments, 1 provided
Database.cpp:63:44: error: no matching function for call to ‘is_regular_file(boost::filesystem::path*&amp;)’
     else if (fs::is_regular_file(objectPath)) {
                                            ^
Database.cpp:63:44: note: candidates are:
In file included from /usr/include/boost/filesystem.hpp:17:0,
                 from Database.h:14,
                 from Database.cpp:1:
/usr/include/boost/filesystem/operations.hpp:175:15: note: bool boost::filesystem::is_regular_file(boost::filesystem::file_status)
   inline bool is_regular_file(file_status f){ return f.type() == regular_file; }
               ^
/usr/include/boost/filesystem/operations.hpp:175:15: note:   no known conversion for argument 1 from ‘boost::filesystem::path*’ to ‘boost::filesystem::file_status’
/usr/include/boost/filesystem/operations.hpp:299:8: note: bool boost::filesystem::is_regular_file(const boost::filesystem::path&amp;)
   bool is_regular_file(const path&amp; p)  {return is_regular_file(detail::status(p));}
        ^
/usr/include/boost/filesystem/operations.hpp:299:8: note:   no known conversion for argument 1 from ‘boost::filesystem::path*’ to ‘const boost::filesystem::path&amp;’
/usr/include/boost/filesystem/operations.hpp:301:8: note: bool boost::filesystem::is_regular_file(const boost::filesystem::path&amp;, boost::system::error_code&amp;)
   bool is_regular_file(const path&amp; p, system::error_code&amp; ec)
        ^
/usr/include/boost/filesystem/operations.hpp:301:8: note:   candidate expects 2 arguments, 1 provided
Database.cpp:64:40: error: no matching function for call to ‘file_size(boost::filesystem::path*&amp;)’
         size = fs::file_size(objectPath);
                                        ^
Database.cpp:64:40: note: candidates are:
In file included from /usr/include/boost/filesystem.hpp:17:0,
                 from Database.h:14,
                 from Database.cpp:1:
/usr/include/boost/filesystem/operations.hpp:447:20: note: uintmax_t boost::filesystem::file_size(const boost::filesystem::path&amp;)
   boost::uintmax_t file_size(const path&amp; p) {return detail::file_size(p);}
                    ^
/usr/include/boost/filesystem/operations.hpp:447:20: note:   no known conversion for argument 1 from ‘boost::filesystem::path*’ to ‘const boost::filesystem::path&amp;’
/usr/include/boost/filesystem/operations.hpp:450:20: note: uintmax_t boost::filesystem::file_size(const boost::filesystem::path&amp;, boost::system::error_code&amp;)
   boost::uintmax_t file_size(const path&amp; p, system::error_code&amp; ec)
                    ^
/usr/include/boost/filesystem/operations.hpp:450:20: note:   candidate expects 2 arguments, 1 provided
Database.cpp: In member function ‘void trashrm::Database::getDirSize(boost::filesystem::path*, size_t*)’:
Database.cpp:76:56: error: no matching function for call to ‘boost::filesystem::recursive_directory_iterator::recursive_directory_iterator(boost::filesystem::path*&amp;)’
     for (fs::recursive_directory_iterator it(objectPath);
                                                        ^
Database.cpp:76:56: note: candidates are:
In file included from /usr/include/boost/filesystem.hpp:17:0,
                 from Database.h:14,
                 from Database.cpp:1:
/usr/include/boost/filesystem/operations.hpp:866:5: note: boost::filesystem::recursive_directory_iterator::recursive_directory_iterator(const boost::filesystem::path&amp;, boost::system::error_code&amp;)
     recursive_directory_iterator(const path&amp; dir_path,
     ^
/usr/include/boost/filesystem/operations.hpp:866:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/boost/filesystem/operations.hpp:855:5: note: boost::filesystem::recursive_directory_iterator::recursive_directory_iterator(const boost::filesystem::path&amp;, boost::filesystem::symlink_option::enum_type, boost::system::error_code&amp;)
     recursive_directory_iterator(const path&amp; dir_path,
     ^
/usr/include/boost/filesystem/operations.hpp:855:5: note:   candidate expects 3 arguments, 1 provided
/usr/include/boost/filesystem/operations.hpp:845:14: note: boost::filesystem::recursive_directory_iterator::recursive_directory_iterator(const boost::filesystem::path&amp;, boost::filesystem::symlink_option::enum_type)
     explicit recursive_directory_iterator(const path&amp; dir_path,
              ^
/usr/include/boost/filesystem/operations.hpp:845:14: note:   no known conversion for argument 1 from ‘boost::filesystem::path*’ to ‘const boost::filesystem::path&amp;’
/usr/include/boost/filesystem/operations.hpp:843:5: note: boost::filesystem::recursive_directory_iterator::recursive_directory_iterator()
     recursive_directory_iterator(){}  // creates the &quot;end&quot; iterator
     ^
/usr/include/boost/filesystem/operations.hpp:843:5: note:   candidate expects 0 arguments, 1 provided
/usr/include/boost/filesystem/operations.hpp:835:9: note: boost::filesystem::recursive_directory_iterator::recursive_directory_iterator(const boost::filesystem::recursive_directory_iterator&amp;)
   class recursive_directory_iterator
         ^
/usr/include/boost/filesystem/operations.hpp:835:9: note:   no known conversion for argument 1 from ‘boost::filesystem::path*’ to ‘const boost::filesystem::recursive_directory_iterator&amp;’
Database.cpp:79:51: error: no matching function for call to ‘trashrm::Database::getDirSize(boost::filesystem::recursive_directory_iterator&amp;, size_t*&amp;)’
             trashrm::Database::getDirSize(it, size);
                                                   ^
Database.cpp:79:51: note: candidate is:
Database.cpp:75:6: note: void trashrm::Database::getDirSize(boost::filesystem::path*, size_t*)
 void trashrm::Database::getDirSize(fs::path *objectPath, size_t *size) {
      ^
Database.cpp:75:6: note:   no known conversion for argument 1 from ‘boost::filesystem::recursive_directory_iterator’ to ‘boost::filesystem::path*’
make[2]: *** [build/Debug/GNU-Linux-x86/Database.o] Fehler 1
make[2]: Verzeichnis »/home/benni/NetBeansProjects/Trash RM« wird verlassen
make[1]: *** [.build-conf] Fehler 2
make[1]: Verzeichnis »/home/benni/NetBeansProjects/Trash RM« wird verlassen
make: *** [.build-impl] Fehler 2

BUILD FAILED (exit value 2, total time: 488ms)
</code></pre>
<p>Ich verstehe nicht wieso er zB bei der ersten Meldung mit is_directory nicht anfangen kann. Hab das im Projekt schon mehrmals ohne Probleme verwendet.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/333706/mehrere-errors-mit-boost-lib</link><generator>RSS for Node</generator><lastBuildDate>Sun, 26 Apr 2026 18:29:06 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/333706.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 25 Jul 2015 18:53:08 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to mehrere Errors mit Boost Lib on Sat, 25 Jul 2015 18:53:08 GMT]]></title><description><![CDATA[<p>Hallo zusammen,</p>
<p>ich möchte eine Funktion schreiben die einen Datenbankeintrag eines gelöschten Objektes(Datei oder verzeichnis) macht. Dazu habe ich die Methode write(). In der Datenbank soll aber auch die Größe der Datei oder des Verzeichnisses stehen. Dazu habe ich eine Methode getDirSize(). Jetzt wo ich die Funktion dafür fertig geschrieben habe bekomme ich sehr viele Errors. Leider war ich bisher nicht im stande, das selber zu lösen und bräuchte Hilfe. Kann mir wer ein paar Tipps geben?</p>
<pre><code>void trashrm::Database::write(fs::path *objectPath, fs::path *oldPath) {

    //Get the Size of the Directory with all Files in
    if (fs::is_directory(objectPath)) {
        trashrm::Database::getDirSize(objectPath, size);
    }
    else if (fs::is_regular_file(objectPath)) {
        size = fs::file_size(objectPath);
    }

    /*char *sql = &quot;INSERT INTO trashrm (FILENAME, FILESIZE, OLDPATH, DELETEDAT) &quot;
                &quot;VALUES (&quot; + objectPath-&gt;filename() + &quot;, &quot;;*/
}
</code></pre>
<pre><code>void trashrm::Database::getDirSize(fs::path *objectPath, size_t *size) {
    for (fs::recursive_directory_iterator it(objectPath);
        it != fs::recursive_directory_iterator(); ++it) {
        if (fs::is_directory(*it)) {
            trashrm::Database::getDirSize(it, size);
        }
        else {
            size += fs::file_size(*it);
        }
    }
}
</code></pre>
<p>Fehlermeldung</p>
<pre><code>&quot;/usr/bin/make&quot; -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .clean-conf
make[1]: Verzeichnis »/home/benni/NetBeansProjects/Trash RM« wird betreten
rm -f -r build/Debug
rm -f dist/Debug/GNU-Linux-x86/trash_rm
make[1]: Verzeichnis »/home/benni/NetBeansProjects/Trash RM« wird verlassen

CLEAN SUCCESSFUL (total time: 58ms)
&quot;/usr/bin/make&quot; -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Verzeichnis »/home/benni/NetBeansProjects/Trash RM« wird betreten
&quot;/usr/bin/make&quot;  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/trash_rm
make[2]: Verzeichnis »/home/benni/NetBeansProjects/Trash RM« wird betreten
mkdir -p build/Debug/GNU-Linux-x86
rm -f &quot;build/Debug/GNU-Linux-x86/Database.o.d&quot;
g++    -c -g -I/usr/include/boost -MMD -MP -MF &quot;build/Debug/GNU-Linux-x86/Database.o.d&quot; -o build/Debug/GNU-Linux-x86/Database.o Database.cpp
Database.cpp: In member function ‘void trashrm::Database::write(boost::filesystem::path*, boost::filesystem::path*)’:
Database.cpp:60:36: error: no matching function for call to ‘is_directory(boost::filesystem::path*&amp;)’
     if (fs::is_directory(objectPath)) {
                                    ^
Database.cpp:60:36: note: candidates are:
In file included from /usr/include/boost/filesystem.hpp:17:0,
                 from Database.h:14,
                 from Database.cpp:1:
/usr/include/boost/filesystem/operations.hpp:176:15: note: bool boost::filesystem::is_directory(boost::filesystem::file_status)
   inline bool is_directory(file_status f) { return f.type() == directory_file; }
               ^
/usr/include/boost/filesystem/operations.hpp:176:15: note:   no known conversion for argument 1 from ‘boost::filesystem::path*’ to ‘boost::filesystem::file_status’
/usr/include/boost/filesystem/operations.hpp:294:8: note: bool boost::filesystem::is_directory(const boost::filesystem::path&amp;)
   bool is_directory(const path&amp; p)     {return is_directory(detail::status(p));}
        ^
/usr/include/boost/filesystem/operations.hpp:294:8: note:   no known conversion for argument 1 from ‘boost::filesystem::path*’ to ‘const boost::filesystem::path&amp;’
/usr/include/boost/filesystem/operations.hpp:296:8: note: bool boost::filesystem::is_directory(const boost::filesystem::path&amp;, boost::system::error_code&amp;)
   bool is_directory(const path&amp; p, system::error_code&amp; ec)
        ^
/usr/include/boost/filesystem/operations.hpp:296:8: note:   candidate expects 2 arguments, 1 provided
Database.cpp:63:44: error: no matching function for call to ‘is_regular_file(boost::filesystem::path*&amp;)’
     else if (fs::is_regular_file(objectPath)) {
                                            ^
Database.cpp:63:44: note: candidates are:
In file included from /usr/include/boost/filesystem.hpp:17:0,
                 from Database.h:14,
                 from Database.cpp:1:
/usr/include/boost/filesystem/operations.hpp:175:15: note: bool boost::filesystem::is_regular_file(boost::filesystem::file_status)
   inline bool is_regular_file(file_status f){ return f.type() == regular_file; }
               ^
/usr/include/boost/filesystem/operations.hpp:175:15: note:   no known conversion for argument 1 from ‘boost::filesystem::path*’ to ‘boost::filesystem::file_status’
/usr/include/boost/filesystem/operations.hpp:299:8: note: bool boost::filesystem::is_regular_file(const boost::filesystem::path&amp;)
   bool is_regular_file(const path&amp; p)  {return is_regular_file(detail::status(p));}
        ^
/usr/include/boost/filesystem/operations.hpp:299:8: note:   no known conversion for argument 1 from ‘boost::filesystem::path*’ to ‘const boost::filesystem::path&amp;’
/usr/include/boost/filesystem/operations.hpp:301:8: note: bool boost::filesystem::is_regular_file(const boost::filesystem::path&amp;, boost::system::error_code&amp;)
   bool is_regular_file(const path&amp; p, system::error_code&amp; ec)
        ^
/usr/include/boost/filesystem/operations.hpp:301:8: note:   candidate expects 2 arguments, 1 provided
Database.cpp:64:40: error: no matching function for call to ‘file_size(boost::filesystem::path*&amp;)’
         size = fs::file_size(objectPath);
                                        ^
Database.cpp:64:40: note: candidates are:
In file included from /usr/include/boost/filesystem.hpp:17:0,
                 from Database.h:14,
                 from Database.cpp:1:
/usr/include/boost/filesystem/operations.hpp:447:20: note: uintmax_t boost::filesystem::file_size(const boost::filesystem::path&amp;)
   boost::uintmax_t file_size(const path&amp; p) {return detail::file_size(p);}
                    ^
/usr/include/boost/filesystem/operations.hpp:447:20: note:   no known conversion for argument 1 from ‘boost::filesystem::path*’ to ‘const boost::filesystem::path&amp;’
/usr/include/boost/filesystem/operations.hpp:450:20: note: uintmax_t boost::filesystem::file_size(const boost::filesystem::path&amp;, boost::system::error_code&amp;)
   boost::uintmax_t file_size(const path&amp; p, system::error_code&amp; ec)
                    ^
/usr/include/boost/filesystem/operations.hpp:450:20: note:   candidate expects 2 arguments, 1 provided
Database.cpp: In member function ‘void trashrm::Database::getDirSize(boost::filesystem::path*, size_t*)’:
Database.cpp:76:56: error: no matching function for call to ‘boost::filesystem::recursive_directory_iterator::recursive_directory_iterator(boost::filesystem::path*&amp;)’
     for (fs::recursive_directory_iterator it(objectPath);
                                                        ^
Database.cpp:76:56: note: candidates are:
In file included from /usr/include/boost/filesystem.hpp:17:0,
                 from Database.h:14,
                 from Database.cpp:1:
/usr/include/boost/filesystem/operations.hpp:866:5: note: boost::filesystem::recursive_directory_iterator::recursive_directory_iterator(const boost::filesystem::path&amp;, boost::system::error_code&amp;)
     recursive_directory_iterator(const path&amp; dir_path,
     ^
/usr/include/boost/filesystem/operations.hpp:866:5: note:   candidate expects 2 arguments, 1 provided
/usr/include/boost/filesystem/operations.hpp:855:5: note: boost::filesystem::recursive_directory_iterator::recursive_directory_iterator(const boost::filesystem::path&amp;, boost::filesystem::symlink_option::enum_type, boost::system::error_code&amp;)
     recursive_directory_iterator(const path&amp; dir_path,
     ^
/usr/include/boost/filesystem/operations.hpp:855:5: note:   candidate expects 3 arguments, 1 provided
/usr/include/boost/filesystem/operations.hpp:845:14: note: boost::filesystem::recursive_directory_iterator::recursive_directory_iterator(const boost::filesystem::path&amp;, boost::filesystem::symlink_option::enum_type)
     explicit recursive_directory_iterator(const path&amp; dir_path,
              ^
/usr/include/boost/filesystem/operations.hpp:845:14: note:   no known conversion for argument 1 from ‘boost::filesystem::path*’ to ‘const boost::filesystem::path&amp;’
/usr/include/boost/filesystem/operations.hpp:843:5: note: boost::filesystem::recursive_directory_iterator::recursive_directory_iterator()
     recursive_directory_iterator(){}  // creates the &quot;end&quot; iterator
     ^
/usr/include/boost/filesystem/operations.hpp:843:5: note:   candidate expects 0 arguments, 1 provided
/usr/include/boost/filesystem/operations.hpp:835:9: note: boost::filesystem::recursive_directory_iterator::recursive_directory_iterator(const boost::filesystem::recursive_directory_iterator&amp;)
   class recursive_directory_iterator
         ^
/usr/include/boost/filesystem/operations.hpp:835:9: note:   no known conversion for argument 1 from ‘boost::filesystem::path*’ to ‘const boost::filesystem::recursive_directory_iterator&amp;’
Database.cpp:79:51: error: no matching function for call to ‘trashrm::Database::getDirSize(boost::filesystem::recursive_directory_iterator&amp;, size_t*&amp;)’
             trashrm::Database::getDirSize(it, size);
                                                   ^
Database.cpp:79:51: note: candidate is:
Database.cpp:75:6: note: void trashrm::Database::getDirSize(boost::filesystem::path*, size_t*)
 void trashrm::Database::getDirSize(fs::path *objectPath, size_t *size) {
      ^
Database.cpp:75:6: note:   no known conversion for argument 1 from ‘boost::filesystem::recursive_directory_iterator’ to ‘boost::filesystem::path*’
make[2]: *** [build/Debug/GNU-Linux-x86/Database.o] Fehler 1
make[2]: Verzeichnis »/home/benni/NetBeansProjects/Trash RM« wird verlassen
make[1]: *** [.build-conf] Fehler 2
make[1]: Verzeichnis »/home/benni/NetBeansProjects/Trash RM« wird verlassen
make: *** [.build-impl] Fehler 2

BUILD FAILED (exit value 2, total time: 488ms)
</code></pre>
<p>Ich verstehe nicht wieso er zB bei der ersten Meldung mit is_directory nicht anfangen kann. Hab das im Projekt schon mehrmals ohne Probleme verwendet.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2461002</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2461002</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 25 Jul 2015 18:53:08 GMT</pubDate></item><item><title><![CDATA[Reply to mehrere Errors mit Boost Lib on Sat, 25 Jul 2015 19:02:49 GMT]]></title><description><![CDATA[<p>Du hast Pointer auf path, die Funktionen wollen eine Reference.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2461003</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2461003</guid><dc:creator><![CDATA[Nathan]]></dc:creator><pubDate>Sat, 25 Jul 2015 19:02:49 GMT</pubDate></item><item><title><![CDATA[Reply to mehrere Errors mit Boost Lib on Sat, 25 Jul 2015 20:42:59 GMT]]></title><description><![CDATA[<p>hab das Problem jetzt gelöst. Bin total durcheinander gekommen mit Pointern und References. Hab aber jetzt das nächste Problem. Kann da bitte nochmal kurz einer drüber gucken?</p>
<p>meine write Methode</p>
<pre><code>void trashrm::Database::write(fs::path &amp;objectPath, fs::path &amp;oldPath) {

    //Get the Size of the Directory with all Files in
    if (fs::is_directory(objectPath)) {
        trashrm::Database::getDirSize(objectPath);
    }
    else if (fs::is_regular_file(objectPath)) {
        size = (size_t*)fs::file_size(objectPath);
    }
    char sql[] =    &quot;INSERT INTO trashrm (FILENAME, FILESIZE, OLDPATH, DELETEDAT) &quot;
                    &quot;VALUES (&quot; + objectPath.filename().string() + &quot;, &quot; + 
                    boost::lexical_cast&lt;std::string&gt;(size) + &quot;, &quot; 
                    + fs::canonical(oldPath).string() + &quot;, NOW());&quot;;
}
</code></pre>
<p>der neue Error</p>
<pre><code>&quot;/usr/bin/make&quot; -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Verzeichnis »/home/benni/NetBeansProjects/Trash RM« wird betreten
&quot;/usr/bin/make&quot;  -f nbproject/Makefile-Debug.mk dist/Debug/GNU-Linux-x86/trash_rm
make[2]: Verzeichnis »/home/benni/NetBeansProjects/Trash RM« wird betreten
mkdir -p build/Debug/GNU-Linux-x86
rm -f &quot;build/Debug/GNU-Linux-x86/Database.o.d&quot;
g++    -c -g -I/usr/include/boost -MMD -MP -MF &quot;build/Debug/GNU-Linux-x86/Database.o.d&quot; -o build/Debug/GNU-Linux-x86/Database.o Database.cpp
Database.cpp: In member function ‘void trashrm::Database::write(boost::filesystem::path&amp;, boost::filesystem::path&amp;)’:
Database.cpp:69:57: error: initializer fails to determine size of ‘sql’
                     + fs::canonical(oldPath).string() + &quot;, NOW());&quot;;
                                                         ^
Database.cpp:69:57: error: array must be initialized with a brace-enclosed initializer
make[2]: *** [build/Debug/GNU-Linux-x86/Database.o] Fehler 1
make[2]: Verzeichnis »/home/benni/NetBeansProjects/Trash RM« wird verlassen
make[1]: *** [.build-conf] Fehler 2
make[1]: Verzeichnis »/home/benni/NetBeansProjects/Trash RM« wird verlassen
make: *** [.build-impl] Fehler 2

BUILD FAILED (exit value 2, total time: 867ms)
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2461011</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2461011</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 25 Jul 2015 20:42:59 GMT</pubDate></item><item><title><![CDATA[Reply to mehrere Errors mit Boost Lib on Sat, 25 Jul 2015 20:54:44 GMT]]></title><description><![CDATA[<p>Dein SQL Query ist kein String Literal mehr, daher kannst du damit kein char Array initialisieren. Wenn du aus der sql Variable einen <code>std::string</code> machst sollte es gehen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2461012</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2461012</guid><dc:creator><![CDATA[sebi707]]></dc:creator><pubDate>Sat, 25 Jul 2015 20:54:44 GMT</pubDate></item><item><title><![CDATA[Reply to mehrere Errors mit Boost Lib on Sat, 25 Jul 2015 21:21:10 GMT]]></title><description><![CDATA[<p>das Problem ist das Sqlite in seiner Funktion sqlite3_exec einen char parameter erwartet und keinen string.</p>
<p>edit: habs jetzt so gelöst, finde ich aber sehr unschön.</p>
<pre><code>std::string sqll =   &quot;INSERT INTO trashrm (FILENAME, FILESIZE, OLDPATH, DELETEDAT) &quot;
                        &quot;VALUES (&quot; + objectPath.filename().string() + &quot;, &quot; + 
                        boost::lexical_cast&lt;std::string&gt;(size) + &quot;, &quot; 
                        + fs::canonical(oldPath).string() + &quot;, NOW());&quot;;
    char *sql = new char(sqll.length());
    strcpy(sql, sqll.c_str());
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/2461013</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2461013</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 25 Jul 2015 21:21:10 GMT</pubDate></item><item><title><![CDATA[Reply to mehrere Errors mit Boost Lib on Sat, 25 Jul 2015 21:22:09 GMT]]></title><description><![CDATA[<p><a href="https://xkcd.com/327/" rel="nofollow">https://xkcd.com/327/</a></p>
<p>Lern erst mal richtig Programmieren.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2461014</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2461014</guid><dc:creator><![CDATA[Robert&#x27;); DROP TABLE STUD]]></dc:creator><pubDate>Sat, 25 Jul 2015 21:22:09 GMT</pubDate></item><item><title><![CDATA[Reply to mehrere Errors mit Boost Lib on Sat, 25 Jul 2015 21:24:08 GMT]]></title><description><![CDATA[<p>Bennisen schrieb:</p>
<blockquote>
<p>das Problem ist das Sqlite in seiner Funktion sqlite3_exec einen char parameter erwartet und keinen string</p>
</blockquote>
<p>Dafür gibts doch die <code>.c_str()</code> Memberfunktion, die du ja offensichtlich kennst. Du kannst einfach <code>sqlite3_exec(sqll.c_str());</code> schreiben (+irgendwelche andere Parameter).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2461015</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2461015</guid><dc:creator><![CDATA[sebi707]]></dc:creator><pubDate>Sat, 25 Jul 2015 21:24:08 GMT</pubDate></item><item><title><![CDATA[Reply to mehrere Errors mit Boost Lib on Sat, 25 Jul 2015 22:14:19 GMT]]></title><description><![CDATA[<p>Hatte ich noch garnicht probiert, aber es funktioniert. danke <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2461017</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2461017</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sat, 25 Jul 2015 22:14:19 GMT</pubDate></item></channel></rss>