liuis / leveldb

Automatically exported from code.google.com/p/leveldb
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Can't compile on OSX 10.5.8 + GCC 4.0.1 #10

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

Can't compile on OSX

$ make
g++ -c -I. -I./include -DLEVELDB_PLATFORM_OSX -O2 -DNDEBUG        
db/table_cache.cc -o db/table_cache.o
g++ -c -I. -I./include -DLEVELDB_PLATFORM_OSX -O2 -DNDEBUG        
db/version_edit.cc -o db/version_edit.o
g++ -c -I. -I./include -DLEVELDB_PLATFORM_OSX -O2 -DNDEBUG        
db/version_set.cc -o db/version_set.o
db/version_set.cc: In member function ‘void 
leveldb::VersionSet::Builder::Apply(leveldb::VersionEdit*)’:
./db/version_edit.h:99: error: ‘std::vector<std::pair<int, 
leveldb::InternalKey>, std::allocator<std::pair<int, leveldb::InternalKey> > > 
leveldb::VersionEdit::compact_pointers_’ is private
db/version_set.cc:287: error: within this context
./db/version_edit.h:99: error: ‘std::vector<std::pair<int, 
leveldb::InternalKey>, std::allocator<std::pair<int, leveldb::InternalKey> > > 
leveldb::VersionEdit::compact_pointers_’ is private
db/version_set.cc:288: error: within this context
./db/version_edit.h:99: error: ‘std::vector<std::pair<int, 
leveldb::InternalKey>, std::allocator<std::pair<int, leveldb::InternalKey> > > 
leveldb::VersionEdit::compact_pointers_’ is private
db/version_set.cc:290: error: within this context
./db/version_edit.h:86: error: ‘typedef class std::set<std::pair<int, 
uint64_t>, std::less<std::pair<int, uint64_t> >, std::allocator<std::pair<int, 
uint64_t> > > leveldb::VersionEdit::DeletedFileSet’ is private
db/version_set.cc:294: error: within this context
./db/version_edit.h:100: error: ‘std::set<std::pair<int, uint64_t>, 
std::less<std::pair<int, uint64_t> >, std::allocator<std::pair<int, uint64_t> > 
> leveldb::VersionEdit::deleted_files_’ is private
db/version_set.cc:294: error: within this context
./db/version_edit.h:101: error: ‘std::vector<std::pair<int, 
leveldb::FileMetaData>, std::allocator<std::pair<int, leveldb::FileMetaData> > 
> leveldb::VersionEdit::new_files_’ is private
db/version_set.cc:304: error: within this context
./db/version_edit.h:101: error: ‘std::vector<std::pair<int, 
leveldb::FileMetaData>, std::allocator<std::pair<int, leveldb::FileMetaData> > 
> leveldb::VersionEdit::new_files_’ is private
db/version_set.cc:305: error: within this context
./db/version_edit.h:101: error: ‘std::vector<std::pair<int, 
leveldb::FileMetaData>, std::allocator<std::pair<int, leveldb::FileMetaData> > 
> leveldb::VersionEdit::new_files_’ is private
db/version_set.cc:306: error: within this context
db/version_set.cc: In member function ‘void 
leveldb::VersionSet::Builder::SaveTo(leveldb::Version*)’:
./db/version_set.h:66: error: ‘std::vector<leveldb::FileMetaData*, 
std::allocator<leveldb::FileMetaData*> > leveldb::Version::files_ [7]’ is 
private
db/version_set.cc:320: error: within this context
./db/version_set.h:66: error: ‘std::vector<leveldb::FileMetaData*, 
std::allocator<leveldb::FileMetaData*> > leveldb::Version::files_ [7]’ is 
private
db/version_set.cc:324: error: within this context
db/version_set.cc: In member function ‘void 
leveldb::VersionSet::Builder::MaybeAddFile(leveldb::Version*, int, 
leveldb::FileMetaData*)’:
./db/version_set.h:66: error: ‘std::vector<leveldb::FileMetaData*, 
std::allocator<leveldb::FileMetaData*> > leveldb::Version::files_ [7]’ is 
private
db/version_set.cc:367: error: within this context
make: *** [db/version_set.o] Error 1

What version of the product are you using? On what operating system?

from SVN

Please provide any additional information below.

gcc --version
i686-apple-darwin9-gcc-4.0.1 (GCC) 4.0.1 (Apple Inc. build 5488)
Copyright (C) 2005 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

Original issue reported on code.google.com by voidptr...@gmail.com on 21 Jun 2011 at 2:34

GoogleCodeExporter commented 9 years ago
Sounds like you need this patch:

https://github.com/dizzyd/leveldb/commit/04a80d05e5aadacabab6c5f9699e639d3b05d8b
f

Original comment by paul.jos...@gmail.com on 21 Jun 2011 at 4:10

GoogleCodeExporter commented 9 years ago
XCode 3.1.4 (10.5-compatible) defaults to GCC 4.0.1, however it includes GCC 
4.2 and LLVM/GCC 4.2. A possible solution is to compile with llvm-g++ on OS X. 
Can someone affected by this on 10.5 check if the attached patch resolves the 
issue?

Original comment by ashoema...@gmail.com on 7 Jul 2011 at 10:00

Attachments:

GoogleCodeExporter commented 9 years ago
On OSX 10.5.8, my Xcode version is 3.1.1. So, "llvm-g++" command isn't 
available.
However, I can confirm that under OSX 10.6.8, the "cc.patch" works and let me 
compile level-db with "llvm-g++".
Hope this help guys.

Original comment by voidptr...@gmail.com on 7 Jul 2011 at 11:26

GoogleCodeExporter commented 9 years ago
This patch looks for llvm-g++ in the system path, and in an XCode-specific 
directory. Can you try it on 10.5?

Original comment by ashoema...@gmail.com on 7 Jul 2011 at 6:58

Attachments:

GoogleCodeExporter commented 9 years ago
Good news. I confirm that with the "cc-detect.patch", everything compile just 
fine under OSX 10.5.8.
The patch was able to detect "llvm-g++" under 
"/Developer/usr/llvm-gcc-4.2/bin/llvm-g++4.2".
Thanks guys and keep up the good work.

Original comment by voidptr...@gmail.com on 7 Jul 2011 at 7:43

GoogleCodeExporter commented 9 years ago
There have been a bunch of build improvements.  Please reopen if the problem 
still exists.

Original comment by san...@google.com on 30 May 2012 at 5:19