LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Migrating from gcc 2.96 to 3.3.3 (https://www.linuxquestions.org/questions/linux-software-2/migrating-from-gcc-2-96-to-3-3-3-a-287736/)

prakashpms 02-08-2005 12:22 PM

Migrating from gcc 2.96 to 3.3.3
 
Hi,

I am facing problem while migrating an application from gcc 2.96 to gcc 3.3.3. The application was previously compiled on RedHat AS 2.1 and now I am compiling on Suse 9.1.

The program is something like this.

#include <string>

main()
{
string tmpString;
...................
}

It is compiling properly on RedHat AS 2.1 using gcc 2.96. On Suse 9.1 using gcc 3.3.3, it gives the following error.

error: 'string'undeclared (first use this function)
error: (Each undelcared identifier is reported only once for each function it appears in.)
error: syntax error before ';' token

Is there big difference between gcc 2.96 and 2.96. If I use 'using namespace std', I am able to resolve the compilation problem, but encounter the undefined reference linker error for std::basic_string.

Please let me know how do we solve this problem. Also, it will be helpful if you can point to any document for migrating from gcc 2.96 to 3.3.3.

Thanks & Regards
Prakash

david_ross 02-08-2005 12:47 PM

Please do not post the same thread in more than one forum. Picking the most relevant forum and posting it once there makes it easier for other members to help you and keeps the discussion all in one place.

http://www.linuxquestions.org/rules.php

Please continue here:
http://www.linuxquestions.org/questi...hreadid=287739

__J 02-08-2005 02:52 PM

3.3 is newer and does not allow some things that 2.96 will allow (it was probably deprecated (meaning it's legal with 2.96 but will be illegal at some point)). try to use the std namespace or use std::string and make sure you have the g++-libs/gcc-libs installed.

masand 02-08-2005 03:03 PM

maybe gccc 3.3 is not backward compatible

it is good practise to use namespace std

regards


All times are GMT -5. The time now is 10:30 PM.