[cfe-dev] libcxx: Platform independent printing using format constants

Jordan Rose jordan_rose at apple.com
Wed Oct 10 18:23:03 PDT 2012


The library name is libc++, not libcxx. Try -stdlib=libc++ instead.

…but if it's really not working, that's a bug.


On Oct 10, 2012, at 12:53 , Daniel Hofmann <daniel at trvx.org> wrote:

> Hi,
> 
> I'm currently porting a program from g++/libstdc++ to clang/libcxx and
> was quite surprised that the platform independent printing using format
> constants, e.g. PRId64, produces errors with libcxx.
> 
> A simple example which compiles fine w/o libcxx or g++
>> #include <cstdio>
>> #include <cinttypes>
>> 
>> int main() {
>>  int64_t n = 1;
>> 
>>  printf("%" PRId64, n);
>> }
> 
> w/ -stdlib=libcxx
>> +7:14: error: expected ')'
>>  printf("%" PRId64, n);
>>             ^
>> +7:9: note: to match this '('
>>  printf("%" PRId64, n);
>>        ^
> 
> Although the cinttypes header comments lists them
>> Macros:
>>    ...
>>    PRId64
> 
> 
> So, what am I missing here? Is this not yet supported? How am I supposed
> to handle this?
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev





More information about the cfe-dev mailing list