Error building g++ 4.8.1 on CentOS - centos6

Can anybody suggest what's going wrong with my attempted g++ 4.8.1 install on CentOS 6?
The installed compiler is g++ 4.4.7.
The make step ends shortly after this:
checking for suffix of object files... configure: error: in `/mxhome/charrison/gcc-4.8.1/gcc-4.8.1/build-gcc/x86_64-unknown-linux-gnu/libgcc':
configure: error: cannot compute suffix of object files: cannot compile
See `config.log' for more details.
The config.log contains this seemingly-innocent remark concerning object file suffixes:
configure:4390: checking for suffix of object files
configure:4412: gcc -c conftest.c >&5
configure:4416: $? = 0
configure:4437: result: o
The word 'error' occurs in the config.log file here (and my g++4.4 would certainly fail the test):
configure:4936: checking whether g++ accepts -static-libstdc++ -static-libgcc
configure:4953: g++ -o conftest -g -O2 -static-libstdc++ -static-libgcc conftest.cpp >&5
g++: unrecognized option '-static-libstdc++'
conftest.cpp:11:2: error: #error -static-libstdc++ not implemented
configure:4953: $? = 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""
| #define PACKAGE_TARNAME ""
| #define PACKAGE_VERSION ""
| #define PACKAGE_STRING ""
| #define PACKAGE_BUGREPORT ""
| #define PACKAGE_URL ""
| /* end confdefs.h. */
|
| #if (__GNUC__ < 4) || (__GNUC__ == 4 && __GNUC_MINOR__ < 5)
| #error -static-libstdc++ not implemented
| #endif
But I don't know if that's fatal or not.
Suggestions?

This is probably obsolete, but I ran into the same problem and could fix it by installing libstdc.

Related

__e_acsl_assert is not getting added for all given assert in .i file

