473,406 Members | 2,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Help on using k.wilder's random number generator class in Visio C++ .Net

Hi all,

I got tortured by a very weird problem when I was using k. wilder's
random generator class in my program. PS: wilder's generator class can
be found at http://oldmill.uchicago.edu/~wilder/Code/random/.

Firstly, I got the notorious "fatal error C1010: unexpected end of file
while looking for precompiled header directive" error when I tried to
compile 'randtest.c' provided by wilder.

Then I use the solution of "creat new header file" in the project
properties to fix the problem. However, I got another series errors as
follows:
--------------------------------------------------------------------------------------------------------------------------------------------
randtest.cpp
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cerrno(18) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cerrno(18) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(17) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(17) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(17) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(17) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(17) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(17) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(18) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(18) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(18) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(18) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(18) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(18) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(19) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(19) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(19) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(19) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(19) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(19) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(20) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(20) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(20) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(20) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(20) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(20) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(21) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(21) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(21) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(21) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(21) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(21) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(22) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(22) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(22) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(22) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(22) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(22) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(23) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(23) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(23) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(23) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(23) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(23) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(24) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(24) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(24) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(24) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(24) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(24) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(25) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(25) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(25) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(25) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(26) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(26) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(26) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(26) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(27) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(27) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(27) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(27) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(27) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(27) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(28) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(28) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(28) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(28) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(28) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(28) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(29) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(29) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(29) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(29) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(29) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(29) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(30) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(30) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(30) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(30) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(30) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(30) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(31) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(31) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(31) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(31) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(31) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(31) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(32) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdio(32) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdlib(18) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdlib(18) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdlib(18) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdlib(18) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdlib(18) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdlib(18) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdlib(19) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdlib(19) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdlib(19) : error C2143: syntax error : missing '{'
before ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdlib(19) : error C2059: syntax error : ':'
d:\Program Files\Microsoft Visual Studio .NET
2003\Vc7\include\cstdlib(19) : error C2143: syntax error : missing '{'
before ':'
---------------------------------------------------------------------------------------------------------------------------------------------

It looks like I got something wrong in the standard lib-I dont know
what to do with this. Could anyone please help me out?

Cheers,

G

Dec 28 '06 #1
1 1894
On 27 Dec 2006 16:24:19 -0800 in comp.lang.c++, li*********@gmail.com
wrote,
>Firstly, I got the notorious "fatal error C1010: unexpected end of file
while looking for precompiled header directive" error when I tried to
compile 'randtest.c' provided by wilder.

Then I use the solution of "creat new header file" in the project
properties to fix the problem. However, I got another series errors as
follows:
Your problems have little to do with C++ programming.
Your problems are all about how to operate your compiler.

See the welcome message posted twice per week in comp.lang.c++ under the
subject "Welcome to comp.lang.c++! Read this first." or available at
http://www.slack.net/~shiva/welcome.txt

Don't create meaningless header files. Instead turn off the
precompiled headers options when you are not using them.

You don't need to post dozens of copies of copies of the same message.

Finally, you are compiling it as C instead of C++. Add the option to
always compile as C++, or change the file extension.

C:\USR\temp>cl /EHsc /TP randtest.c rng.c
Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for
80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

randtest.c
rng.c
Generating Code...
Microsoft (R) Incremental Linker Version 7.10.3077
Copyright (C) Microsoft Corporation. All rights reserved.

/out:randtest.exe
randtest.obj
rng.obj

Dec 28 '06 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

7
by: Chris Gordon-Smith | last post by:
I have a simulation program that calls the rand() function at various points while it executes. For the user interface that displays statistics etc. while the program runs, I use the Lazarus GUI...
2
by: Martin Ho | last post by:
Hi Everyone, I have this code of Mersenne twister, which produces the random numbers, one of the fastest codes as far as I know to produce random numbers. Anyways, it's writen in c# and I need to...
36
by: Cap'n Ahab | last post by:
I have used VB3 - VB6, so learning all this OO stuff is reasonably new to me (although I looked at Java a few years ago). Anyway, I thought I would write a small class to begin with, with a...
0
by: Limpor | last post by:
Hello, I am new to learning java, and i am trying to build the class for a calculation card game, unfortunately i can't get the public Card top() and Card takeTop() method in the Stock class. Can...
0
by: Limpor | last post by:
Hi, I’m working on a solitaire game as my course assignment, and I am having trouble to dealing with Stock class, which consists of an upturned top card plus deck. The code for Stock class: import...
16
by: Markus Dehmann | last post by:
According to several C++ tutorials, calling srand like this to initialize the random number generator seems to be standard: srand((unsigned)time(0)); But it leads to the same random number...
1
by: ligong.yang | last post by:
Hi all, I got tortured by a very weird problem when I was using k. wilder's random generator class in my program. PS: wilder's generator class can be found at...
4
by: UMstudent | last post by:
I'm working on this program for class where I have to an amount of numbers that are randomly picked from 0 - 50. So what I have done is say there are 20 slots in my array so I'm trying to generator...
16
by: raylopez99 | last post by:
For the public record. RL public void IterateOne() { Random myRandom = new Random(); //declare Random outside the iteration for (int j = 0; j < Max; j++) {
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.