Solved

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

Posted on 2015-01-28
5
193 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
linearIn  challenge 23 85
scoresSpecial  challenge 13 46
Python - ImportError: No module named 'urllib2' 2 156
operator overload: incompatible type and too many params 5 64
Windows Script Host (WSH) has been part of Windows since Windows NT4. Windows Script Host provides architecture for building dynamic scripts that consist of a core object model, scripting hosts, and scripting engines. The key components of Window…
Whether you’re a college noob or a soon-to-be pro, these tips are sure to help you in your journey to becoming a programming ninja and stand out from the crowd.
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.

863 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

18 Experts available now in Live!

Get 1:1 Help Now