Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build issues because of errors in Findpg.cmake #536

Open
yay opened this issue Aug 13, 2020 · 9 comments
Open

Build issues because of errors in Findpg.cmake #536

yay opened this issue Aug 13, 2020 · 9 comments
Labels
enhancement New feature or request

Comments

@yay
Copy link

yay commented Aug 13, 2020

Related issue: microsoft/vcpkg#12760

Screenshot 2020-08-13 at 21 08 47

@yay yay changed the title Build issues because or errors in Findpg.cmake Build issues because of errors in Findpg.cmake Aug 13, 2020
@an-tao
Copy link
Member

an-tao commented Aug 13, 2020

Sorry, I mainly created the vcpkg port for installation on Windows. I rarely tested it on other platforms. I will try to fix it.

@an-tao
Copy link
Member

an-tao commented Aug 13, 2020

@interfector18 , Do you have any suggestions? thank you.

@an-tao
Copy link
Member

an-tao commented Aug 13, 2020

The PostgreSQL::PostgreSQL target is supported after 3.15 version of cmake, it can cause more errors on user platforms with older versions of cmake installed, so we can't depend on it.

@an-tao
Copy link
Member

an-tao commented Aug 14, 2020

drogon_port.patch.gz
@yay please check this patch. thanks. if it works, I will submit a PR to vcpkg.

@yay
Copy link
Author

yay commented Aug 14, 2020

@an-tao Thanks for the patch. After applying it, the vcpkg install drogon worked:

The package drogon:x64-osx provides CMake targets:

    find_package(Drogon CONFIG REQUIRED)
    # Note: 4 target(s) were omitted.
    target_link_libraries(main PRIVATE pg_lib UUID_lib coz::coz MySQL_lib)

However, when added to CMakeLists.txt I see the following error:

[cmake] CMake Error at /Users/vitaliikravchenko/tools/vcpkg/scripts/buildsystems/vcpkg.cmake:343 (_add_executable):
[cmake]   Target "drogon" links to target "coz::coz" but the target was not found.
[cmake]   Perhaps a find_package() call is missing for an IMPORTED target, or an
[cmake]   ALIAS target is missing?

When I remove the coz::coz from target_link_libraries, I'm able to configure the project.

But the simple example app fails to compile:

