Solved

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

Posted on 2015-01-28
5
180 Views
Last Modified: 2015-01-30
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.
0
Comment
Question by:CarmenMTorres
  • 3
  • 2
5 Comments
 
LVL 86

Expert Comment

by:jkr
Comment Utility
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?
0
 

Author Comment

by:CarmenMTorres
Comment Utility
Yes, I do.  The following is what I have:

#include <stdio.h>
#include <malloc.h>
#include <stdlib.h>
0
 

Author Comment

by:CarmenMTorres
Comment Utility
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.
0
 
LVL 86

Accepted Solution

by:
jkr earned 500 total points
Comment Utility
Wait a minute, if you are using Visual Studio, "CXX0017" (https://msdn.microsoft.com/en-us/library/7cw9d870.aspx) is an "Expression Evaluator Error" which means that you already successfully have built your application and onyl that expression can't be evaluated by the Debugger...
0
 

Author Closing Comment

by:CarmenMTorres
Comment Utility
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.
0

Featured Post

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Many modern programming languages support the concept of a property -- a class member that combines characteristics of both a data member and a method.  These are sometimes called "smart fields" because you can add logic that is applied automaticall…
This article shows you how to optimize memory allocations in C++ using placement new. Applicable especially to usecases dealing with creation of large number of objects. A brief on problem: Lets take example problem for simplicity: - I have a G…
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now