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

L

ligong.yang

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
 
D

David Harmon

On 27 Dec 2006 16:24:19 -0800 in comp.lang.c++, (e-mail address removed)
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,152
Members
46,697
Latest member
AugustNabo

Latest Threads

Top