Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8750941
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:57:13+00:00 2026-06-13T12:57:13+00:00

I want to generate some random double numbers using default_random_engine and uniform_real_distribution in header

  • 0

I want to generate some random double numbers using default_random_engine and uniform_real_distribution in header random.

I use Eclipse for C/C++ & MinGW to build my project.

  • Eclipse version: 4.2.1
  • Eclipse CDT C/C++ Development Tools version: 8.1.1.201209170703
  • Eclipse CDT GCC Cross Compiler Support version: 1.1.0.201209170703
  • MinGW version: 4.6.2(checked using “gcc -v”)

When I type std::default_random_engine in the editor, Eclipse prompts me that “Type ‘std::default_random_engine’ could not be resolved”.

I have already configured my project to support C++11 features

  • Open Project Properties->C/C++ Build ->Settings->Tool Settings->GCC C++ Compiler->Miscellaneous->Other Flags. Put “-std=c++0x” at the end
  • Project Properties->C/C++ General->Preprocessor Include Paths, Macros->[Providers] tab->your Built-in Compiler Settings provider (toolchain dependent). Click on “Workspace Settings” link which gets you to “Settings” property page, select [Discovery] tab and your provider again. There is “Command to get compiler specs”, add “-std=c++0x” in there.

Then I wrote a list initialized vector and a range for to test the support of the C++11, the code work fine.

    vector<int> ivec = {1, 2, 3};
    for (int i : ivec)
        cout << i << " ";
    cout << endl;

What’s wrong with the “std::default_random_engine”, what should I do to fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:57:14+00:00Added an answer on June 13, 2026 at 12:57 pm

    UPDATE: It’s been a long time since I posted the original answer and it has become outdated. I double-checked today (Mar 15, 2014): in Eclipse Kepler (Build id 20130614-0229) it is sufficient to

    • add under Project > Properties > C/C++ Build > Settings then on the Tool Settings tab GCC C++ Compiler > Miscellaneous the -std=c++11 flag,

    • then under Window > Preferences > C/C++ > Build > Settings on the Discovery tab chose CDT GCC Built-in Compiler Settings and add the -std=c++11 flag to Command to get compiler specs. On my machine it looks like this after the change:

      ${COMMAND} -E -P -v -dD -std=c++11 "${INPUTS}"

    • clean and rebuild both your project and your index (Project > C/C++ Index > Rebuild) as Eclipse tends to cache error messages and show them even though they are gone after changing the settings.

    This works on my machine for sure. If it doesn’t on yours, then you might want to give a shot to this: C++11 full support on Eclipse although I am neither sure about the correctness of this approach nor was it necessary to do it on my machine. As of March 7, 2014 users claim that it helped them whereas the above approach didn’t.


    The original post, now outdated:

    It seems to be a false error from the IDE.

    Click on the project properties, then C/C++ General > Code Analysis > Syntax and Semantic Errors and deselect Type cannot be resolved.

    I also had to disable a bunch of other Syntax and Semantic Errors, such as Invalid arguments, Invalid overload, Symbol is not resolved, etc. in my own projects. These bogus errors come from Codan.

    (You might have to add __GXX_EXPERIMENTAL_CXX0X__ to your defines / preprocessor macros, not sure about this one though.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to generate some 8-bit random numbers with C++ and don't want to
Using java I want to generate some random values in one program and then
I want to generate unique and random numbers or IDs which I can use
I want to generate (pseudo) random numbers between 0 and some integer. I don't
I am actually writing a program to generate some truely random numbers. So, i
I want to generate some random IP Address. But evertime this generateIPAddress function returns
I need to generate some random numbers in C for testing and debugging the
I want to collect the best way to generate random numbers on all four
i want to generate an array of random numbers for example if the range
Hi I want to generate some random matrices of size Nx3 for varying N,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.