Date: prev next · Thread: first prev next last
2011 Archives by date, by thread · List index


I tried building LibreOffice with svn trunk gcc; though in this case the
bug seems to be a fairly generic include order problem.

The build dies in cosv with:

Compiling: cosv/source/strings/string.cxx
In file included from ../../inc/cosv/string.hxx:33:0,
                 from ../../inc/cosv/csv_precomp.h:39,
                 from ../inc/precomp.h:32,
                 from 
/home/tromey/Space/LibreOffice/bootstrap/clone/sdk/cosv/source/strings/string.cxx:29:
../../inc/cosv/stringdata.hxx: In instantiation of 'csv::StringData<CHAR>::StringData(const CHAR*, 
csv::StringData<CHAR>::size_type) [with CHAR = char, csv::StringData<CHAR>::size_type = long 
unsigned int]':
/home/tromey/Space/LibreOffice/bootstrap/clone/sdk/cosv/source/strings/string.cxx:75:17:   required 
from here
../../inc/cosv/stringdata.hxx:105:5: error: 'memcpy' was not declared in this scope, and no 
declarations were found by argument-dependent lookup at the point of instantiation [-fpermissive]
/usr/include/string.h:44:14: note: 'void* memcpy(void*, const void*, size_t)' declared here, later 
in the translation unit
dmake:  Error code 1, while making '../../unxlngx6.pro/obj/string.obj'


string.hxx includes <string.h>, which declares memcpy, after
cosv/stringdata.hxx.  Moving <string.h> earlier fixes the problem.

This is contributed under the LGPLv3+/MPL.

Tom

diff --git a/cosv/inc/cosv/string.hxx b/cosv/inc/cosv/string.hxx
index 08b1220..8f249f9 100644
--- a/cosv/inc/cosv/string.hxx
+++ b/cosv/inc/cosv/string.hxx
@@ -30,9 +30,9 @@
 #define COSV_STRING_HXX
 
 // USED SERVICES
+#include <string.h>
 #include <cosv/stringdata.hxx>
 #include <cosv/str_types.hxx>
-#include <string.h>
 #include <cosv/csv_ostream.hxx>
 #include <vector>
 

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.