For C++, you need to do
[cpp]extern “C” get_value(
int idx,
int64_t* data);[/cpp]
If you you are using Questa, you should generate this header file from your SV code directly using the switch -dpiheader file.h. That way you can be sure at compile time that your arguments across the DPI match up.
One other tip about using DPI exports, make sure you use only SV tasks when your call might consume time, otherwise use stick with SV functions. There is some extra work to deal with process control if your process gets terminated.