?
Solved

FILE tyoe def in C compiles under MS VS but not G++

Posted on 2001-06-06
3
Medium Priority
?
263 Views
Last Modified: 2010-04-02
hi, i have code written largely in C++ but which makes use of the C FILE type def. It compiles and works fine under MS Visual Studio 6 C++ but i want to compile it on a unix box using G++, and at this point the compilation fails. It reports a syntax error with the line:
FILE *fp;

anyone know of a fix/reason for this??

thanks

Calum
0
Comment
Question by:calum
[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
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
robpitt earned 200 total points
ID: 6158944
Obvious question : have done a #include <stdio.h> ?
0
 
LVL 5

Expert Comment

by:robpitt
ID: 6158947
PS whats the exact error.
0
 

Author Comment

by:calum
ID: 6159217
i didn;t have stdio in the file when i compiled it using ms vs, and it worked fine, so i was confused when it didn;t compile using gcc. when i added it to gcc i got a load of linker errors, but when i compiled it under g++, it worked.

i don;t understand why, but i'll live with it!

thanks - you can have the points!!

rgds

calum

0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The goal of the video will be to teach the user the difference and consequence of passing data by value vs passing data by reference in C++. An example of passing data by value as well as an example of passing data by reference will be be given. Bot…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

719 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