Solved

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

Posted on 2001-06-06
3
213 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
Comment Utility
Obvious question : have done a #include <stdio.h> ?
0
 
LVL 5

Expert Comment

by:robpitt
Comment Utility
PS whats the exact error.
0
 

Author Comment

by:calum
Comment Utility
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

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

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…
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…
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 goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…

762 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

13 Experts available now in Live!

Get 1:1 Help Now