LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-04-2008, 09:42 AM   #1
mistretzu
LQ Newbie
 
Registered: Oct 2007
Posts: 6

Rep: Reputation: 0
Question gcc 4.1 vs 4.3 source code compatibility


I have some source code that was compiling well with gcc 4.1, recently I moved to openSuse that has gcc 4.3.1 and the same code fails to compile using this version of compiler.
Generally it complains that it doesn't recognize functions like malloc or wtol. I can easily fix this by including appropriate headers like stdlib.h or what ever is necessary.

But it is important not to change the source code at all. Is it possible to make them compile using 4.3.1? Is there some flag that I can specify to the compiler?
Or do I need to uninstall 4.3.1 and install 4.1?

Thanks.
 
Old 07-04-2008, 03:27 PM   #2
dmail
Member
 
Registered: Oct 2005
Posts: 970

Rep: Reputation: Disabled
You can temporally set the gcc version like so
Quote:
CC=gcc-4.1 make
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Voip Encryption, source code open source LXer Syndicated Linux News 0 07-09-2006 03:21 PM
GCC 4.x backwards compatibility mode antonypaul Programming 1 12-09-2005 12:32 PM
Compatibility between gcc and gcc-lib rajesht Red Hat 1 06-01-2005 12:28 PM
GCC Compatibility JanusPaul Programming 11 03-11-2005 06:32 PM
gcc glibc compatibility shanenin Linux - Software 2 05-17-2004 09:56 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 10:14 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration