We have 2 libraries - Google Protobuf (version 4.2) and a library 'X'.. a particular object of X when initialized uses certain functions of protobuf, thus resulting in a crash of our application, as library X is getting linked first followed by Protobuf.. How can we ensure that library X would get linked only once Protobuf is done? Do we have some linker option/flag to do the same?
1
There are 1 best solutions below
Related Questions in LINKER-ERRORS
- Can't build ios app with 64bit Support
- Mach-o Linker Error
- opencv 3.0.0 linker error when instantiating Mat object
- Linker cannot find existing Static Library File
- SFML and VS2013 - WinMain/main linker error
- Connecting C++ and Postgresql
- VS2013 Unresolved External with constructor and destructor
- Error: ld returned 1 exit status June 2015
- GHC undefined reference to Paths in dependency
- CUDA __device__ Unresolved extern function
- Xtensa --- dangerous relocation: windowed long call crosses 1GB boundary
- Static Initialization order fiasco: how can we ensure that library X would get linked only once Protobuf is done?
- xCode ld library not found in release mode and duplicate symbols in debug mode
- link.exe returns error LNK1181: cannot open input file 'C:\Program.obj'
- Train net using caffe DLL in C++
Related Questions in STATIC-ORDER-FIASCO
- Static Initialization order fiasco: how can we ensure that library X would get linked only once Protobuf is done?
- Why is Static Initialization Order Fiasco called this way?
- In C++, can I safely initialize an unordered_map with values from different files?
- Correctly initializing static array of objects without encountering initialization order fiasco using object references
- Do we have a static initialisation order fiasco while initialising variables inside the class
- Reproducing static initialization order fiasco in C++
- In C++ are simple initializations of built-in type immune to the static initialization order fiasco?
- Compile multiple source files in an Autoconf test
- Can C++20 `constinit` waive the need for nifty counter idiom?
- Is the order of file-level static variables always the same within a given translation unit?
- Nifty/Schwarz counter, standard compliant?
- Deferred initialisation order in C++11
- Calling a function of another translation unit can cause static initialization order fiasco
- Initialization order guarantees for inline-initialized static const class member
- c++ static initialization order fiasco
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
Yes, initialization order of different compilation units has undefined behavior. I often rely on a Singleton or a Factory to impose a proper initialization order.