mystor / rust-cpp

Embed C++ directly inside your rust code!
Apache License 2.0
798 stars 44 forks source link

Invalid escape sequences in #line directives on Windows #48

Closed vadimcn closed 5 years ago

vadimcn commented 5 years ago

On Windows, cpp_build generates the following #line directive inside cpp_closures.cpp:

#line 245 "C:\Users\vadimcn\.cargo\registry\src\github.com-1ecc6299db9ec823\cpp_build-0.5.1\src\lib.rs"

MSVC doesn't seem to mind, but when compiling for x86_64-pc-windows-gnu target, GCC produces a bunch of warnings and errors like these: warning: unknown escape sequence: '\.' error: incomplete universal character name \U

ogoffart commented 5 years ago

Thanks for the bug repport. I've been wondering why there was such warnings in the CI output. Now I know. Should be fixed with https://github.com/mystor/rust-cpp/pull/49

m-hilgendorf commented 5 years ago

Just a heads up- this fix isn't published on crates.io. To use the GNU toolchain right now you need to specify the git repo in your manifest.

ogoffart commented 5 years ago

By mistake, I pasted the wrong issue in commit 98c1f5b. it did not fix this issue, but the issue #52

Anyway, this issue was already fixed so it is fine to close it. (Even if there is no updated version on crates.io yet)

pfmoore commented 5 years ago

Possibly a dumb question (I'm very new to rust) but I'm hitting this error when trying to build https://github.com/uutils/coreutils - how can I work around it? (Or do I simply need to wait for a new release of rust-cpp?

ogoffart commented 5 years ago

Make sure to use the version 0.5.2 of the cpp and cpp_build crate