Solved

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

Posted on 2001-06-06
3
239 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
  • 2
3 Comments
 
LVL 5

Accepted Solution

by:
robpitt earned 50 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: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

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

Written by John Humphreys C++ Threading and the POSIX Library This article will cover the basic information that you need to know in order to make use of the POSIX threading library available for C and C++ on UNIX and most Linux systems.   [s…
This article will show you some of the more useful Standard Template Library (STL) algorithms through the use of working examples.  You will learn about how these algorithms fit into the STL architecture, how they work with STL containers, and why t…
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…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.

809 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