Solved

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

Posted on 2001-06-06
3
234 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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
maze travler 6 55
Parsing XML instructions in Java/any other language.... 3 110
VS2015 compilation and missing DLLs 9 147
best sources to up-to-date in C++? 8 82
In days of old, returning something by value from a function in C++ was necessarily avoided because it would, invariably, involve one or even two copies of the object being created and potentially costly calls to a copy-constructor and destructor. A…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
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 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.

777 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