[Box Backup] compile failure on fedora 9

Alex Howansky boxbackup@fluffy.co.uk
Mon, 30 Jun 2008 23:01:24 -0400


>> Well, it fixed *that* problem, heh.
> 
> Good, thanks :)
> 
>> [CXX]     Timer.cpp
>> Timer.cpp: In static member function 'static void Timers::Cleanup()':
>> Timer.cpp:119: error: 'memset' was not declared in this scope
> 
> Please could you edit lib/common/Timer.cpp and add the following line:
> 
>   #include <string.h>
> 
> after:
> 
>   #include <signal.h>

Ok, I can see where this is going. After a ton more similar failures,
I ended up adding "#include <stdlib.h>" to these files:

lib/common/WaitForEvent.cpp
lib/backupclient/BackupClientRestore.cpp
lib/backupclient/BackupStoreFile.cpp
lib/backupclient/BackupStoreFileCmbIdx.cpp
lib/backupclient/BackupStoreFileCombine.cpp
lib/backupclient/BackupStoreFileDiff.cpp
lib/backupclient/BackupStoreObjectDump.cpp
bin/bbackupd/BackupClientContext.cpp
bin/bbackupd/BackupClientDirectoryRecord.cpp
bin/bbackupd/BackupDaemon.cpp
bin/bbackupquery/bbackupquery.cpp
bin/bbackupctl/bbackupctl.cpp
lib/raidfile/RaidFileRead.cpp
lib/backupstore/BackupStoreCheck.cpp
lib/backupstore/BackupStoreCheck2.cpp
bin/bbstored/BackupContext.cpp
lib/common/DebugMemLeakFinder.cpp

and "#include <string.h>" to these files:

bin/bbstoreaccounts/bbstoreaccounts.cpp
test/bbackupd/_main.cpp
test/backupdiff/_main.cpp
test/backupstore/_main.cpp
test/backupstorefix/_main.cpp
test/backupstorepatch/_main.cpp
test/basicserver/TestContext.cpp
test/basicserver/_main.cpp
test/basicserver/testbasicserver.cpp
test/common/_main.cpp
test/common/testcommon.cpp
test/compress/_main.cpp
test/crypto/_main.cpp
test/raidfile/_main.cpp

(Most of the _main.cpp files in test just had "#include <string>", to which
I added a trailing ".h".)

Then I got this:

[CXX]     BackupClientFileAttributes.cpp
BackupClientFileAttributes.cpp: In static member function 'static void 
BackupClientFileAttributes::FillAttributesLink(StreamableMemBlock&, const char*, stat&)':
BackupClientFileAttributes.cpp:489: error: 'memcpy' is not a member of 'std'
BackupClientFileAttributes.cpp: In static member function 'static void 
BackupClientFileAttributes::FillExtendedAttr(StreamableMemBlock&, const char*)':
BackupClientFileAttributes.cpp:557: error: 'memcpy' is not a member of 'std'
BackupClientFileAttributes.cpp:559: error: 'memcpy' is not a member of 'std'
BackupClientFileAttributes.cpp:592: error: 'memcpy' is not a member of 'std'
BackupClientFileAttributes.cpp:597: error: 'memcpy' is not a member of 'std'
BackupClientFileAttributes.cpp: In member function 'void BackupClientFileAttributes::WriteAttributes(const char*, bool) const':
BackupClientFileAttributes.cpp:684: error: 'strlen' is not a member of 'std'
BackupClientFileAttributes.cpp: In member function 'void BackupClientFileAttributes::WriteExtendedAttr(const char*, int) const':
BackupClientFileAttributes.cpp:844: error: 'memcpy' is not a member of 'std'
BackupClientFileAttributes.cpp:858: error: 'memcpy' is not a member of 'std'
BackupClientFileAttributes.cpp:866: error: 'memcpy' is not a member of 'std'
make: *** [../../debug/lib/backupclient/BackupClientFileAttributes.o] Error 1

So, with very little clue as to what I was doing, I removed "std" from
the start of all calls to std::memcpy and std::strlen in that file (since
that's how they appear appear in other files.)

And that seems to have done it. It passed all tests, and I've got a
running daemon that is backing up and verifying successfully.

-- 
Alex Howansky <alex@howansky.org>