Solved

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

Posted on 2015-01-28
5
209 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
ID: 40576256
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
ID: 40577245
Yes, I do.  The following is what I have:

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

Author Comment

by:CarmenMTorres
ID: 40577330
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
ID: 40577899
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
ID: 40581110
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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Templates For Beginners Or How To Encourage The Compiler To Work For You Introduction This tutorial is targeted at the reader who is, perhaps, familiar with the basics of C++ but would prefer a little slower introduction to the more ad…
The purpose of this article is to demonstrate how we can use conditional statements using Python.
This tutorial will introduce the viewer to VisualVM for the Java platform application. This video explains an example program and covers the Overview, Monitor, and Heap Dump tabs.
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

832 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