Comments (5)
The following two stack overflow questions seem to be relevant:
http://stackoverflow.com/questions/8685045/xcode-with-boost-linkerid-warning-about-visibility-settings
http://stackoverflow.com/questions/9894961/strange-warnings-from-the-linker-ld
From those posts I guess that this problem might be due to using tinyformat in two different projects with different default symbol visibilities, and then linking them together? In that case it's not a tinyformat problem per se - you should check your settings for "Symbols Hidden by Default" in xcode for both projects.
Can you tell me the compiler and version? Based on the error message, I'm assuming it's gcc.
from tinyformat.
Compiler is Apple LLVM version 6.0 (clang-600.0.57) (based on LLVM 3.5svn)
Most likely you are right, the problem is in project visibility settings.
I am using following setup:
- Static library that uses tinyformat. It has Symbols Hidden by Default set to NO. This is default XCode setting for static libraries.
- Application that uses both static library and tinyformat. It has Symbols Hidden by Default set to YES. This is default XCode setting for applications.
Since this is standard setup, I am not sure I want to change visibility settings. Do you think there is a possibility to change it in tinyformat?
from tinyformat.
There might be a workaround we could do in the source code. Perhaps it's as simple as adding __attribute__((visibility("hidden")))
attributes in a couple of places in the private FormatArg
thunks? This would need to be behind a macro (TINYFORMAT_HIDDEN
?) so that it doesn't mess up MSVC compatibility.
I can't reproduce this problem on linux with g++-4.8.2 or clang++-3.5, and I don't have ready access to OSX, but maybe you can get a cut down example going. Here's what I did:
Makefile:
CXX=clang++-3.5
INCLUDE=-I$(HOME)/dev/tinyformat
all: main
foo.o: Makefile foo.cpp foo.h
$(CXX) -Wall $(INCLUDE) -c -fvisibility=default foo.cpp
test.o: Makefile test.cpp foo.h
$(CXX) -Wall $(INCLUDE) -c -fvisibility=hidden test.cpp
main: Makefile test.o foo.o
$(CXX) -Wall test.o foo.o -o main
foo.h:
#pragma once
void foo();
foo.cpp:
#include <tinyformat.h>
#include "foo.h"
void foo()
{
tfm::printf("%d\n", 2);
}
test.cpp:
#include <tinyformat.h>
#include "foo.h"
int main()
{
foo();
tfm::printf("%d\n", 1);
return 0;
}
from tinyformat.
I compiled your example and was able to reproduce the warning. The fix that you suggested worked well, thanks! I created a pull request #26
from tinyformat.
Fixed by #26
from tinyformat.
Related Issues (20)
- Support for POSIX extension of positional arguments HOT 2
- const std::atomic actual parameter with requested alignment of 8 won't be aligned HOT 3
- Usage question: How to NOT display a parameter? HOT 1
- puts HOT 6
- Segmentation Fault with Intel Compiler HOT 10
- Cannot print volatile variables: error: invalid static_cast from type const volatile unsigned int* to type const void* HOT 1
- Why only 16 parameters instead of 32, 64, 128? HOT 7
- Use typename instead of class on TINYFORMAT_ARGTYPES? HOT 2
- Template program to count the number of format specifiers and check if they match the arguments count HOT 2
- Cannot print function pointer HOT 13
- Issues found during tinyformat audit (part of Bitcoin Core audit) HOT 5
- How to override the formatValue function?
- error: invalid static_cast from type โconst void*โ to type โvoid (*)()โ HOT 1
- Alter repository title or decouple from standard streams HOT 2
- Formatting NaN or infinity with explicit precision injects spurious zeros HOT 2
- Multiple symbol definitions after commit 9368985 HOT 2
- Passing -INF through %.16d still puts the minus sign at far-left HOT 1
- Different output for earlier compilers HOT 1
- Not enough conversion specifiers in format string HOT 4
- Update minimum CMake version
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. ๐๐๐
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google โค๏ธ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from tinyformat.