From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7052 invoked by alias); 2 Feb 2010 05:38:02 -0000 Received: (qmail 7039 invoked by uid 22791); 2 Feb 2010 05:38:00 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=BAYES_00,SARE_MSGID_LONG40,SPF_PASS X-Spam-Check-By: sourceware.org Received: from qw-out-1920.google.com (HELO qw-out-1920.google.com) (74.125.92.144) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 02 Feb 2010 05:37:56 +0000 Received: by qw-out-1920.google.com with SMTP id 5so649583qwc.14 for ; Mon, 01 Feb 2010 21:37:54 -0800 (PST) MIME-Version: 1.0 Received: by 10.224.35.4 with SMTP id n4mr2584213qad.82.1265089074158; Mon, 01 Feb 2010 21:37:54 -0800 (PST) Date: Tue, 02 Feb 2010 07:11:00 -0000 Message-ID: <268c26c51002012137m6cffda9k6c068a37c01dfb2d@mail.gmail.com> Subject: Difficulty compiling with g++ after system change From: Chris Angelico To: gcc-help@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org X-SW-Source: 2010-02/txt/msg00013.txt.bz2 Hi! I'm having some trouble with a mixed shop, where we have some Windows and some Linux work, and would greatly appreciate advice on how to get the new system going. Apologies for the length of this. I've cut the code down as far as I can, but I'm stuck for where the actual problem is. I have two Linux computers, one of which has been in operation for some time, and the other has just been commissioned. I copied my source files over and tried to compile, but it's not working - see below for error messages. The working system is: $ g++ --version g++ (GCC) 4.2.4 (Ubuntu 4.2.4-1ubuntu4) The nonworking: g++ (Ubuntu 4.4.104ubuntu9) 4.4.1 The working system uses Python 2.5, the nonworking uses 2.6. The program uses Python, MySQL, and network sockets, and I think the problem may perhaps be in Python, but there's also an issue with fstream that is unconnected to Python. With an extremely cut-down program, I got the following: #include #include // the Windows side needed it to be .h #include On the older system, this three-line file compiles just fine (and then fails with a link error, no main). On the new system, I get the following errors: lcmini.cpp:10:21: error: fstream.h: No such file or directory In file included from /usr/include/python2.6/Python.h:8, from lcmini.cpp:16: /usr/include/python2.6/pyconfig.h:1028:1: warning: "_POSIX_C_SOURCE" redefined In file included from /usr/include/sys/types.h:27, from lcmini.cpp:1: /usr/include/features.h:158:1: warning: this is the location of the previous definition In file included from /usr/include/python2.6/Python.h:8, from lcmini.cpp:16: /usr/include/python2.6/pyconfig.h:1037:1: warning: "_XOPEN_SOURCE" redefined In file included from /usr/include/sys/types.h:27, from lcmini.cpp:1: /usr/include/features.h:160:1: warning: this is the location of the previous definition If the answer is "convert to using instead of ", I can handle that, although the Windows build may require some alterations (or else just #if it across). I'm puzzled, though, as to why it should work on the old system without a hitch. The build command is: $ g++ -Wno-deprecated -I/usr/include/mysql -DBIG_JOINS=1 -fPIC -I/usr/include/python2.6 -Wl,-Bsymbolic-functions -L/usr/lib/mysql -lmysqlclient -lpython2.6 lcmini.cpp Can anyone advise me as to what components I need to update/install? I'm seeing lots of differences between the systems (different versions of the same software), but am unable to recognize anything crucial. Many thanks for your consideration. Chris Angelico Melbourne, AU