LinuxAnswers - the LQ Linux tutorial section.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
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.


  Search this Thread
Old 07-04-2008, 10:42 AM   #1
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?

Old 07-04-2008, 04:27 PM   #2
Registered: Oct 2005
Posts: 970

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


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 04:21 PM
GCC 4.x backwards compatibility mode antonypaul Programming 1 12-09-2005 01:32 PM
Compatibility between gcc and gcc-lib rajesht Red Hat 1 06-01-2005 01:28 PM
GCC Compatibility JanusPaul Programming 11 03-11-2005 07:32 PM
gcc glibc compatibility shanenin Linux - Software 2 05-17-2004 10:56 PM

All times are GMT -5. The time now is 05:09 AM.

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