-
Notifications
You must be signed in to change notification settings - Fork 21
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
fatal error: 'chrono' file not found #2
Comments
After a quick search, I came up with this: http://urfoex.blogspot.com/2012/06/c11-fixing-bug-to-use-chrono-with-clang.html There's a link to a patch....I'll just quote the page verbatim: """Funny thing: there is a fix to it: So I tried the following:
I'm not sure if that will fix the issue, but I wrote the library using C++11 features, the latest GCC should support all of the ones I've used. (VS2012 has the least, of the two). |
Maybe there's an easy way to use boost as a substitute for missing C++11 features? |
Also, you may want to check this: http://stackoverflow.com/questions/4574246/can-i-use-c11-with-xcode |
I installed gcc-4.7 and it now complains about conio.h. mymacmini:LibusbTest xiaofanc$ g++-4.7 -I../headers LibusbTest.cpp -o LibusbTestIn file included from /usr/local/Cellar/gcc/4.7.1/gcc/lib/gcc/x86_64-apple-darwin11.4.0/4.7.1/../../../../include/c++/4.7.1/chrono:35:0, mymacmini:LibusbTest xiaofanc$ g++-4.7 -std=c++11 -I../headers LibusbTest.cpp -o LibusbTest |
BTW, I install gcc-4.7 using Homebrew-dupes gcc formula for my Mac (OS X Lion 10.7.4). mymacmini:LibusbTest xiaofanc$ g++-4.7 -v |
Wow, after a minute of digging, it looks like conio.h is actually non-standard! I used it simply to provide a way to pause to read the output. I guess I need to pickup a mac-mini... |
The conio issue should be fixed now. |
Thanks, now the conio issue is fixed but there are more problems. I guess the C++11 support mymacmini:LibusbTest xiaofanc$ g++-4.7 -std=c++11 -I../headers LibusbTest.cpp -o LibusbTest |
Actually, these are all issues with the C library funcitons, (as well as the exception class). Looks like the microsoft compiler allows construction of an exception with a string parameter where it probably shouldn't be ...breaking compatibility. No C++11 related errors there! (whew!) As for the memset errors, I'm not sure why I never got an error on that. I suspect it was included as part of <wchar.h>. I've changed all references to use std::fill instead. The strlen/strcpy methods should be in : once again there's no errors from windows helping me out here. But I believe I have ironed out all of the issues about I may soon have some Mac hardware to test this out on so I can support this better. |
You can also install virtualbox and create a virtual machine with Ubuntu (or anther GNU/Linux system) inside. Apple uses LLVM/clang instead of GCC. So you may find differences. |
Great, now the compiling issue is gone. But how to build the library itself? Could you provide a Makefile? mymacmini:LibusbTest xiaofanc$ g++-4.7 -std=c++11 -I../headers LibusbTest.cpp -o LibusbTest |
...and here I was thinking that the library was already compiled! :-) I'll need a mac for product testing anyway, I should be able to test under every OS w/one machine then. |
std::exception has no constructor which takes a c-string as argument, this seems to be Microsoft specific. See: http://stackoverflow.com/a/1570192 Error was: error: no matching function for call to 'std::exception::exception(const char [X])' Related-to-issue: zarthcode#2 Related-to-issue: zarthcode#4 Signed-off-by: Stephan Linz <[email protected]>
Warning was (gcc): .../examples/LibusbTest.cpp: In function ‘int main(int, char**)’: .../examples/LibusbTest.cpp:481:82: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] std::shared_ptr<unsigned char> pPingString = allocString("PING!", pingDataSize); ^ .../examples/LibusbTest.cpp:625:84: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] std::shared_ptr<unsigned char> pPingString = allocString("apostle", pingDataSize); ^ .../examples/LibusbTest.cpp:768:84: warning: deprecated conversion from string constant to ‘char*’ [-Wwrite-strings] std::shared_ptr<unsigned char> pPingString = allocString("apostle", pingDataSize); ^ Warning was (clang): .../examples/LibusbTest.cpp:481:61: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] ...std::shared_ptr<unsigned char> pPingString = allocString("PING!", pingDa... ^ .../examples/LibusbTest.cpp:625:61: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] ...std::shared_ptr<unsigned char> pPingString = allocString("apostle", ping... ^ .../examples/LibusbTest.cpp:768:61: warning: ISO C++11 does not allow conversion from string literal to 'char *' [-Wwritable-strings] ...std::shared_ptr<unsigned char> pPingString = allocString("apostle", ping... ^ Related-to-issue: zarthcode#2 Signed-off-by: Stephan Linz <[email protected]>
On Mac OS X I have:
The text was updated successfully, but these errors were encountered: