Problem with compiling c++ sources for windows

M

Michael Höing

Hi,

I tried to compile the following :
http://www.almaden.ibm.com/software/quest/Resources/datasets/data/assoc.gen.tar.Z
from
http://www.almaden.ibm.com/software/quest/Resources/datasets/syndata.html#assocSynData

I tried it on a unix machine and received the following error message:

zivunix:compile> make
xlC -+ -O -c -o ran1.o ran1.c
xlC -+ -O -c -o expdev.o expdev.c
xlC -+ -O -c -o gammln.o gammln.c
xlC -+ -O -c -o gasdev.o gasdev.c
xlC -+ -O -c -o poidev.o poidev.c
xlC -+ -O -c -o dist.o dist.c
xlC -+ -O -c -o gen.o gen.c
"gen.h", line 183.30: 1540-0063 (S) The text "StringSet" is unexpected.
make: *** [gen.o] Error 1
zivunix:compile>

How can I solve the problem? I also tried borlands bcc32 but also failed.
(I'm absolutely new to this topic).

Who can help? (Or better: Compile the files for windows and send it via
mail. Could not be much work - I think ?)

Regards - Michael
 
M

Michael Höing

Hi,
I charge $250/hr for remote compilation. And my modem is reaaaaaallllyyy
sssllooowwww...
IBAN, please:)

Ok - I tried cl (Visual C++) and bcc32 (Borland):

What I got using cl is:

_____________________________________
cl /TP *.c

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for 80x86
Copyright (C) Microsoft Corporation 1984-2002. All rights reserved.

command.c
e:\Eigene Dateien\SS05\MA\tool\gen.h(3) : fatal error C1083: Cannot open
include file: 'stream.h': No such file or directory
dist.c
dist.c(2) : fatal error C1083: Cannot open include file: 'values.h': No such
file or directory
expdev.c
gammln.c
gasdev.c
gen.c
e:\Eigene Dateien\SS05\MA\tool\gen.h(3) : fatal error C1083: Cannot open
include file: 'stream.h': No such file or directory
main.c
main.c(1) : fatal error C1083: Cannot open include file: 'fstream.h': No
such file or directory
poidev.c
ran0.c
ran1.c
Generating Code...
_____________________________________

So I looked for the missing files like stream.h and added them to the
include folder of the c++-compiler. But that also does not work (got more
and more errors). My next approach was using fstream.h instead of stream.h
in the #include statement of gen.h 'cause I found s.th. near it in the web.
But that also does not work.

So my question: What do I have to do in the case of missing "*.h"s ? (Every
compiler has its own *.h-files? And the files differ?)


regards - Michael
 
V

Victor Bazarov

Michael said:
[..]
Ok - I tried cl (Visual C++) and bcc32 (Borland):

What I got using cl is:

_____________________________________
cl /TP *.c

Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 13.10.3077 for
80x86 Copyright (C) Microsoft Corporation 1984-2002. All rights
reserved.
command.c
e:\Eigene Dateien\SS05\MA\tool\gen.h(3) : fatal error C1083: Cannot
open include file: 'stream.h': No such file or directory
dist.c
dist.c(2) : fatal error C1083: Cannot open include file: 'values.h':
No such file or directory
expdev.c
gammln.c
gasdev.c
gen.c
e:\Eigene Dateien\SS05\MA\tool\gen.h(3) : fatal error C1083: Cannot
open include file: 'stream.h': No such file or directory
main.c
main.c(1) : fatal error C1083: Cannot open include file: 'fstream.h':
No such file or directory
poidev.c
ran0.c
ran1.c
Generating Code...
_____________________________________

So I looked for the missing files like stream.h and added them to the
include folder of the c++-compiler. But that also does not work (got
more and more errors). My next approach was using fstream.h instead
of stream.h in the #include statement of gen.h 'cause I found s.th.
near it in the web. But that also does not work.

So my question: What do I have to do in the case of missing "*.h"s ?

Look for a reasonably old compiler.

Apparently the code you're trying to compile needs pre-standard headers
('fstream.h' etc.) That means about 7 years old.
(Every compiler has its own *.h-files? And the files differ?)

