- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Even though the includes in the bsp has the chrono library and #include<chrono> doesn't throw any error, when the library is used, there is always an error
For Example,
when I use "std::chrono::high_resolution_clock::duration timeout = std::chrono::seconds(0)" the following error is thrown:
Multiple markers at this line
- Type 'std::chrono::high_resolution_clock::duration' could not be
resolved
- Function 'seconds' could not be resolved.
I am using a NIOS II/e core in Quartus Prime Lite 18.0 for Max 10.
P.S. The exact same piece of code works in normal C++ environment but not in NIOS II environment.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi CaptainPrice15,
The screenshot is just to show the application is able to run with the chrono library.
Try to compile/build all even when you see the errors while editing the code.
Thanks.
Regards,
Aik Eu
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi CaptainPrice15,
Just a simply quick check, If you try the below, will there be any error?
#include <iostream>
#include <chrono>
int main ()
{
using namespace std::chrono;
// std::chrono::milliseconds is an
// instantiation of std::chrono::duration:- 1 second
milliseconds mil(1000);
mil = mil*60;
std::cout << "duration (in periods): ";
std::cout << mil.count() << " milliseconds.\n";
return 0;
}
Thanks.
Regards,
Aik Eu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello @aikeu,
Thanks a lot for your reply.
Yes, there will be an error in the code. In the line "using namespace std::chrono;" it says Symbol chrono could not be resolved.
I have checked that the chrono library is present in includes and is under path "Quartus installation path"/nios2eds/bin/gnu/nios2-elf/include/c++/5.3.0
In project properties, under Nios II Application Properties, the user flag -std=c++11 is also specified (as chrono library requires atleast C++11) and ofcourse the BSP project is linked as well.
Best Regards
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi CaptainPrice15,
Sorry for late reply, with the help of my team member he was able to notice the error but you can proceed to build all for the program to work.
Thanks.
Regards,
Aik Eu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @aikeu ,
Thanks a lot for your reply.
It is a bit bit difficult to understand the solution just from this screenshot. Could you please explain in detail what exactly the solution is and how can I use the chrono library in NIOS II?
Thanks in advance.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi CaptainPrice15,
I will close the thread if no further feedback from the case.
Thanks.
Regards,
Aik Eu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi CaptainPrice15,
The screenshot is just to show the application is able to run with the chrono library.
Try to compile/build all even when you see the errors while editing the code.
Thanks.
Regards,
Aik Eu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @aikeu ,
Thanks for the quick reply. I did try that. But as said before, the code doesn't build and the compiler throws the above mentioned errors.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi CaptainPrice15,
Let me check back with my team member who managed to build an example application and get back to you next week, he is on leave today.
With build all, supposed you will see the BSP build complete and generate the elf file to run the application. Let me show some additional screenshots after this.
Thanks.
Regards,
Aik Eu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi @aikeu
Thanks for your support. The problem has been resolved. The problem was apparently with std::chrono::high_resolution_clock::duration. Replaced that with std::chrono::_V2::system_clock::duration and it works now.
As you said, it still throws an error while editing the code (which can be ignored) but it does build properly.
Thanks a lot once again!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi CaptainPrice15,
Glad to hear that the issue has been resolved, I now transition this thread to community support. If you have a new question, Please login to ‘https://supporttickets.intel.com/s/?language=en_US’, view details of the desire request, and post a feed/response within the next 15 days to allow me to continue to support you. After 15 days, this thread will be transitioned to community support. The community users will be able to help you on your follow-up questions.
Thanks.
Regards,
Aik Eu

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page