I am new to Frama-C. I specifically need to use e-acsl plugin for verification purposes. I used first.i file as
int main(void) {
int x = 0;
/∗# assert x == 0; ∗/
/∗# assert x == 1; ∗/
return 0;
}
Created monitored_first.c file from first.i file using the following command.
$ frama-c -e-acsl first.i -then-last -print -ocode monitored_first.c
The main function inside the monitored_first.c looks like the one below.
int main(void)
{
int __retres;
__e_acsl_memory_init((int *)0,(char ***)0,8UL);
int x = 0;
__retres = 0;
__e_acsl_memory_clean();
return __retres;
}
It is not adding e_acsl assertion for x==1.
I tried it using the "e-acsl-gcc.sh" script , which generated the monitored_first.i file. But the main function inside monitored_first.i is same as that in monitored_first.c.
$ e-acsl-gcc.sh -c -omonitored_first.i first.i
The above command generated two executable, "a.out.e-acsl" and "a.out". It also generates some warnings when run in ubuntu 22.04 as follows:
/home/amrutha/.opam/4.11.1/bin/frama-c -remove-unused-specified-functions -machdep gcc_x86_64 '-cpp-extra-args= -std=c99 -D_DEFAULT_SOURCE -D__NO_CTYPE -D__FC_MACHDEP_X86_64 ' -no-frama-c-stdlib first.i -e-acsl -e-acsl-share=/home/amrutha/.opam/4.11.1/bin/../share/frama-c/e-acsl -then-last -print -ocode monitored_first.i
[kernel] Parsing first.i (no preprocessing)
[e-acsl] beginning translation.
[kernel] Parsing FRAMAC_SHARE/e-acsl/e_acsl.h (with preprocessing)
/tmp/ppannot15ad34.c:362: warning: "__STDC_IEC_60559_BFP__" redefined
362 | #define __STDC_IEC_60559_BFP__ 201404L
|
In file included from <command-line>:
/usr/include/stdc-predef.h:39: note: this is the location of the previous definition
39 | # define __STDC_IEC_60559_BFP__ 201404L
|
/tmp/ppannot15ad34.c:363: warning: "__STDC_IEC_60559_COMPLEX__" redefined
363 | #define __STDC_IEC_60559_COMPLEX__ 201404L
|
In file included from <command-line>:
/usr/include/stdc-predef.h:49: note: this is the location of the previous definition
49 | # define __STDC_IEC_60559_COMPLEX__ 201404L
|
[e-acsl] translation done in project "e-acsl".
+ gcc -std=c99 -m64 -g -O2 -fno-builtin -fno-merge-constants -Wall -Wno-long-long -Wno-attributes -Wno-nonnull -Wno-undef -Wno-unused -Wno-unused-function -Wno-unused-result -Wno-unused-value -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-implicit-function-declaration -Wno-empty-body first.i -o a.out
+ gcc -DE_ACSL_SEGMENT_MMODEL -std=c99 -m64 -g -O2 -fno-builtin -fno-merge-constants -Wall -Wno-long-long -Wno-attributes -Wno-nonnull -Wno-undef -Wno-unused -Wno-unused-function -Wno-unused-result -Wno-unused-value -Wno-unused-function -Wno-unused-variable -Wno-unused-but-set-variable -Wno-implicit-function-declaration -Wno-empty-body -I/home/amrutha/.opam/4.11.1/bin/../share/frama-c/e-acsl -o a.out.e-acsl monitored_first.i /home/amrutha/.opam/4.11.1/bin/../share/frama-c/e-acsl/e_acsl_rtl.c /home/amrutha/.opam/4.11.1/bin/../lib/frama-c/e-acsl/libeacsl-dlmalloc.a -lgmp -lm
In ubuntu 20.04 there is no any warning, only the end part is getting displayed. When run ./a.out.e-acsl , it simply run the code without any message, which is not supposed. The expected output should look like this:
$ ./a.out.e-acsl
first.i: In function 'main'
first.i:4: Error: Assertion failed:
The failing predicate is:
x == 1.
Aborted (core dumped)
$ echo $?
134
I tried it in ubuntu 22.04 with opam version 2.1.2 and Fragma-C 25.0
and ubuntu 20.04 with opam version 2.0.5 and Fragma-C 25.0
The same issue has been posted to Frama-C's public bug tracking and it seems the cause might have been the non-ASCII asterisk characters used in the ACSL annotations: ∗ instead of *.
I still don't understand how the comments could parse at all (my compiler gives a syntax error), but the user seems to indicate that replacing them solved the problem.
In any case, in similar situations one can either use the Frama-C GUI to open the parsed file and check if Frama-C recognizes the ACSL annotations (they should show up in the CIL normalized code), or try other analyses, e.g. running frama-c -eva and checking that it detects the annotations.

Errors in qvariant.h during compilation

I am getting a variety of compilation errors relating to qvariant when compiling my program. I have not modified the Qt libs/source, so why am I getting these errors? (What do they mean)
/Qt/5.9.9/gcc_64/mkspecs/linux-g++ -o tl_ansi_codes.o /mydir/tl_ansi_formatting/tl_ansi_codes.cpp
In file included from /opt/Qt/5.9.9/gcc_64/include/QtCore/qlocale.h:43,
from /opt/Qt/5.9.9/gcc_64/include/QtCore/qtextstream.h:46,
from /opt/Qt/5.9.9/gcc_64/include/QtCore/qdebug.h:49,
from /opt/Qt/5.9.9/gcc_64/include/QtCore/QDebug:1,
from /mydir/tl_ansi_formatting/tl_ansi_codes.cpp:9:
/opt/Qt/5.9.9/gcc_64/include/QtCore/qvariant.h: In constructor ‘QVariant::QVariant(QVariant&&)’:
/opt/Qt/5.9.9/gcc_64/include/QtCore/qvariant.h:265:25: warning: implicitly-declared ‘constexpr QVariant::Private& QVariant::Private::operator=(const QVariant::Private&)’ is deprecated [-Wdeprecated-copy]
265 | { other.d = Private(); }
| ^
/opt/Qt/5.9.9/gcc_64/include/QtCore/qvariant.h:380:16: note: because ‘QVariant::Private’ has user-provided ‘QVariant::Private::Private(const QVariant::Private&)’
380 | inline Private(const Private &other) Q_DECL_NOTHROW
| ^~~~~~~
g++ -c -pipe -g -Wall -W -D_REENTRANT -fPIC -DQT_DEPRECATED_WARNINGS -Dproject_vls=1 -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT_SQL_LIB -DQT_CORE_LIB -I/mydir//project -I. -
/opt/Qt/5.9.9/gcc_64/include/QtCore/qvariant.h: In constructor ‘QVariant::QVariant(QVariant&&)’:
/opt/Qt/5.9.9/gcc_64/include/QtCore/qvariant.h:265:25: warning: implicitly-declared ‘constexpr QVariant::Private& QVariant::Private::operator=(const QVariant::Private&)’ is deprecated [-Wdeprecated-copy]
265 | { other.d = Private(); }
The best solution available is just to ignore it, Or upgrade to qt6.
To Ignore the warning, just add
QMAKE_CXXFLAGS += -Wno-deprecated-copy
In all of your .pro files.
This will ignore all the deprecated-copy warning; you can also ignore for debug or release build using QMAKE_CXXFLAGS_DEBUG or QMAKE_CXXFLAGS_RELEASE.

