Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Language IDEs » C / C++ IDE (CDT) » mt19937 could not be resolved
mt19937 could not be resolved [message #1564417] Wed, 14 January 2015 19:49 Go to next message
Carlos Lomeli is currently offline Carlos LomeliFriend
Messages: 2
Registered: December 2014
Junior Member
Well i´m trying to generate random numbers using mt19937, I keep getting the following error:
mt19937 could not be resolved

I already tried the solutions described in other forums like this one:
stackoverflow.com/questions/9131763/eclipse-cdt-c11-c0x-support
but nothing has worked so far.

I hope you can help me out.

Thanks, and here is my code in case you need it.

#include<iostream>
#include<string>
#include<random>
#include<ctime>

using namespace std;

int main()
{

mt19937 randomGenerator(time(0));
uniform_int_distribuition<int> diceroll(1,6);

cout << "I am rolling a " << diceroll(randomGenerator) << endl;
cout << "I am rolling a " << diceroll(randomGenerator) << endl;
cout << "I am rolling a " << diceroll(randomGenerator) << endl;

uniform_real_distribuition<float> attackroll(0.0f,1.0f);

cout << "I am attacking a snake " << attackroll(randomGenerator) << endl;

float attack = attackroll(randomGenerator);

if (attack < 0.3f)
{
cout << "I hit the snake!" << endl;
} else {
cout << "I missed the snake!" << endl;
}

return 0;

}
Re: mt19937 could not be resolved [message #1565971 is a reply to message #1564417] Thu, 15 January 2015 15:49 Go to previous message
Joost Kraaijeveld is currently offline Joost KraaijeveldFriend
Messages: 273
Registered: July 2009
Senior Member
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 14-01-15 20:49, Carlos Lomeli wrote:
> Well i´m trying to generate random numbers using mt19937, I keep
> getting the following error: mt19937 could not be resolved
>
> I already tried the solutions described in other forums like this
> one:
> stackoverflow.com/questions/9131763/eclipse-cdt-c11-c0x-support but
> nothing has worked so far.
>
> I hope you can help me out.
How do you spell distribution?
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iEYEARECAAYFAlS34aEACgkQ0VJKUkHcX7+SaQCdHL+MJpaqFSqwYS3kUKVAAnAI
FxUAniXsaNvc1DnvhG73YSRPi6F4Cc3X
=vkQJ
-----END PGP SIGNATURE-----


Cheers,

Joost
Previous Topic:Open Beta for Maestrosoft Studio plugin
Next Topic:Restart GDB HW Debugging.
Goto Forum:
  


Current Time: Fri Apr 19 13:44:11 GMT 2024

Powered by FUDForum. Page generated in 0.02102 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top