Solved

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

Posted on 2015-01-28
5
228 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This article is a continuation of the C/C++ Visual Studio Express debugger series. Part 1 provided a quick start guide in using the debugger. Part 2 focused on additional topics in breakpoints. As your assignments become a little more …
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

627 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