Giter Club home page Giter Club logo

Comments (31)

lanceschi avatar lanceschi commented on June 14, 2024

Removing use_frameworks! line from the Podfile fixed the compiling issue.

from objective-leveldb.

ov1d1u avatar ov1d1u commented on June 14, 2024

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.

lanceschi avatar lanceschi commented on June 14, 2024

@ov1d1u can you post your Podfile?

from objective-leveldb.

ov1d1u avatar ov1d1u commented on June 14, 2024

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.

lanceschi avatar lanceschi commented on June 14, 2024

@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.

ov1d1u avatar ov1d1u commented on June 14, 2024

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.

lanceschi avatar lanceschi commented on June 14, 2024

@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.

nicksnyder avatar nicksnyder commented on June 14, 2024

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.

emilwojtaszek avatar emilwojtaszek commented on June 14, 2024

@ov1d1u any solutions for this issue?

from objective-leveldb.

emilwojtaszek avatar emilwojtaszek commented on June 14, 2024

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"
  ]

@matehat

from objective-leveldb.

emilwojtaszek avatar emilwojtaszek commented on June 14, 2024

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.

hilen avatar hilen commented on June 14, 2024

Still not work if involve use_frameworks!

from objective-leveldb.

emilwojtaszek avatar emilwojtaszek commented on June 14, 2024

did you use my solution, it's still the same error?

from objective-leveldb.

hilen avatar hilen commented on June 14, 2024

@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.

emilwojtaszek avatar emilwojtaszek commented on June 14, 2024

not sure but this should work

pod 'leveldb-library', :podspec => 'https://gist.githubusercontent.com/emilwojtaszek/42b63a772ea71bc1fb4a/raw/71ec94bcb417580e84765057a743e1946b016a3c/leveldb-library.json'

from objective-leveldb.

hilen avatar hilen commented on June 14, 2024

@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.

emilwojtaszek avatar emilwojtaszek commented on June 14, 2024

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.

hilen avatar hilen commented on June 14, 2024

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.

matehat avatar matehat commented on June 14, 2024

@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.

emilwojtaszek avatar emilwojtaszek commented on June 14, 2024

you could update podspecs as i've described above, it's working for me

from objective-leveldb.

matehat avatar matehat commented on June 14, 2024

Thanks, will get that going today.

from objective-leveldb.

matehat avatar matehat commented on June 14, 2024

@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.

matehat avatar matehat commented on June 14, 2024

Basically just made a ruby-based spec from your JSON

from objective-leveldb.

emilwojtaszek avatar emilwojtaszek commented on June 14, 2024

you should also update CocoaPods Specs

from objective-leveldb.

matehat avatar matehat commented on June 14, 2024

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.

matehat avatar matehat commented on June 14, 2024

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.

neirar avatar neirar commented on June 14, 2024

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.

matehat avatar matehat commented on June 14, 2024

@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.

matehat avatar matehat commented on June 14, 2024

Seems to have fixed the issue, closing.

from objective-leveldb.

neirar avatar neirar commented on June 14, 2024

@matehat, sorry for the delay in replying. The issue has been fixed. Thanks!

from objective-leveldb.

matehat avatar matehat commented on June 14, 2024

Thanks @neirar!

from objective-leveldb.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.