fatal error C1189: #error

Lauro de Miranda Durães laurogalib at yahoo.com.br
Sat Aug 3 17:21:16 EDT 2002

     You can insert the "\Tp" switch at the following way:
          Menu "Project", "Settings...". look for "C/C++" session and add the switch in "Project Options".
     That's all. :-)
  Dan Digman <digman.6 at msn.com> escreveu: Hello Help - I am new to Visual C++ and have compiled a few resource books to help in the learning process.  However, this problem - as stated by an earlier user - I have been unable to sole. ***  Program *** // Program Random Sequence Number Generator
#include <cstdlib>
#include <iostream>
#include <ctime> 
int main()
 std::cout << "Random Sequence Number Generator (RSNG). \n"; 
 std::cout << "Written by Dan Digman on 26-July-2002 using C++. \n \n";  std::cout << "Input number of Replications (reps) ... ";
 int reps;
 std::cin >> reps;
 std::cout << "\n";  std::cout << "Input number of treatments per replication (rep) ... ";
 int treats, limit;
 std::cin >> treats;
 limit = treats + 1;
 std::cout << "\n \n";  // Allocate memory for the array
 int* intArray;
 intArray = new treatnum[treats];
 // Print out the current replication number
 while (int c <= reps) {
  std::cout << "Replication #%d \n",c;   // Get random numbers
  int d = 1;
  while (d <= treats) {
   rnumber = random(treats) + 1;
   if treatnum[d] < limit {
    std::cout << "%d ",rnumber;
    treatnum[d] = limit;
  }   // Initialize the array
  int i = 0;
  while (i < treats) { 
   treatnum[i] = 1;
  std::cout << "\n \n";
// Generate a random number and return it to main
int random(num)
 int num;
 return static_cast<int>((num*static_cast<long>(rand()))/(RAND_MAX+1));
} *** End Of File ***  When Compiled, I receive the following message ... --------------------Configuration: crand - Win32 Debug--------------------
c:\program files\microsoft visual studio\vc98\include\eh.h(32) : fatal error C1189: #error :  "eh.h is only for C++!"
Error executing cl.exe. crand.obj - 1 error(s), 0 warning(s) ***  End of Compile ***  I found a few responses of which I have unsuccessfully tried. I have also found a few responses from the comp sci dept at Virginia Tech - none of which pertain to this particular error message. Then I came across a particular response on your site : You can use the \Tp switch.  It tells the compiler that .c files are = C++. Frankly, I would like to try this to see if it would solve my compiling problems but I have no idea where in the program to implement this statement or how to use it. Thank you in advance for your help in this matter... -Dan digman.6 at osu.edu 

Yahoo! PageBuilder - O super editor para criação de sites: é grátis, fácil e rápido.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.mit.edu/pipermail/galib/attachments/20020803/5bcaa8a8/attachment.htm

More information about the galib mailing list