473,408 Members | 1,753 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

How do I make my code compatible to run in Linux (gcc) compiler?

Hi all,
I am using Dev C++ IDE for the programming but for the time efficiency,
I tried to use supercomputer (Linux) to run my program, but some of the
function such as
pow(double,double) , `ftime' leads to an error in gcc compiler.
What kinda changes do I need to adapt so that I can run program in both
environment??
I would appreciate any help.
Mahesh

Sep 26 '06 #1
6 2112

mahesh wrote:
Hi all,
I am using Dev C++ IDE for the programming but for the time efficiency,
I tried to use supercomputer (Linux) to run my program, but some of the
function such as
pow(double,double) , `ftime' leads to an error in gcc compiler.
I'm not a gnu compiler expert, but isn't gcc a C compiler? If it is, it
will have trouble with C++ code.
What kinda changes do I need to adapt so that I can run program in both
environment??
I would appreciate any help.
If it's not the problem above, you need to identify all the features in
your program that only work on one compiler and replace them with
features that work on both compilers.

For a more specific answer, post some of the troublesome code following
the guidelines in FAQ 5.8.
http://www.parashift.com/c++-faq-lit...t.html#faq-5.8

Gavin Deane

Sep 26 '06 #2
mahesh wrote:
Hi all,
I am using Dev C++ IDE for the programming but for the time efficiency,
I tried to use supercomputer (Linux) to run my program, but some of the
function such as
pow(double,double) , `ftime' leads to an error in gcc compiler.
What kinda changes do I need to adapt so that I can run program in both
environment??
I would appreciate any help.
Mahesh
IIRC Dev C++ on Windows uses gcc under the hood.

What errors are you getting? Did you #include the right headers? Anyway,
you will have to investigate and correct each error separately.

Generally you can only call functions that are in the ISO C++ standard
if you want your code to work everywhere. "pow" is standard, "ftime"
isn't (however ftime might still work in your case; but you want to ask
these questions in a gcc, Linux and/or Dev C++ - related newsgroup, not
here).

D.
Sep 26 '06 #3

Gavin Deane wrote:
mahesh wrote:
Hi all,
I am using Dev C++ IDE for the programming but for the time efficiency,
I tried to use supercomputer (Linux) to run my program, but some of the
function such as
pow(double,double) , `ftime' leads to an error in gcc compiler.

I'm not a gnu compiler expert, but isn't gcc a C compiler? If it is, it
will have trouble with C++ code.
Yes, the OP should be using g++. Often people say the one when they
mean the other though. The gcc command usually does just fine right up
to the point of linking.

Sep 26 '06 #4
Noah Roberts wrote:
>
Yes, the OP should be using g++. Often people say the one when they
mean the other though. The gcc command usually does just fine right up
to the point of linking.
Well, IIRC, "GCC" means two things: 1) GNU C Compiler and 2) GNU
Compiler Collection. So, GCC is also the name of the entire suite of
compilers.

Nate
Sep 26 '06 #5
mahesh wrote:
Hi all,
I am using Dev C++ IDE for the programming but for the time efficiency,
I tried to use supercomputer (Linux) to run my program, but some of the
function such as
pow(double,double) , `ftime' leads to an error in gcc compiler.
What kinda changes do I need to adapt so that I can run program in both
environment??
I would appreciate any help.
for pow, you need to include the math.h header, and link to the libm
library. You need to find a replacement for ftime, e.g. gettimeofday.
Sep 27 '06 #6
mahesh wrote:
Hi all,
I am using Dev C++ IDE for the programming but for the time efficiency,
I tried to use supercomputer (Linux) to run my program, but some of the
function such as
pow(double,double) , `ftime' leads to an error in gcc compiler.
What kinda changes do I need to adapt so that I can run program in both
environment??
I would appreciate any help.
Mahesh
We don't know either. You need to show us the code. That way we can
compile your program and tell you exactly what you are getting wrong.

Ben
Sep 27 '06 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

242
by: James Cameron | last post by:
Hi I'm developing a program and the client is worried about future reuse of the code. Say 5, 10, 15 years down the road. This will be a major factor in selecting the development language. Any...
5
by: Rex Chou | last post by:
It is very simple, but the G++ compiler say it's wrong. I don't know why. #include<iostream> #include<cmath> using namespace std; int main() { cout << pow(2,3) << endl;
13
by: ThaDoctor | last post by:
I would like to get started with programming in C, but I cant get it to work, I do not need any compiler or such. Only a basic explanation of the first program Hello World that print "Hello World"...
239
by: Eigenvector | last post by:
My question is more generic, but it involves what I consider ANSI standard C and portability. I happen to be a system admin for multiple platforms and as such a lot of the applications that my...
1
by: akjohn | last post by:
My code compiles fine using VC++ 2005 and also with g++/gcc 3.4.2 (mingw...which came with the bloodshed dev c++ ide). But it only the vc++ build works correctly, the gcc exe starts but...
232
by: robert maas, see http://tinyurl.com/uh3t | last post by:
I'm working on examples of programming in several languages, all (except PHP) running under CGI so that I can show both the source files and the actually running of the examples online. The first...
69
by: Jack Dowson | last post by:
Hello Everybody: I'm learning c now.I think it's really a tedious job following my textbook to write programs which are used to deal with math problems.I want to write some codes related with...
10
by: Tomás Ó hÉilidhe | last post by:
I'd post this on a gcc newsgroup but I'd be more productive talking to the wall. Anyway, let's say someone throws some source code at you for a particular program and says, "Just compile it, it...
27
by: Dave | last post by:
I'm having a hard time tying to build gcc 4.3.1 on Solaris using the GNU compilers. I then decided to try to use Sun's compiler. The Sun Studio 12 compiler reports the following code, which is in...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.