I have a sfml c++ project. In this project, if I use the "sf::Mouse::setPosition" sfml method, the program crashes in 2-3 seconds after launch. If i don't use the "sf::Mouse::setPosition" sfml method, the runs successfully.
OS: Kubuntu 22.10 x64,
Kernel: 5.19.0-28-generic,
Video card: GT 730,
Compiler: gcc version 12.2.0 (Ubuntu 12.2.0-3ubuntu1),
SFML has installed by apt, libsfml-dev version 2.5.1+dfsg-2.
Makefile:
`
compile:./main.cpp
g++ -c main.cpp
g++ main.o -o app -lsfml-graphics -lsfml-window -lsfml-system
run:
./app
`
I've tried to use legacy nvidia-driver-390, xserver-xorg-video-nouveau but it doesn't work. Maybe I should compile sfml source code for better compatibility, but i don't know how to do this. Also the problem might be in gcc version (maybe sfml 2.5.1 doesn't support 12.2.0).
Related
How to install Mingw-w64 cross compiler GNU 7.3.0 on linux?
I could install it for C Compiler and CXX Compiler the GNU version 4.9.0. But the does not work with this version.
Edit:
if I run CMake (cmake -DCMAKE_TOOLCHAIN_FILE=/home/mingw/toolchain.mingw64.cmake ../src-gen) I get the following output below.
x86_64-w64-mingw32-g++: error: unrecognized command line option -std=c++14
If I run all this commands on Windows 10 with Mingw 64 GNU 7.3.0 with Msys64 could be generated and the build runs without errors.
I thought, the problem is the version from my compiler in Linux?
I am compiling code to run on an arm neon and the make files have the following command line included.
-mcpu=cortex-a9 -march=armv7 -mfpu=neon -DARM_NEON
The details of GCC version are as follows:
gcc (Ubuntu 4.8.4-2ubuntu1~14.04) 4.8.4
However when I try to compile, gcc keeps throwing the following error:
gcc: warning: '-mcpu=' is deprecated; use '-mtune=' or '-march=' instead
gcc: error: unrecognized command line option '-mfpu=neon'
I am pretty sure that the code could be compiled previously. Though a long time ago. Could it be changes in version of GCC? or is it do with 32 bit and 64 bit compilers?
I was trying to cross compile for an arm processor on my intel x86_64 Ubuntu machine. I needed to add the configuration for the host in the makefiles and use arm-linux-gnueabihf-gcc instead of gcc.
I compiled hello.c program for c6x architecture:
gcc-4.8 -o hello -march='c64x' hello.c
But It got an error: error: bad value (c64x) for -march= switch
Seem gcc can't recognize c64x architecture!
I am using Ubuntu 12.04 LTS & gcc-4.8 version.
Thank you!
-march=name
This specifies the name of the target architecture.
But in your case target is TI (c64x) board i.e its arm architecture. to compile your program for arm architecture you need cross-compiler. But you trying to compile on x86gcc native-compiler with option -march which is different from target target. i.e "gcc" is a native compiler. In your case it appears you are not working on an ARM host, thus "gcc" will not compile for ARM on x86.
so download the cross-compiler tool chain and then compile your program with your options.
cross compiler for ubuntu is here
http://www.filewatcher.com/m/gcc-c6x-linux-gnu-4.7.1-0.1.20120606.fc18.1.i686.rpm.10801432-0.html
I am trying to compile an existing QT library with QT5.1 Beta on Ubuntu 12.04 with Clang.
This project compiles fine with QT4.8.4.
I am getting the below linker error when I compile the project with QT5.1 Beta.
/usr/bin/ld: cannot find -lQt5OpenGL
/usr/bin/ld: cannot find -lQt5Widgets
/usr/bin/ld: cannot find -lQt5Network
/usr/bin/ld: cannot find -lQt5Gui
/usr/bin/ld: cannot find -lQt5Core
My current system setup is as follows:
Installed the 64 bit linux pre-built package of QT5.1 Beta on my home directory
Added Qt5.1 qmake bin directory to PATH environment variable
Added QT5.1 lib directory to LD_LIBRARY_PATH
Installed Clang 3.3 and libc++
In QT Creator added a Kit with QT5.1 and Clang and built the project using this kit
I am getting the error on both launching the qtcreator from icon and bash.
The developer who was using this ubuntu system before had installed QT4 using apt-get.
I think QT4 got installed in the default OS directories and QT4 gets picked up always rather than QT5 when I build my project. I removed the QT4 packages that were under /usr/** path
When the build fails ,I see the below command being executed in qtcreator's compiler output window.
clang++ debug/moc-xxx.o -L -L/home/user/Qt5.1.0/5.1.0-beta1/gcc_64/lib -lQ5OpenGL -lQt5Widgets -lQt5Network -lQt5Gui -lGL -lpthread
Does the -L with no path tell the compiler to use the libs from the system's default paths?
What am I missing here?
You need to compile Qt with Clang first (Clang-3.2 example):
http://libre.tibirna.org/projects/qgit/wiki/Compile_Qt5_with_clang
because pre-built Linux Qt libraries are for gcc.
After building Qt you can configure the Kit for Qt Creator:
http://libre.tibirna.org/projects/qgit/wiki/Compile_QGit_with_Qt5_and_clang
Could you please describe that how have you installed gcc-multilib and g++-multilib on 32bit debian machine to generate 64 bit code?
I installed gcc-4.7.2 on my 32bit debian system(and also installed binutils-2.23). When i try to compile a simple hello world program with -m64 flag as
# gcc -m64 hello.c
I am getting following error message:
"hello.c:1:0: sorry, unimplemented: 64-bit mode not compiled in" .
Please tell me the steps to generate the 64bit code on 32bit debian system.
You need to re-install gcc with this option in the configure.