0

I am using the C++ AMP tinymt library from Codeplex to generate random numbers. The library works fine, except that when I #include <amp_tinymt_rng.h> in two different files in the same project, linking errors arise mentioning redefintion of certain variables tinymt_lib::tinymt_dc_data and tinymt_dc_data_32.

What would be a good fix to get rid of this issue, given that I am using #pragma once in every header already? I am using Visual Studio 2013 Professional.

As a side suggestion, what would be a simpler way to generate random numbers without the overhead of a special library? I am not concerned about the sequence not being safely random, a simple random() or rand() be suffice.

Abhra Basak
  • 382
  • 4
  • 13

1 Answers1

0

This looks like an error in the way the library is written. It seems like the headers are fragile if included more than once. I'd suggest that you start a thread on the Parallel Computing in C++ and Native Code forum.

Ade Miller
  • 13,575
  • 1
  • 42
  • 75
  • I had reported the issue on Codeplex on the same day as this question was posted, and it got fixed 3 days later. :) – Abhra Basak Sep 05 '14 at 14:45