Installing Fuzz. Error: exp ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘x_slot’ected

I am installing "Fuzz typechecker Z" in Ubuntu 20.04 https://spivey.oriel.ox.ac.uk/corner/Fuzz_typechecker_for_Z
However, when I do make I get the following errors. Any idea where should I start?
make -C src all
make[1]: Entering directory '/home/evochecker/Downloads/fuzz/src'
gcc -Wall -c -DDEBUG -DANSI -DASSUME zparse.c
In file included from zparse.y:88:
absyn.h:4:1: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘x_slot’
absyn.h:51: warning: "x_params" redefined
absyn.h:19: note: this is the location of the previous definition
absyn.h:76: warning: "x_arg" redefined
absyn.h:64: note: this is the location of the previous definition
zparse.y: In function ‘sexp_fix’:
zparse.y:721:14: error: expected identifier before ‘=’ token
721 | a->x_body = sexp_fix(a->x_body);
| ^
zparse.y:728:19: error: expected identifier before ‘;’ token
728 | return a->x_arg;
| ^
zparse.y:732:13: error: expected identifier before ‘=’ token
732 | a->x_arg = sexp_fix(a->x_arg);
| ^
zparse.y:739:14: error: expected identifier before ‘=’ token
739 | a->x_arg2 = sexp_fix(a->x_arg2);
| ^
zparse.y: In function ‘pred_fix’:
zparse.y:760:14: error: expected identifier before ‘=’ token
760 | a->x_body = pred_fix(a->x_body);
| ^
zparse.y:766:14: error: expected identifier before ‘=’ token
766 | a->x_body = pred_fix(a->x_body);
| ^
zparse.y:778:16: error: expected identifier before ‘->’ token
778 | if (a->x_arg->x_kind == SEXPR)
| ^~
zparse.y:779:18: error: expected identifier before ‘=’ token
779 | a->x_arg = a->x_arg->x_arg;
| ^
zparse.y:781:16: error: expected identifier before ‘->’ token
781 | if (a->x_arg->x_kind != SREF) {
| ^~
zparse.y:791:13: error: expected identifier before ‘=’ token
791 | a->x_arg = pred_fix(a->x_arg);
| ^
zparse.y:796:14: error: expected identifier before ‘=’ token
796 | a->x_arg2 = pred_fix(a->x_arg2);
| ^
make[1]: *** [Makefile:75: zparse.o] Error 1
make[1]: Leaving directory '/home/evochecker/Downloads/fuzz/src'
make: *** [Makefile:55: src] Error 2
I know this may be a very specific question related to Fuzz, so thanks for any help.
Here are the list of files (zparse.c, zparse.h, absyn.h)
https://github.com/Spivoxity/fuzz/tree/master/src
I saw this question while perusing other 'z-notation' questions. I am using Ubuntu 22.04 and tried downloading and compiling the utility and did not run into any problems. Here is what I did:
git clone https://github.com/Spivoxity/fuzz.git
cd fuzz/
./configure
make
Here is the output:
make[1]: Entering directory '/tmp/fuzz/src'
bison -dv -y zparse.y -o zparse.c
gawk -f absyn.k absyn.x >absyn.h
gcc -Wall -c -DDEBUG -DANSI -DASSUME zparse.c
flex -ozscan.c zscan.l
gcc -Wall -c -DDEBUG -DANSI -DASSUME -DYY_NO_UNPUT -DYY_NO_INPUT zscan.c
gcc -Wall -c -DDEBUG -DANSI -DASSUME -DLIBDIR=\"/usr/local/lib\" -Dfuzz_version=\"1.2.1\" main.c
gcc -Wall -c -DDEBUG -DANSI -DASSUME spec.c
gcc -Wall -c -DDEBUG -DANSI -DASSUME type.c
gcc -Wall -c -DDEBUG -DANSI -DASSUME frame.c
gcc -Wall -c -DDEBUG -DANSI -DASSUME dict.c
gcc -Wall -c -DDEBUG -DANSI -DASSUME sched.c
gcc -Wall -c -DDEBUG -DANSI -DASSUME pretty.c
gcc -Wall -c -DDEBUG -DANSI -DASSUME error.c
gcc -Wall -c -DDEBUG -DANSI -DASSUME expr.c
gcc -Wall -c -DDEBUG -DANSI -DASSUME alloc.c
gcc -Wall -c -DDEBUG -DANSI -DASSUME unify.c
gcc -Wall -c -DDEBUG -DANSI -DASSUME schema.c
gcc -Wall -c -DDEBUG -DANSI -DASSUME dump.c
gcc -o fuzz zparse.o zscan.o main.o spec.o type.o frame.o dict.o sched.o pretty.o error.o expr.o alloc.o unify.o schema.o dump.o
/usr/bin/cpp -DDEBUG -DANSI -DASSUME symdef.x >symdef.i
gawk -f fuzzlib.k output=fuzzlib fuzzlib.x >fuzzlib
gawk -f fuzzlib.k output=minilib minilib.x >minilib
make[1]: Leaving directory '/tmp/fuzz/src'

Oracle database installation issue in ins_ctx.mk

Error in invoking target 'install' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/ctx/lib/ins_ctx.mk'. See '/u01/app/oraInventory/logs/installActions2015-02-28_02-22-27AM.log' for details.
I get the above error when I run the installer of Oracle 11g release 2
The log is as follows
INFO: gcc -o ctxhx -m64 -L/u01/app/oracle/product/11.2.0/dbhome_1/ctx/lib/ -L/u01/app/oracle/product/11.2.0/dbhome_1/lib/ -L/u01/app/oracle/product/11.2.0/dbhome_1/lib/stubs/ /u01/app/oracle/product/11.2.0/dbhome_1/ctx/lib/ctxhx.o -L/u01/app/oracle/product/11.2.0/dbhome_1/ctx/lib/ -lm -ldl -lsc_ca -lsc_fa -lsc_ex -lsc_da -lsc_ut -lsc_ch -lsc_fi -lctxhx -lc -Wl,-rpath,/u01/app/oracle/product/11.2.0/dbhome_1/ctx/lib -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lcore11 -lsnls11 -lnls11 -lxml11 -lcore11 -lunls11 -ls
INFO: nls11 -lnls11 -lcore11 -lnls11
INFO: /usr/bin/ld: /u01/app/oracle/product/11.2.0/dbhome_1/lib//libcore11.a(sslss.o): undefined reference to symbol 'pthread_sigmask##GLIBC_2.2.5'
//lib/x86_64-linux-gnu/libpthread.so.0: error adding symbols: DSO missing from command line
INFO: collect2: error: ld returned 1 exit status
INFO: make: *** [ctxhx] Error 1
INFO: End output from spawned process.
INFO: ----------------------------------
INFO: Exception thrown from action: make
Exception Name: MakefileException
Exception String: Error in invoking target 'install' of makefile '/u01/app/oracle/product/11.2.0/dbhome_1/ctx/lib/ins_ctx.mk'. See '/u01/app/oraInventory/logs/installActions2015-02-28_02-22-27AM.log' for details.
Please help me fix this... Thanks in advance.
Try to link with g++ instead of gcc.
cd /bin
mv gcc gcc.save
ln -s g++ gcc
and run the installer again.
Create the following script the run it a root during install the click retry
# Fix ctx/lib/ins_ctx.mk
ORACLE_HOME=/u01/app/oracle/product/11.2.0/db_1
cat << __EOF__ > /tmp/memcpy_wrap.c
#include <stddef.h>
#include <string.h>
asm (".symver wrap_memcpy, memcpy#GLIBC_2.14");
void *wrap_memcpy(void *dest, const void *src, size_t n) {
return memcpy(dest, src, n);
}
__EOF__
if [[ -e "${ORACLE_HOME}/ctx/lib/ins_ctx.mk" ]]; then
sed -i -e 's/\$(INSO_LINK)/\$(INSO_LINK) -Wl,--wrap=memcpy_wrap \$(ORACLE_HOME)\/ctx\/lib\/memcpy_wrap.o/g' ${ORACLE_HOME}/ctx/lib/ins_ctx.mk
gcc -c /tmp/memcpy_wrap.c -o ${ORACLE_HOME}/ctx/lib/memcpy_wrap.o && rm /tmp/memcpy_wrap.c
fi

Problems on Qt on NetBeans

After having solved a Qt configured problem on my system, I have now installed NetBeans and everything is OK. It is just that I have the following problem. Here is the code:
#include <QtGui/QApplication>
#include <QDir>
#include <QFileInfo>
#include <QtDebug>
int main(int argc, char **argv) {
foreach(QFileInfo drive,QDir::drives()){
qDebug()<<"Drive: "<<drive.absolutePath();
QDir dir=drive.dir();
dir.setFilter(QDir::Dirs);
foreach(QFileInfo rootDirs,dir.entryInfoList())
qDebug()<< " "<<rootDirs.fileName();
}
return 0;
// return app.exec();
}
and errors are
/usr/bin/make -f nbproject/Makefile-Debug.mk SUBPROJECTS= .build-conf
make[1]: Entering directory `/home/david/NetBeansProjects/QtApplication_1'
/usr/bin/qmake VPATH=. -o qttmp-Debug.mk nbproject/qt-Debug.pro
mv -f qttmp-Debug.mk nbproject/qt-Debug.mk
/usr/bin/make -f nbproject/qt-Debug.mk dist/Debug/GNU-Linux-x86/QtApplication_1
make[2]: Entering directory `/home/david/NetBeansProjects/QtApplication_1'
g++ -c -pipe -g -Wall -W -D_REENTRANT -DQT_GUI_LIB -DQT_CORE_LIB -DQT_SHARED -I/usr/share/qt4/mkspecs/linux-g++ -Inbproject -I/usr/include/qt4/QtCore -I/usr/include/qt4/QtGui -I/usr/include/qt4 -I. -Inbproject -I. -o build/Debug/GNU-Linux-x86/Qt1.o Qt1.cpp
Qt1.cpp:7: warning: unused parameter ‘argc’
Qt1.cpp:7: warning: unused parameter ‘argv’
g++ -o dist/Debug/GNU-Linux-x86/QtApplication_1 build/Debug/GNU-Linux-x86/Qt1.o build/Debug/GNU-Linux-x86/main.o -L/usr/lib -lQtGui -lQtCore -lpthread
build/Debug/GNU-Linux-x86/main.o: In function `main':
/home/david/NetBeansProjects/QtApplication_1/main.cpp:10: multiple definition of `main'
build/Debug/GNU-Linux-x86/Qt1.o:/home/david/NetBeansProjects/QtApplication_1/Qt1.cpp:7: first defined here
collect2: ld returned 1 exit status
make[2]: *** [dist/Debug/GNU-Linux-x86/QtApplication_1] Error 1
make[2]: Leaving directory `/home/david/NetBeansProjects/QtApplication_1'
make[1]: *** [.build-conf] Error 2
make[1]: Leaving directory `/home/david/NetBeansProjects/QtApplication_1'
make: *** [.build-impl] Error 2
BUILD FAILED (exit value 2, total time: 1s)
How can I fix this problem?
According to that output, you are compiling two source files Qt1.cpp and main.cpp, both of which define the function main(). You need to remove one of those two files from your project or remove the definition of main() from one of them.
As an added step to get rid of the warning about unused parameters in main(), change it to
main(int /*argc*/, char **/*argv*/)
until you need to use those arguments.

Resources