Latest LQ Deal: Linux Power User Bundle
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, 09: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, 03: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 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 > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:41 PM.

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