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

Including AWS Common as an External Project #887

Closed
disa6302 opened this issue Feb 14, 2022 · 2 comments
Closed

Including AWS Common as an External Project #887

disa6302 opened this issue Feb 14, 2022 · 2 comments
Assignees
Labels
guidance Question that needs advice or information. investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 This is a standard priority issue

Comments

@disa6302
Copy link

disa6302 commented Feb 14, 2022

I am trying to include aws-c-common as an external project in my CMake file and I am linking library as aws-c-common in target link libraries. This is the external project:

cmake_minimum_required(VERSION 3.6.3)

project(libawscommon-download NONE)
include(ExternalProject)

ExternalProject_Add(project_libawscommon
    GIT_REPOSITORY    https://github.com/awslabs/aws-c-common.git
    GIT_TAG                    v0.6.13
    CMAKE_ARGS        -DCMAKE_INSTALL_PREFIX=${OPEN_SRC_INSTALL_PREFIX}
)

The error I am seeing is this on MacOS Bigsur:

Undefined symbols for architecture x86_64:
  "_CFAllocatorCreate", referenced from:
      _aws_wrapped_cf_allocator_new in libaws-c-common.a(allocator.c.o)
  "_CFRelease", referenced from:
      _aws_wrapped_cf_allocator_destroy in libaws-c-common.a(allocator.c.o)
  "___CFConstantStringClassReference", referenced from:
      CFString in libaws-c-common.a(allocator.c.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

I see a static library in the following path: ${OPEN_SRC_INSTALL_PREFIX}/lib/libaws-c-common.a

What could be going wrong here?

@disa6302
Copy link
Author

I got it working by adding "-framework CoreFoundation" in target-link-libraries. I see that this is being set here:

list(APPEND PLATFORM_LIBS dl Threads::Threads "-framework CoreFoundation")

Any reason why this might not be migrating to upstream CMake projects?

@jmklix jmklix self-assigned this Sep 21, 2023
@jmklix jmklix added investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 This is a standard priority issue guidance Question that needs advice or information. labels Sep 21, 2023
@jmklix
Copy link
Member

jmklix commented Feb 7, 2024

I'm not sure why this wouldn't be migrating to upstream CMake projects. But I'm glad that you where able to get it working. Please let know if you have any other problems with aws-c-common.

@jmklix jmklix closed this as completed Feb 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
guidance Question that needs advice or information. investigating This issue is being investigated and/or work is in progress to resolve the issue. p2 This is a standard priority issue
Projects
None yet
Development

No branches or pull requests

2 participants