C++ compilers have C++ _headers_ (which are not necessarily files) and C
headers. Only old-style C headers have the .h in them. The C++ headers
do not have .h.

You indicated before that you downloaded this code from 'ibm.com'. Why
not ask IBM about that code?

V
 
M

Michael Höing

Hi,

thx for your help!
You indicated before that you downloaded this code from 'ibm.com'. Why
not ask IBM about that code?
I already did and still waiting for an answer.

Please allow me to ask again cause I tried again several things with the xlC
because IBM delivered a makefile which shouldn't make any trouble.

Everything seems to work fine - except one thing (as mentioned above in the
thread):
________________________________________
zivunix:compile> make
xlC -+ -O -c -o gen.o gen.c
"gen.h", line 183.30: 1540-0063 (S) The text "StringSet" is unexpected.
make: *** [gen.o] Error 1
zivunix:compile>
________________________________________

The error occurs at *** in the following class "extract":
________________________________________
class String
{
friend class StringSet;
LINT nitems; // number of items
Item *items; // list of the items
// FLOAT *rval; // random value (used to get random ordering of the items)
// Item *ritems; // randomly chosen items
FLOAT prob; // probability that this string is chosen
FLOAT conf; // probability that this string is corrrupted
// void shuffle(void); // shuffles items in string
public:
String(LINT nitems);
~String(void);
void display(ofstream &fp, LINT prob_comp = 1);
void display(ofstream &fp, StringSet &lits, LINT prob_comp = 1);
<-- ***
// prob is multiplied by prob_comp before being writeed
LINT size(void) { return nitems;}
Item item(LINT n) { return items[n];} // return nth item of the string
FLOAT conf_lvl(void) { return conf; }
void set_size(LINT newsize) { nitems = newsize;}
void set_item(LINT n, Item itm) { items[n] = itm;}
void set_conf_lvl(FLOAT newconf) { conf = newconf; }
// void shuffle(LINT k); // allows selection of k random items from the
string
// Item rand_item(LINT n) { return ritems[n];} // works with shuffle
};
________________________________________

"StringSet &lits" is the unexpected text. What can be the possible reason?

c u - Michael
 
V

Victor Bazarov

Michael said:
Hi,

thx for your help!
You indicated before that you downloaded this code from 'ibm.com'. Why
not ask IBM about that code?
I already did and still waiting for an answer.

Please allow me to ask again cause I tried again several things with
the xlC because IBM delivered a makefile which shouldn't make any
trouble.
Everything seems to work fine - except one thing (as mentioned above
in the thread):
________________________________________
zivunix:compile> make
xlC -+ -O -c -o gen.o gen.c
"gen.h", line 183.30: 1540-0063 (S) The text "StringSet" is
unexpected. make: *** [gen.o] Error 1
zivunix:compile>
________________________________________

The error occurs at *** in the following class "extract":
________________________________________
class String
{
friend class StringSet;
LINT nitems; // number of items
Item *items; // list of the items
// FLOAT *rval; // random value (used to get random ordering of the
items) // Item *ritems; // randomly chosen items
FLOAT prob; // probability that this string is chosen
FLOAT conf; // probability that this string is corrrupted
// void shuffle(void); // shuffles items in string
public:
String(LINT nitems);
~String(void);
void display(ofstream &fp, LINT prob_comp = 1);
void display(ofstream &fp, StringSet &lits, LINT prob_comp = 1);
<-- ***
// prob is multiplied by prob_comp before being writeed
LINT size(void) { return nitems;}
Item item(LINT n) { return items[n];} // return nth item of the string
FLOAT conf_lvl(void) { return conf; }
void set_size(LINT newsize) { nitems = newsize;}
void set_item(LINT n, Item itm) { items[n] = itm;}
void set_conf_lvl(FLOAT newconf) { conf = newconf; }
// void shuffle(LINT k); // allows selection of k random items from
the string
// Item rand_item(LINT n) { return ritems[n];} // works with shuffle
};
________________________________________

"StringSet &lits" is the unexpected text. What can be the possible
reason?

Whoever wrote it relied on 'class StringSet' to either have been defined
before this class or that 'friend class StringSet' defines it. The latter
is not true. Try writing

class StringSet;

before

class String {

V
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top