Forum Discussion
Problems with the chrono library in NIOS II
- 1 year ago
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
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
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