Comments (31)
Removing use_frameworks!
line from the Podfile fixed the compiling issue.
from objective-leveldb.
Hi,
I'm getting this issue when I try to set Objective-LevelDB as a dependency in a podspec file. Do you know any solution for this? Thanks!
from objective-leveldb.
@ov1d1u can you post your Podfile?
from objective-leveldb.
As I said before I'm not using a Podfile but a podspec file, where I set Objective-LevelDB as a depedency. Here is the podspec file: http://pastebin.com/STzBHNm6 (the last 5 lines are relevant, I guess).
I get the issue when I run pod spec lint to validate the podspec file
from objective-leveldb.
@ov1d1u weird! I checked your file. My only guess to better identify your issue is to comment s.requires_arc = true
and try rebuilding.
from objective-leveldb.
I already did this with no effect. I'll see what can I do regarding this. Anyway the linker error comes from leveldb-library and not Objective-LevelDB.
from objective-leveldb.
@ov1d1u you're right. I realise my mistake a few seconds after I published the comment. I delete the comment right away although it eventually made to your inbox. Sorry.
from objective-leveldb.
Is there a solution or workaround to this problem that doesn't involve removing use_frameworks!
?
The project I am working on needs to use frameworks and I am running into this issue.
from objective-leveldb.
@ov1d1u any solutions for this issue?
from objective-leveldb.
this is because duplicated main function in files db_bench.cc and leveldb_main.cc
we can fix that by extending exclude_files
by db/db_bench.cc
in podspec file, like this:
"exclude_files": [
"**/*_test.cc",
"port/win",
"db/db_bench.cc"
]
from objective-leveldb.
i've spend some time on this, but finally all is working
i've updated leveldb-library podspec in private spec repo, like this:
{
"name": "leveldb-library",
"version": "1.18.1",
"license": "New BSD",
"summary": "A fast key-value storage library ",
"description": "LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.",
"homepage": "https://github.com/google/leveldb",
"authors": "The LevelDB Authors",
"platforms": {
"ios": "5.0",
"osx": "10.7"
},
"source": {
"git": "https://github.com/matehat/leveldb.git",
"tag": "v1.18.1"
},
"requires_arc": false,
"compiler_flags": [
"-DOS_MACOSX",
"-DLEVELDB_PLATFORM_POSIX"
],
"preserve_paths": [
"leveldb-library"
],
"xcconfig": {
"CC": "clang",
"CXX": "clang++",
"HEADER_SEARCH_PATHS": "\"${PODS_ROOT}/leveldb-library\"",
"OTHER_LDFLAGS": "-lc++"
},
"header_dir": "leveldb",
"source_files": [
"include/leveldb/*",
"util/*.{h}",
"table/*.{h}",
"port/*.{h}",
"db/*.{h}",
"db/builder.cc",
"db/c.cc",
"db/db_impl.cc",
"db/db_iter.cc",
"db/dbformat.cc",
"db/filename.cc",
"db/log_reader.cc",
"db/log_writer.cc",
"db/memtable.cc",
"db/repair.cc",
"db/table_cache.cc",
"db/version_edit.cc",
"db/version_set.cc",
"db/write_batch.cc",
"table/block.cc",
"table/block_builder.cc",
"table/filter_block.cc",
"table/format.cc",
"table/iterator.cc",
"table/merger.cc",
"table/table.cc",
"table/table_builder.cc",
"table/two_level_iterator.cc",
"util/arena.cc",
"util/bloom.cc",
"util/cache.cc",
"util/coding.cc",
"util/comparator.cc",
"util/crc32c.cc",
"util/env.cc",
"util/env_posix.cc",
"util/filter_policy.cc",
"util/hash.cc",
"util/histogram.cc",
"util/logging.cc",
"util/options.cc",
"util/status.cc",
"port/port_posix.cc"
],
"public_header_files": [
"include/leveldb/*.{h}",
"include/**/*.{h}"
]
}
from objective-leveldb.
Still not work if involve use_frameworks
!
from objective-leveldb.
did you use my solution, it's still the same error?
from objective-leveldb.
@emilwojtaszek May be no, I just insert a line pod 'Objective-LevelDB'
into my podfile and run pod install
. But it doesn't work. So should I fork this repo and edit my podspec?
from objective-leveldb.
not sure but this should work
pod 'leveldb-library', :podspec => 'https://gist.githubusercontent.com/emilwojtaszek/42b63a772ea71bc1fb4a/raw/71ec94bcb417580e84765057a743e1946b016a3c/leveldb-library.json'
from objective-leveldb.
@emilwojtaszek the error Linker command failed - duplicate symbol _main for architecture x86_64
is gone, but it comes out: "util/arena.h" not found
.
from objective-leveldb.
maybe this is to big shortcut..
you should try to create private cocoapods repo as i do and add 2 specs
1:
{
"name": "Objective-LevelDB-appunite",
"version": "2.1.4",
"license": "MIT",
"summary": "A feature-complete wrapper for LevelDB in Objective-C.",
"description": "This is a feature-complete wrapper for Google's LevelDB. LevelDB is a fast key-value store written by Google.",
"homepage": "https://github.com/matehat/Objective-LevelDB",
"authors": [
"Michael Hoisie",
"Mathieu D'Amours"
],
"platforms": {
"ios": "5.0",
"osx": "10.7"
},
"source": {
"git": "https://github.com/matehat/Objective-LevelDB.git",
"tag": "2.1.4",
"submodules": true
},
"source_files": "Classes/*.{h,m,mm}",
"dependencies": {
"leveldb-library-appunite": [
"~> 1.18"
]
},
"requires_arc": false
}
2.:
{
"name": "leveldb-library-appunite",
"version": "1.18.1",
"license": "New BSD",
"summary": "A fast key-value storage library ",
"description": "LevelDB is a fast key-value storage library written at Google that provides an ordered mapping from string keys to string values.",
"homepage": "https://github.com/google/leveldb",
"authors": "The LevelDB Authors",
"platforms": {
"ios": "5.0",
"osx": "10.7"
},
"source": {
"git": "https://github.com/matehat/leveldb.git",
"tag": "v1.18.1"
},
"requires_arc": false,
"compiler_flags": [
"-DOS_MACOSX",
"-DLEVELDB_PLATFORM_POSIX"
],
"preserve_paths": [
"leveldb-library"
],
"xcconfig": {
"CC": "clang",
"CXX": "clang++",
"HEADER_SEARCH_PATHS": "\"${PODS_ROOT}/leveldb-library-appunite\"",
"OTHER_LDFLAGS": "-lc++"
},
"header_dir": "leveldb",
"source_files": [
"include/leveldb/*",
"util/*.{h}",
"table/*.{h}",
"port/*.{h}",
"db/*.{h}",
"db/builder.cc",
"db/c.cc",
"db/db_impl.cc",
"db/db_iter.cc",
"db/dbformat.cc",
"db/filename.cc",
"db/log_reader.cc",
"db/log_writer.cc",
"db/memtable.cc",
"db/repair.cc",
"db/table_cache.cc",
"db/version_edit.cc",
"db/version_set.cc",
"db/write_batch.cc",
"table/block.cc",
"table/block_builder.cc",
"table/filter_block.cc",
"table/format.cc",
"table/iterator.cc",
"table/merger.cc",
"table/table.cc",
"table/table_builder.cc",
"table/two_level_iterator.cc",
"util/arena.cc",
"util/bloom.cc",
"util/cache.cc",
"util/coding.cc",
"util/comparator.cc",
"util/crc32c.cc",
"util/env.cc",
"util/env_posix.cc",
"util/filter_policy.cc",
"util/hash.cc",
"util/histogram.cc",
"util/logging.cc",
"util/options.cc",
"util/status.cc",
"port/port_posix.cc"
],
"public_header_files": [
"include/leveldb/*.{h}",
"include/**/*.{h}"
]
}
from objective-leveldb.
Thanks ,I'll try it. Now I Just drag the uber's fork repo file to my Swift project. And it runs ok.
from objective-leveldb.
@emilwojtaszek thanks infinitely for helping people with this issue. Do you have suggestions as to what could be changed on the project to fix that issue permanently?
from objective-leveldb.
you could update podspecs as i've described above, it's working for me
from objective-leveldb.
Thanks, will get that going today.
from objective-leveldb.
@emilwojtaszek do you mind checking if https://github.com/matehat/leveldb-library-podspec/blob/master/leveldb-library.podspec works with your setup?
from objective-leveldb.
Basically just made a ruby-based spec from your JSON
from objective-leveldb.
you should also update CocoaPods Specs
from objective-leveldb.
Before pushing the changes to CocoaPods, thus imposing the changes to every new user, I want to make sure we're not breaking things
from objective-leveldb.
In my quick tests, I tried starting a new project with different configurations, with the current cocoapods specs (both leveldb-library and Objective-LevelDB) and the projects always builds fine. So it seems the problems you were having were more project-related configurations, and I'd like to find what that is, rather that break the existing setup.
from objective-leveldb.
I have been using the Objective-LevelDB
pod successfully for a while. Today, I added the XCGLogger
pod, which requires the adding use_frameworks!
to my pod file because it is written in swift. Now, I'm getting the error duplicate symbol _main for architecture x86_64
.
The function int main()
is defined in two files: leveldb_main.cc
and db_bench.cc
. Both files are in leveldb-library
and not in Objective-LevelDB
itself. Do you know if there is an open issue for this in leveldb-library
?
from objective-leveldb.
@neirar I just pushed a new version of leveldb-library
and of Objective-LevelDB
. Can you update your pods and confirm if it fixed your issues?
from objective-leveldb.
Seems to have fixed the issue, closing.
from objective-leveldb.
@matehat, sorry for the delay in replying. The issue has been fixed. Thanks!
from objective-leveldb.
Thanks @neirar!
from objective-leveldb.
Related Issues (20)
- When filtering / enumerating the objects that don't match the predicate are not released HOT 4
- newWritebatch() not accessible in Swift. HOT 2
- allKeys is returned before enumerating
- stop parameter in enumerateKeysUsingBlock block is always NO
- can't build using cocoapods 0.37 HOT 1
- The dbName is ignored
- implicit conversion loses integer precision leveldb-library HOT 4
- backward prefixed enumerations with starting key HOT 1
- Getting "Unable to find a specification ..." running pod install HOT 1
- Swift usage error about encodeWithCoder HOT 1
- Crash in deleteDatabaseFromDisk method HOT 2
- pod 'Objective-LevelDB' compile error
- LevelDB instance gets overreleased under high contention HOT 1
- Common.h file has a name conflict with another library HOT 1
- support for Carthage
- Multi-process support on iOS HOT 1
- setNilValueForKey
- Not able to use LDBWritebatch HOT 1
- .../CURRENT: Operation not permitted HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from objective-leveldb.