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

Newbie question: How to build shared libraries without modifying CMakeLists? #3849

Closed
yxiang92128 opened this issue Jul 26, 2022 · 5 comments
Assignees
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files)

Comments

@yxiang92128
Copy link

Is there a way to build Shared libraries instead of the static libraries straight from the source?

thanks,

Yang

@ghost ghost added needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that labels Jul 26, 2022
@Jinming-Hu
Copy link
Member

Jinming-Hu commented Jul 26, 2022

I always have the same problem. I remember building dll worked some time ago, then some day it didn't work anymore. @RickWinter Can you have somebody take a look?

I tested again, now it works.

@Jinming-Hu Jinming-Hu assigned Jinming-Hu and unassigned RickWinter Jul 26, 2022
@Jinming-Hu Jinming-Hu added Client This issue points to a problem in the data-plane of the library. Storage Storage Service (Queues, Blobs, Files) labels Jul 26, 2022
@ghost ghost removed the needs-triage Workflow: This is a new issue that needs to be triaged to the appropriate team. label Jul 26, 2022
@Jinming-Hu
Copy link
Member

Hi @yxiang92128 , I just tested on ubuntu 20. I built with command cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON. It works.

Can you share your env and the command you used?

@steve-madden
Copy link

When targeting windows, static linkage for opentelemetry-cpp is required as the sdk is header-only. See open-telemetry/opentelemetry-cpp#1105

This is enforced in the vcpkg port. (see https://github.com/microsoft/vcpkg/blob/master/ports/opentelemetry-cpp/portfile.cmake)

Attempting to build the default cmake target fails:

C:\Users\smadden\dev\Azure\azure-sdk-for-cpp\build❯ cmake ..
No transport adapter was selected, using WinHTTP as the default option for Windows.
-- Running vcpkg install
Error: opentelemetry-cpp:[email protected] is only supported on '!(windows & !static)'

-- Running vcpkg install - failed
CMake Error at build/_deps/vcpkg-src/scripts/buildsystems/vcpkg.cmake:850 (message):
  vcpkg install failed.  See logs for more information:
  C:\Users\smadden\dev\Azure\azure-sdk-for-cpp\build\vcpkg-manifest-install.log
Call Stack (most recent call first):
  C:/Program Files/CMake/share/cmake-3.20/Modules/CMakeDetermineSystem.cmake:123 (include)
  CMakeLists.txt:26 (project)

@Jinming-Hu
Copy link
Member

@steve-madden Yes, I am aware of this problem. But @yxiang92128 is working on Linux, so I assume he's referring to a different problem.

@steve-madden Do you mind opening a separate issue to track the one caused by opentelemetry?

@yxiang92128
Copy link
Author

cmake .. -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=ON

@Jinming-Hu your sample command line worked!! I forgot to put a "D" in front of the BUILD_SHARED_LIBS. My misteake.
Thanks!

@github-actions github-actions bot locked and limited conversation to collaborators Apr 11, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Client This issue points to a problem in the data-plane of the library. customer-reported Issues that are reported by GitHub users external to the Azure organization. question The issue doesn't require a change to the product in order to be resolved. Most issues start as that Storage Storage Service (Queues, Blobs, Files)
Projects
None yet
Development

No branches or pull requests

4 participants