I'm using Oracle Linux 6 which officially has only g++ 4.4.7 compiler. It keeps complaining
cc1plus: error: unrecognized command line option "-std=gnu++11"
I found a way to get around as stated in https://blogs.oracle.com/opal/getting-a-c11-compiler-for-node-4,-5-and-6-on-oracle-linux-6. With this the complier will work in a shell if I run
scl enable devtoolset-3 bash
before the compiler call of g++ xxx .
So how can I setup qt so that it executes the additional command before calling the compiler? Thanks.
Related
I am trying to compile Blochlibs-1.2 libraries on Ubuntu 15.04 (32 bit). Ihave successfully compiled fftw3 and mpi libraries which all ended up in /usr/local/lib and usr/local/include. mpicc is in the path and LD_LIBRARY_PATH is set correctly. when I run configure like this:
./configure --with-mpi=/usr/local --with-fftw=/usr/local
then i get this error:
checking for functioning MPI library ... configure: error: couldn't
find mpi library for --with-mpi
How does the configure file search for the libraries?
Thanks,
Z
I am working on a Mac with Yosemite OS X and I'm trying to compile a program in C that I could then upload onto my Arduino. I am following a tutorial.
I tried going through and reinstalling avr-gcc, but I got the same output. I tried searching for the file crtatmega328p.o on my system, but it is nowhere to be found and the same goes for the directory.
$ avr-gcc -Os -DF_CPU=16000000UL -mmcu=atmega328p -c -o Program.o Program.c
$ avr-gcc -mmcu=atmega328p Program.o -o Program
/usr/local/lib/gcc/avr/5.2.0/../../../../avr/bin/ld: cannot find crtatmega328p.o: No such file or directory
/usr/local/lib/gcc/avr/5.2.0/../../../../avr/bin/ld: cannot find -latmega328p
collect2: error: ld returned 1 exit status
I was just hit by this issue on GNU/Linux last week.
Actually, the compiler works fine. The cause of the issue is a failed linking attempt against avr-libc.
avr-libc-1.8.1 is simply too old to work with GCC 5. Although 1.8.1 is the latest version of avr-libc, but it was released one year ago... The developing version of avr-libc has updated to catch up GCC 5, you could clone the subversion repository:
svn co svn://svn.savannah.nongnu.org/avr-libc/trunk
and compile it by yourself. If you are not familiar about how to compile yourself home-made toolchains from the source code, there are plenty of documentation and tutorial on the web.
I just made a clean install of the following tools on Windows 7:
MinGW / GCC 4.8.1
Qt 4.8.5
Qt Creator 2.8.1
In the PATH there is: C:\Qt\4.8.5\bin;C:\Qt\4.8.5\include;C:\Qt\4.8.5\lib;C:\MinGW\bin;
1) I read the warning about the fact that Qt 4.8 needs GCC 4.6. I ignored it, using GCC 4.8.1. So this could be an issue.
2) I successfully installed Qt Creator. I successfully built the default Qt GUI application. When launched I get the error: "The program has unexpectedly finished." Debugging I get a segmentation fault before entering main(), in the qatomic_i386.h file, in the QBasicAtomicInt::deref() member function.
If I build a cmake based console application, everything is fine.
3) If I build a previous Qt cmake based project (either from the command line or from Qt Creator), this is what I get (out of tree build):
The first time I run cmake:
MyPrj-build>cmake -G "MinGW Makefiles" ..\MyPrj
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/CMakeMinGWFindMake.cmake:20 (message):
sh.exe was found in your PATH, here:
C:/Program Files (x86)/Git/bin/sh.exe
For MinGW make to work correctly sh.exe must NOT be in your path.
Run cmake from a shell that does not have sh.exe in your PATH.
If you want to use a UNIX shell, then use MSYS Makefiles.
Call Stack (most recent call first):
CMakeLists.txt:6 (PROJECT)
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_C_COMPILER
CMake Error: Could not find cmake module file:S:/MyPrj/MyPrj-build/CMakeFiles/2.8.11.2/CMakeCCompiler.cmake
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER_ENV_VAR
CMake Error: Error required internal CMake variable not set, cmake may be not be built correctly.
Missing variable is:
CMAKE_CXX_COMPILER
CMake Error: Could not find cmake module file:S:/MyPrj/MyPrj-build/CMakeFiles/2.8.11.2/CMakeCXXCompiler.cmake
CMake Error: CMAKE_C_COMPILER not set, after EnableLanguage
CMake Error: CMAKE_CXX_COMPILER not set, after EnableLanguage
-- Configuring incomplete, errors occurred!
The second time:
S:\MyPrj\MyPrj-build>cmake -G "MinGW Makefiles" ..\MyPrj
-- The C compiler identification is GNU 4.8.1
-- The CXX compiler identification is GNU 4.8.1
-- Check for working C compiler: C:/MinGW/bin/gcc.exe
-- Check for working C compiler: C:/MinGW/bin/gcc.exe -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe
-- Check for working CXX compiler: C:/MinGW/bin/g++.exe -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at C:/Program Files (x86)/CMake 2.8/share/cmake-2.8/Modules/FindQt4.cmake:1382 (message):
Found unsuitable Qt version "" from NOTFOUND, this code requires Qt 4.x
Call Stack (most recent call first):
CMakeLists.txt:12 (FIND_PACKAGE)
-- Configuring incomplete, errors occurred!
Is it normal to have these different behaviours in the first and second cmake run?
Why cannot the system find Qt4?
Are these three issues dependent on each other?
How did you "install" your Qt? The only way of "installing" it in your case is to build it from the sources. Generally, you need to use the same compiler to compile Qt as you use to compile your Qt-using project. Some C++ compiler version mismatches might work, but you've just shown that your combination doesn't.
I'm facing some issues on compiling gcc on solaris 10.
I downloaded the source code from "ftp://ftp.gwdg.de/pub/misc/gcc/releases/gcc-4.1.2/" and tried to compile it, by using configure and then make.
But the make stops at line mentioned below.
perl ../.././fastjar/../contrib/texi2pod.pl -D fastjar > fastjar.pod
I'hv checked perl is already installed but it has stuck at this point for more than 12hrs.
gcc version already installed is 3.4.3
perl version is 5.8.4
The above problem is solved as i used ksh shell to build/configure it, but i ran into another problem i.e. the gcc which i got after this build says
warning: visibility attribute not supported in this configuration; ignored
This visibility feature is required as i don't want to export all of my function in my shared libraries.
According to this link the waring is due to objdump which it says is not present in my $PATH. But i checked it is in $PATH variable.
Thanks
Here is how i solved this problem:
Installed gnu binutils version 2.18 using gcc 3.4.3(available in solaris by default).
cd gcc_source_dir
mkdir objdir && cd objdir
../configure --with-gnu-as --with-as=/binutils_2_18/bin/as --with-gnu-ld --with-ld=/binutils_2_18/bin/ld --prefix=$PREFIX --enable-threads=posix --enable-checking=release --with-system-zlib --enable-shared --disable-symvers --enable-languages=c,c++
gmake
gmake install
I am getting the following error, when I run programs in debug mode.
cannot find -lQtCored
collect2: ld returned 1 exit status
I can run programs normally in release mode. Is it because I have done static linking (I can run my executable without Qt Creator)?
I am using Qt Creator with Qt 4.7.0 on Windows.
The following command would solve this issue:
sudo apt-get install libglu1-mesa-dev
Your linker can not see debug library of QtCore (as shown - -lQtCored, release lib - -lQtCore).
You need checked, really you build this debug library or not, then checked all pathes to this debug library.
PS. Yes, you can run executable without Qt-Creator. You should use qmake (into directory with your .pro) and make (when your qmake has generate Makefile).
PSS. If you want to run .exe then you should put some Qt libraries into directory with .exe.