Link to home
Start Free TrialLog in
Avatar of Maria Torres
Maria Torres

asked on

Why CX0030 is being generating for the fOpen() statement?

I am not a C++ programmer but I was assigned the task to compile a Linux C++ code to run in a Windows platform. I was able to compile the program, but now I am having problems with the fOpen() function that once worked in Unix. The "CXX0030 error: expression cannot be evaluated" is being generated for all fOpen() functions that exist in the program.

Below, I listed part of the program that is giving me troubles, and I was hoping for assistance:

 FILE* rulefile;
...
void plant(char* refdir)
  {
  RULE* ru;
  int i,j,doneflag;
  char* rfilename = (char*)malloc(80*sizeof(char));
  const char* rfn = "\\rules.txt";

  i = -1;
  while (refdir[++i] != '\0')
    {
    rfilename[i] = refdir[i];
    }
  j = 0;

  do
    {
    rfilename[i+j] = rfn[j];
    }
  while (rfn[j++] != '\0');

  rulefile = fopen (rfilename, "rt");        <=========  error generated at this point

   if (rulefile == NULL)
    {
    printf("failed to open rule file\n");
    exit(1);
    }
  doneflag = 0;
  while (!(doneflag))
    {
    ru = new RULE(&doneflag);
    delete ru;
    }
  fclose (rulefile);
  }

Open in new window


Any help is greatly appreciated.  Thank you.
Avatar of jkr
jkr
Flag of Germany image

Do you have either a

#include <stdio.h>

Open in new window


or a

#include <cstdio>

Open in new window


at the top your your source file?
Avatar of Maria Torres
Maria Torres

ASKER

Yes, I do.  The following is what I have:

#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
Additional information on this problem:

I tried to execute the fopen statement (i.e., fopen(rfilename, "rt")) in the quick watch window and the value that was returned was  "CXX0017: Error: symbol "fopen" not found".

In the Debug Option and Settings, I selected the "Microsoft Symbol Services" and "All modules, unless excluded", so I am not sure why this symbol not found error is being generated by MS Visual C++ 2010 Express.

Any suggestion is greatly appreciated.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you for clarifying the CXX0017 error.   I was still having trouble opening a file via fopen using Visual Studio 2010 Express.  So I spent the entire afternoon searching the web and came across a small comment from one of MS tech staff stating that the fopen issue is a bug within the 2010 version, and that the fix has been implemented in 2013 Express.  I now have downloaded 2013 Express version and will attempt to run the program in this new environment.  I hope this new version resolves the fopen issue and I can move on with the rest of the program.

Thank you again for your assistance.