Bug with gcc 4

Moderator: Moderator

kaiss85
Posts: 1
Joined: Thu May 28, 2009 9:39 pm

Bug with gcc 4

Postby kaiss85 » Fri May 29, 2009 12:45 am

Hi there,

I'm currently running MMS 1.1.1 on an Archlinux distribution.

While compiling the mms with all requirements installed, I had some errors.

This is how the first one looks running "make" command:

g++ -I/usr/local/include -L/usr/local/lib -I/usr/include/ -I. -pthread -pipe -O3 -march=native -ffast-math -funroll-loops -fomit-frame-pointer -funit-at-a-time -D_GNU_SOURCE -isystem /usr/include/boost/ -isystem /usr/include/boost-1_36/ -isystem /usr/include/boost-1_35/ -isystem /usr/include/boost-1_34_1/ -isystem /usr/include/boost-1_34_0/ -I./plugins -I./plugins/feature/ -I./plugins/input -I./plugins/output -c common.cpp
common.cpp: In function 'std::string string_format::str_printf(const char*, ...)':
common.cpp:421: error: 'stderr' was not declared in this scope
common.cpp:421: error: 'fprintf' was not declared in this scope
common.cpp:426: error: 'vsnprintf' was not declared in this scope
common.cpp:449: error: 'stderr' was not declared in this scope
common.cpp:449: error: 'fprintf' was not declared in this scope
common.cpp: In function 'std::string string_format::convert_locale(const std::string&, std::string, std::string)':
common.cpp:660: error: 'stderr' was not declared in this scope
common.cpp:660: error: 'fprintf' was not declared in this scope
common.cpp:666: error: 'stderr' was not declared in this scope
common.cpp:666: error: 'fprintf' was not declared in this scope
common.cpp:683: error: 'stderr' was not declared in this scope
common.cpp:683: error: 'fprintf' was not declared in this scope
common.cpp:691: error: 'stderr' was not declared in this scope
common.cpp:691: error: 'fprintf' was not declared in this scope
common.cpp: In member function 'void mmsSignals::deinit_mms(bool)':
common.cpp:1204: error: 'stderr' was not declared in this scope
common.cpp:1204: error: 'fprintf' was not declared in this scope
common.cpp: In function 'void crash_code_identifier(siginfo_t*)':
common.cpp:1289: error: 'stderr' was not declared in this scope
common.cpp:1289: error: 'fprintf' was not declared in this scope
common.cpp: In static member function 'static void mmsSignals::crash_handler(int, siginfo_t*, void*)':
common.cpp:1370: error: 'stderr' was not declared in this scope
common.cpp:1370: error: 'fprintf' was not declared in this scope
common.cpp: In function 'bool file_tools::dir_contains_known_files(const std::string&, const std::string&, unsigned int)':
common.cpp:1482: error: 'stderr' was not declared in this scope
common.cpp:1482: error: 'fprintf' was not declared in this scope
common.cpp:1493: error: 'stderr' was not declared in this scope
common.cpp:1493: error: 'fprintf' was not declared in this scope
make: *** [common.o] Error 1


After a little investigation, I found out that the following code needs to be added at the beginning of common.cpp

Code: Select all

#include <cstdio>


After that I was thinking it will be ok, but of course not :) I still had errors during compilation, see below (example):


g++ -I/usr/local/include -L/usr/local/lib -I/usr/include/ -I. -pthread -pipe -O3 -march=native -ffast-math -funroll-loops -fomit-frame-pointer -funit-at-a-time -D_GNU_SOURCE -isystem /usr/include/boost/ -isystem /usr/include/boost-1_36/ -isystem /usr/include/boost-1_35/ -isystem /usr/include/boost-1_34_1/ -isystem /usr/include/boost-1_34_0/ -I./plugins -I./plugins/feature/ -I./plugins/input -I./plugins/output -c config.cpp
In file included from /usr/lib/gcc/i686-pc-linux-gnu/4.4.0/../../../../include/c++/4.4.0/cstdio:45,
from /usr/lib/gcc/i686-pc-linux-gnu/4.4.0/../../../../include/c++/4.4.0/fstream:43,
from config_maker.hpp:9,
from config.cpp:4:
/usr/include/stdio.h:393: error: expected unqualified-id before 'do'
/usr/include/stdio.h:393: error: expected unqualified-id before 'while'
make: *** [config.o] Error 1


In fact the problem is that every *.cpp files are missing the following code at the beginning of them.

Code: Select all

#include <cstdio>


It's due to the new version of gcc, version 4 which is currently used on archlinux.

Please find the patch file here (it's a rapidshare link, ok but I can't attached it to my post sorry)

To patch, browse to your extracted folder, and use the following command $ patch -p1 -i /path/to/mms-1.1.1.patch

Hope it can help

Regards

User avatar
Uatschitchun
Overlord
Posts: 3189
Joined: Tue Dec 06, 2005 6:55 pm
Location: Germany
Contact:

Re: Bug with gcc 4

Postby Uatschitchun » Fri May 29, 2009 6:22 am

Pls use MMS 1.1.0-devel tree with bzr!
As you can see here:
http://bazaar.launchpad.net/~team-mms/mms/1.1.0/changes
These compile bugs are fixed in revnos 2179 & 2180

Next bugfix release (1.1.2) will be out once time is there to fix some issues beside changing main devel tree (1.2.0)
Lg
Roman


Return to “general discussion”

Who is online

Users browsing this forum: No registered users and 3 guests