[main] Building folder: drogon main
[build] Starting build
[proc] Executing command: /usr/local/bin/cmake --build /Users/vitaliikravchenko/projects/drogon/build --config Debug --target main -- -j 18
[build] Scanning dependencies of target main
[build] [ 50%] Building CXX object CMakeFiles/main.dir/main.cpp.o
[build] [100%] Linking CXX executable main
[build] Undefined symbols for architecture x86_64:
[build]   "Json::Value::Value(Json::ValueType)", referenced from:
[build]       drogon::PluginBase::PluginBase() in main.cpp.o
[build]   "Json::Value::~Value()", referenced from:
[build]       drogon::PluginBase::~PluginBase() in main.cpp.o
[build]   "drogon::DrClassMap::registerClass(std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, std::__1::function<drogon::DrObjectBase* ()> const&)", referenced from:
[build]       std::__1::enable_if<std::is_default_constructible<drogon::plugin::SecureSSLRedirector>::value, void>::type drogon::DrObject<drogon::plugin::SecureSSLRedirector>::DrAllocator::registerClass<drogon::plugin::SecureSSLRedirector>() in main.cpp.o
[build]       std::__1::enable_if<std::is_default_constructible<drogon::IntranetIpFilter>::value, void>::type drogon::DrObject<drogon::IntranetIpFilter>::DrAllocator::registerClass<drogon::IntranetIpFilter>() in main.cpp.o
[build]       std::__1::enable_if<std::is_default_constructible<drogon::LocalHostFilter>::value, void>::type drogon::DrObject<drogon::LocalHostFilter>::DrAllocator::registerClass<drogon::LocalHostFilter>() in main.cpp.o
[build]       std::__1::enable_if<std::is_default_constructible<drogon::NotFound>::value, void>::type drogon::DrObject<drogon::NotFound>::DrAllocator::registerClass<drogon::NotFound>() in main.cpp.o
[build]   "drogon::HttpAppFramework::instance()", referenced from:
[build]       drogon::app() in main.cpp.o
[build]   "trantor::Logger::stream()", referenced from:
[build]       drogon::DrClassMap::demangle(char const*) in main.cpp.o
[build]   "trantor::Logger::Logger(trantor::Logger::SourceFile, int, trantor::Logger::LogLevel)", referenced from:
[build]       drogon::DrClassMap::demangle(char const*) in main.cpp.o
[build]   "trantor::Logger::~Logger()", referenced from:
[build]       drogon::DrClassMap::demangle(char const*) in main.cpp.o
[build]   "typeinfo for drogon::LocalHostFilter", referenced from:
[build]       drogon::DrObject<drogon::LocalHostFilter>::DrAllocator::className() const in main.cpp.o
[build]   "typeinfo for drogon::IntranetIpFilter", referenced from:
[build]       drogon::DrObject<drogon::IntranetIpFilter>::DrAllocator::className() const in main.cpp.o
[build]   "typeinfo for drogon::plugin::SecureSSLRedirector", referenced from:
[build]       drogon::DrObject<drogon::plugin::SecureSSLRedirector>::DrAllocator::className() const in main.cpp.o
[build]   "typeinfo for drogon::NotFound", referenced from:
[build]       drogon::DrObject<drogon::NotFound>::DrAllocator::className() const in main.cpp.o
[build]   "VTT for drogon::LocalHostFilter", referenced from:
[build]       drogon::LocalHostFilter::LocalHostFilter() in main.cpp.o
[build]   "VTT for drogon::IntranetIpFilter", referenced from:
[build]       drogon::IntranetIpFilter::IntranetIpFilter() in main.cpp.o
[build]   "VTT for drogon::plugin::SecureSSLRedirector", referenced from:
[build]       drogon::plugin::SecureSSLRedirector::SecureSSLRedirector() in main.cpp.o
[build]   "VTT for drogon::NotFound", referenced from:
[build]       drogon::NotFound::NotFound() in main.cpp.o
[build]   "vtable for drogon::LocalHostFilter", referenced from:
[build]       drogon::LocalHostFilter::LocalHostFilter() in main.cpp.o
[build]   NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
[build]   "vtable for drogon::IntranetIpFilter", referenced from:
[build]       drogon::IntranetIpFilter::IntranetIpFilter() in main.cpp.o
[build]   NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
[build]   "vtable for drogon::plugin::SecureSSLRedirector", referenced from:
[build]       drogon::plugin::SecureSSLRedirector::SecureSSLRedirector() in main.cpp.o
[build]   NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
[build]   "vtable for drogon::NotFound", referenced from:
[build]       drogon::NotFound::NotFound() in main.cpp.o
[build]   NOTE: a missing vtable usually means the first non-inline virtual member function has no definition.
[build] ld: symbol(s) not found for architecture x86_64
[build] clang-10: error: linker command failed with exit code 1 (use -v to see invocation)
[build] make[3]: *** [main] Error 1
[build] make[2]: *** [CMakeFiles/main.dir/all] Error 2
[build] make[1]: *** [CMakeFiles/main.dir/rule] Error 2
[build] make: *** [main] Error 2
[cmakefileapi-parser] Code model version (2.1) of cmake-file-api is unexpected. Expecting (2.0). IntelliSense configuration may be incorrect.
[cmakefileapi-parser] Code model version (2.1) of cmake-file-api is unexpected. Expecting (2.0). IntelliSense configuration may be incorrect.
[build] Build finished with exit code 2

@an-tao
Copy link
Member

an-tao commented Aug 14, 2020

Just use the defaut CMakeLists.txt generated by drogon_ctl create project:

find_package(Drogon CONFIG REQUIRED)
target_link_libraries(${PROJECT_NAME} PRIVATE Drogon::Drogon)

@yay
Copy link
Author

yay commented Aug 15, 2020

That worked, thank you.

@an-tao an-tao added the enhancement New feature or request label Aug 15, 2020
@an-tao
Copy link
Member

an-tao commented Aug 19, 2020

@yay , I've update the vcpkg, microsoft/vcpkg#12931 (comment), please check it. thanks.

@yay
Copy link
Author

yay commented Aug 20, 2020

@an-tao There was only a single error:
Screen Shot 2020-08-20 at 01 57 07
It doesn't seem like MariaDB is optional, I had to run brew install mariadb in order for vcpkg install drogon to complete successfully.

Other than that it works, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants