LoopPerfect / buckaroo-recipes

The official book of recipes for Buckaroo 📒
https://www.buckaroo.pm
MIT License
6 stars 4 forks source link

Error building a package with pocoproject/mongodb@1.7.8 as dependency #73

Closed ogranada closed 7 years ago

ogranada commented 7 years ago

Description

Error building a package with pocoproject/mongodb@1.7.8 as dependency.

Expected Behavior

The code should compile.

Actual Behavior

Fails launching next error:

Undefined symbols for architecture x86_64:
  "Poco::Windows1250Encoding::Windows1250Encoding()", referenced from:
      Poco::TextEncodingManager::TextEncodingManager() in libfoundation.a(TextEncoding.cpp.o)
  "Poco::Windows1251Encoding::Windows1251Encoding()", referenced from:
      Poco::TextEncodingManager::TextEncodingManager() in libfoundation.a(TextEncoding.cpp.o)
  "Poco::Windows1252Encoding::Windows1252Encoding()", referenced from:
      Poco::TextEncodingManager::TextEncodingManager() in libfoundation.a(TextEncoding.cpp.o)
  "_pcre_compile", referenced from:
      Poco::RegularExpression::RegularExpression(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) in libfoundation.a(RegularExpression.cpp.o)
  "_pcre_exec", referenced from:
      Poco::RegularExpression::match(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<ch
ar> > const&, unsigned long, Poco::RegularExpression::Match&, int) const in libfoundation.a(RegularExpression.cpp.o)      Poco::RegularExpression::match(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<ch
ar> > const&, unsigned long, std::__1::vector<Poco::RegularExpression::Match, std::__1::allocator<Poco::RegularExpres
sion::Match> >&, int) const in libfoundation.a(RegularExpression.cpp.o)
      Poco::RegularExpression::substOne(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator
<char> >&, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const
&, int) const in libfoundation.a(RegularExpression.cpp.o)
  "_pcre_free", referenced from:
      Poco::RegularExpression::~RegularExpression() in libfoundation.a(RegularExpression.cpp.o)
  "_pcre_study", referenced from:
      Poco::RegularExpression::RegularExpression(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::
allocator<char> > const&, int, bool) in libfoundation.a(RegularExpression.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

BUILD FAILED: //:main#binary failed with exit code 1:
c++ link
stderr: Undefined symbols for architecture x86_64:
  "Poco::Windows1250Encoding::Windows1250Encoding()", referenced from:
      Poco::TextEncodingManager::TextEncodingManager() in libfoundation.a(TextEncoding.cpp.o)
  "Poco::Windows1251Encoding::Windows1251Encoding()", referenced from:
      Poco::TextEncodingManager::TextEncodingManager() in libfoundation.a(TextEncoding.cpp.o)
  "Poco::Windows1252Encoding::Windows1252Encoding()", referenced from:
      Poco::TextEncodingManager::TextEncodingManager() in libfoundation.a(TextEncoding.cpp.o)
  "_pcre_compile", referenced from:
      Poco::RegularExpression::RegularExpression(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) in libfoundation.a(RegularExpression.cpp.o)
  "_pcre_exec", referenced from:
      Poco::RegularExpression::match(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, Poco::RegularExpression::Match&, int) const in libfoundation.a(RegularExpression.cpp.o)
      Poco::RegularExpression::match(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, unsigned long, std::__1::vector<Poco::RegularExpression::Match, std::__1::allocator<Poco::RegularExpression::Match> >&, int) const in libfoundation.a(RegularExpression.cpp.o)
      Poco::RegularExpression::substOne(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >&, unsigned long, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int) const in libfoundation.a(RegularExpression.cpp.o)
  "_pcre_free", referenced from:
      Poco::RegularExpression::~RegularExpression() in libfoundation.a(RegularExpression.cpp.o)
  "_pcre_study", referenced from:
      Poco::RegularExpression::RegularExpression(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, int, bool) in libfoundation.a(RegularExpression.cpp.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Steps to Reproduce

  1. create a project folder.
  2. run buckaroo quickstart.
  3. run buckaroo install pocoproject/mongodb
  4. modify the file apps.cpp and add the code:
    
    #include <iostream>
    #include <Poco/MongoDB/MongoDB.h>
    #include <Poco/MongoDB/Connection.h>

int main() { Poco::MongoDB::Connection conexion(std::string("127.0.0.1"), 27017); std::cout << "Demo project. " << std::endl; return 0; }


5. Run `buck run :main`

## Context
Compilation process in projects with dependency `pocoproject/mongodb@1.7.8` will fail.

## Your Environment
* Version used: Buckaroo 1.2.1
* Operating System and Architecture: Mac OS X Sierra
njlr commented 7 years ago

Hi @ogranada I am on macOS so will take a look.

I remember when we ported Poco a while ago we only tested Linux, but adding macOS shouldn't be too hard.

njlr commented 7 years ago

I have made the fixes for macOS. Once the PR has been merged, please try again!

njlr commented 7 years ago

Test repo: https://github.com/njlr/buckaroo-test-poco-mongodb