- c - 在位数组中找到第一个零
- linux - Unix 显示有关匹配两种模式之一的文件的信息
- 正则表达式替换多个文件
- linux - 隐藏来自 xtrace 的命令
所以我只是手动安装了 SFML 2.4.2 库,并想编译第一个教程中的示例代码:
#include <SFML/Graphics.hpp>
int main() {
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
sf::CircleShape shape(100.f);
shape.setFillColor(sf::Color::Green);
while (window.isOpen()) {
sf::Event event;
while (window.pollEvent(event)) {
if (event.type == sf::Event::Closed)
window.close();
}
window.clear();
window.draw(shape);
window.display();
}
return 0;
}
一切都在 Ubuntu 16.04 上使用 g++ 5.4.0 和 clang++ 3.8.0 编译,但是当我尝试运行该程序时,它显示一个黑色窗口 1 秒钟并将其输出到终端:
*** Error in `./main': free(): invalid pointer: 0x000000000155cb08 ***
======= Backtrace: =========
/lib/x86_64-linux-gnu/libc.so.6(+0x777e5)[0x7f2d572537e5]
/lib/x86_64-linux-gnu/libc.so.6(+0x7fe0a)[0x7f2d5725be0a]
/lib/x86_64-linux-gnu/libc.so.6(cfree+0x4c)[0x7f2d5725f98c]
./main[0x4015d0]
./main[0x401580]
./main[0x401492]
./main[0x4013d1]
./main[0x401368]
./main(_ZN2sf6StringD2Ev+0x15)[0x401325]
./main[0x4010a6]
/lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf0)[0x7f2d571fc830]
./main[0x400ed9]
======= Memory map: ========
00400000-00402000 r-xp 00000000 08:02 7080173 /home/octothorp/code/terrain_rendering/main
00601000-00602000 r--p 00001000 08:02 7080173 /home/octothorp/code/terrain_rendering/main
00602000-00603000 rw-p 00002000 08:02 7080173 /home/octothorp/code/terrain_rendering/main
01549000-0186b000 rw-p 00000000 00:00 0 [heap]
40144000-401e4000 rw-p 00000000 00:00 0
406bb000-406bd000 r-xs 00000000 08:02 262928 /tmp/.gljLFg1G (deleted)
4081a000-408ba000 rw-p 00000000 00:00 0
7f2d4c000000-7f2d4c021000 rw-p 00000000 00:00 0
7f2d4c021000-7f2d50000000 ---p 00000000 00:00 0
7f2d517fa000-7f2d518c3000 rw-p 00000000 00:00 0
7f2d518c3000-7f2d518c8000 r-xp 00000000 08:02 795718 /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0
7f2d518c8000-7f2d51ac7000 ---p 00005000 08:02 795718 /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0
7f2d51ac7000-7f2d51ac8000 r--p 00004000 08:02 795718 /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0
7f2d51ac8000-7f2d51ac9000 rw-p 00005000 08:02 795718 /usr/lib/x86_64-linux-gnu/libXfixes.so.3.1.0
7f2d51ac9000-7f2d51ad2000 r-xp 00000000 08:02 795710 /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7f2d51ad2000-7f2d51cd1000 ---p 00009000 08:02 795710 /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7f2d51cd1000-7f2d51cd2000 r--p 00008000 08:02 795710 /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7f2d51cd2000-7f2d51cd3000 rw-p 00009000 08:02 795710 /usr/lib/x86_64-linux-gnu/libXcursor.so.1.0.2
7f2d51cf5000-7f2d51d75000 rw-s 1e3593000 00:06 591 /dev/nvidiactl
7f2d51d75000-7f2d51df5000 rw-s 1e3512000 00:06 591 /dev/nvidiactl
7f2d51df5000-7f2d51e75000 rw-s 1e348a000 00:06 591 /dev/nvidiactl
7f2d51e75000-7f2d51f75000 rw-s 1eb766000 00:06 591 /dev/nvidiactl
7f2d51f75000-7f2d51f88000 rw-s 1eb5f8000 00:06 591 /dev/nvidiactl
7f2d51f88000-7f2d51fa8000 rw-s c03c0000 00:06 592 /dev/nvidia0
7f2d51fa8000-7f2d51fe8000 rw-s 1eb6cb000 00:06 591 /dev/nvidiactl
7f2d51fe8000-7f2d52028000 rw-s 1eb574000 00:06 591 /dev/nvidiactl
7f2d52028000-7f2d521d9000 rw-p 00000000 00:00 0
7f2d521d9000-7f2d535d9000 r-xp 00000000 08:02 3030116 /usr/lib/nvidia-378/libnvidia-glcore.so.378.13
7f2d535d9000-7f2d535fa000 rwxp 01400000 08:02 3030116 /usr/lib/nvidia-378/libnvidia-glcore.so.378.13
7f2d535fa000-7f2d539cc000 r-xp 01421000 08:02 3030116 /usr/lib/nvidia-378/libnvidia-glcore.so.378.13
7f2d539cc000-7f2d53bcb000 ---p 017f3000 08:02 3030116 /usr/lib/nvidia-378/libnvidia-glcore.so.378.13
7f2d53bcb000-7f2d53fb7000 rw-p 017f2000 08:02 3030116 /usr/lib/nvidia-378/libnvidia-glcore.so.378.13
7f2d53fb7000-7f2d53fcf000 rw-p 00000000 00:00 0
7f2d53fcf000-7f2d53fd2000 r-xp 00000000 08:02 3030149 /usr/lib/nvidia-378/tls/libnvidia-tls.so.378.13
7f2d53fd2000-7f2d541d2000 ---p 00003000 08:02 3030149 /usr/lib/nvidia-378/tls/libnvidia-tls.so.378.13
7f2d541d2000-7f2d541d3000 rw-p 00003000 08:02 3030149 /usr/lib/nvidia-378/tls/libnvidia-tls.so.378.13
7f2d541d3000-7f2d5429d000 r-xp 00000000 08:02 3030139 /usr/lib/nvidia-378/libGLX_nvidia.so.378.13
7f2d5429d000-7f2d542d1000 rwxp 000ca000 08:02 3030139 /usr/lib/nvidia-378/libGLX_nvidia.so.378.13
7f2d542d1000-7f2d542e5000 r-xp 000fe000 08:02 3030139 /usr/lib/nvidia-378/libGLX_nvidia.so.378.13
7f2d542e5000-7f2d544e5000 ---p 00112000 08:02 3030139 /usr/lib/nvidia-378/libGLX_nvidia.so.378.13
7f2d544e5000-7f2d5450d000 rw-p 00112000 08:02 3030139 /usr/lib/nvidia-378/libGLX_nvidia.so.378.13
7f2d5450d000-7f2d54514000 rw-p 00000000 00:00 0
7f2d54514000-7f2d54519000 r-xp 00000000 08:02 795714 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f2d54519000-7f2d54718000 ---p 00005000 08:02 795714 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f2d54718000-7f2d54719000 r--p 00004000 08:02 795714 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f2d54719000-7f2d5471a000 rw-p 00005000 08:02 795714 /usr/lib/x86_64-linux-gnu/libXdmcp.so.6.0.0
7f2d5471a000-7f2d5471c000 r-xp 00000000 08:02 795703 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f2d5471c000-7f2d5491c000 ---p 00002000 08:02 795703 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f2d5491c000-7f2d5491d000 r--p 00002000 08:02 795703 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f2d5491d000-7f2d5491e000 rw-p 00003000 08:02 795703 /usr/lib/x86_64-linux-gnu/libXau.so.6.0.0
7f2d5491e000-7f2d54927000 r-xp 00000000 08:02 795736 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f2d54927000-7f2d54b26000 ---p 00009000 08:02 795736 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f2d54b26000-7f2d54b27000 r--p 00008000 08:02 795736 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f2d54b27000-7f2d54b28000 rw-p 00009000 08:02 795736 /usr/lib/x86_64-linux-gnu/libXrender.so.1.3.0
7f2d54b28000-7f2d54b4c000 r-xp 00000000 08:02 2101871 /lib/x86_64-linux-gnu/libpng12.so.0.54.0
7f2d54b4c000-7f2d54d4b000 ---p 00024000 08:02 2101871 /lib/x86_64-linux-gnu/libpng12.so.0.54.0
7f2d54d4b000-7f2d54d4c000 r--p 00023000 08:02 2101871 /lib/x86_64-linux-gnu/libpng12.so.0.54.0
7f2d54d4c000-7f2d54d4d000 rw-p 00024000 08:02 2101871 /lib/x86_64-linux-gnu/libpng12.so.0.54.0
7f2d54d4d000-7f2d54d66000 r-xp 00000000 08:02 2101920 /lib/x86_64-linux-gnu/libz.so.1.2.8
7f2d54d66000-7f2d54f65000 ---p 00019000 08:02 2101920 /lib/x86_64-linux-gnu/libz.so.1.2.8
7f2d54f65000-7f2d54f66000 r--p 00018000 08:02 2101920 /lib/x86_64-linux-gnu/libz.so.1.2.8
7f2d54f66000-7f2d54f67000 rw-p 00019000 08:02 2101920 /lib/x86_64-linux-gnu/libz.so.1.2.8
7f2d54f67000-7f2d54f88000 r-xp 00000000 08:02 797052 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f2d54f88000-7f2d55187000 ---p 00021000 08:02 797052 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f2d55187000-7f2d55188000 r--p 00020000 08:02 797052 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f2d55188000-7f2d55189000 rw-p 00021000 08:02 797052 /usr/lib/x86_64-linux-gnu/libxcb.so.1.1.0
7f2d55189000-7f2d5518d000 r-xp 00000000 08:02 2097793 /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7f2d5518d000-7f2d5538c000 ---p 00004000 08:02 2097793 /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7f2d5538c000-7f2d5538d000 r--p 00003000 08:02 2097793 /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7f2d5538d000-7f2d5538e000 rw-p 00004000 08:02 2097793 /lib/x86_64-linux-gnu/libuuid.so.1.3.0
7f2d5538e000-7f2d553dc000 r-xp 00000000 08:02 3030118 /usr/lib/nvidia-378/libGLdispatch.so.0
7f2d553dc000-7f2d5540e000 r-xp 0004e000 08:02 3030118 /usr/lib/nvidia-378/libGLdispatch.so.0
7f2d5540e000-7f2d55448000 r-xp 00080000 08:02 3030118 /usr/lib/nvidia-378/libGLdispatch.so.0
7f2d55448000-7f2d55648000 ---p 000ba000 08:02 3030118 /usr/lib/nvidia-378/libGLdispatch.so.0
7f2d55648000-7f2d55657000 rw-p 000ba000 08:02 3030118 /usr/lib/nvidia-378/libGLdispatch.so.0
7f2d55657000-7f2d55677000 rw-p 00000000 00:00 0
7f2d55677000-7f2d55686000 r-xp 00000000 08:02 3030153 /usr/lib/nvidia-378/libGLX.so.0
7f2d55686000-7f2d55886000 ---p 0000f000 08:02 3030153 /usr/lib/nvidia-378/libGLX.so.0
7f2d55886000-7f2d55887000 rw-p 0000f000 08:02 3030153 /usr/lib/nvidia-378/libGLX.so.0
7f2d55887000-7f2d558a7000 rw-p 00000000 00:00 0
7f2d558a7000-7f2d558aa000 r-xp 00000000 08:02 2100368 /lib/x86_64-linux-gnu/libdl-2.23.so
7f2d558aa000-7f2d55aa9000 ---p 00003000 08:02 2100368 /lib/x86_64-linux-gnu/libdl-2.23.so
7f2d55aa9000-7f2d55aaa000 r--p 00002000 08:02 2100368 /lib/x86_64-linux-gnu/libdl-2.23.so
7f2d55aaa000-7f2d55aab000 rw-p 00003000 08:02 2100368 /lib/x86_64-linux-gnu/libdl-2.23.so
7f2d55aab000-7f2d55ab5000 r-xp 00000000 08:02 795734 /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f2d55ab5000-7f2d55cb4000 ---p 0000a000 08:02 795734 /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f2d55cb4000-7f2d55cb5000 r--p 00009000 08:02 795734 /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f2d55cb5000-7f2d55cb6000 rw-p 0000a000 08:02 795734 /usr/lib/x86_64-linux-gnu/libXrandr.so.2.2.0
7f2d55cb6000-7f2d55cbd000 r-xp 00000000 08:02 2100360 /lib/x86_64-linux-gnu/librt-2.23.so
7f2d55cbd000-7f2d55ebc000 ---p 00007000 08:02 2100360 /lib/x86_64-linux-gnu/librt-2.23.so
7f2d55ebc000-7f2d55ebd000 r--p 00006000 08:02 2100360 /lib/x86_64-linux-gnu/librt-2.23.so
7f2d55ebd000-7f2d55ebe000 rw-p 00007000 08:02 2100360 /lib/x86_64-linux-gnu/librt-2.23.so
7f2d55ebe000-7f2d55ed6000 r-xp 00000000 08:02 2100382 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f2d55ed6000-7f2d560d5000 ---p 00018000 08:02 2100382 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f2d560d5000-7f2d560d6000 r--p 00017000 08:02 2100382 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f2d560d6000-7f2d560d7000 rw-p 00018000 08:02 2100382 /lib/x86_64-linux-gnu/libpthread-2.23.so
7f2d560d7000-7f2d560db000 rw-p 00000000 00:00 0
7f2d560db000-7f2d56132000 r-xp 00000000 08:02 796440 /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
7f2d56132000-7f2d56332000 ---p 00057000 08:02 796440 /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
7f2d56332000-7f2d56333000 r--p 00057000 08:02 796440 /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
7f2d56333000-7f2d56334000 rw-p 00058000 08:02 796440 /usr/lib/x86_64-linux-gnu/libjpeg.so.8.0.2
7f2d56334000-7f2d563d8000 r-xp 00000000 08:02 796120 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.1
7f2d563d8000-7f2d565d7000 ---p 000a4000 08:02 796120 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.1
7f2d565d7000-7f2d565dd000 r--p 000a3000 08:02 796120 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.1
7f2d565dd000-7f2d565de000 rw-p 000a9000 08:02 796120 /usr/lib/x86_64-linux-gnu/libfreetype.so.6.12.1
7f2d565de000-7f2d565ef000 r-xp 00000000 08:02 795716 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f2d565ef000-7f2d567ee000 ---p 00011000 08:02 795716 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f2d567ee000-7f2d567ef000 r--p 00010000 08:02 795716 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f2d567ef000-7f2d567f0000 rw-p 00011000 08:02 795716 /usr/lib/x86_64-linux-gnu/libXext.so.6.4.0
7f2d567f0000-7f2d56925000 r-xp 00000000 08:02 795699 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f2d56925000-7f2d56b25000 ---p 00135000 08:02 795699 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f2d56b25000-7f2d56b26000 r--p 00135000 08:02 795699 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f2d56b26000-7f2d56b2a000 rw-p 00136000 08:02 795699 /usr/lib/x86_64-linux-gnu/libX11.so.6.3.0
7f2d56b2a000-7f2d56b40000 r-xp 00000000 08:02 795623 /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0
7f2d56b40000-7f2d56d3f000 ---p 00016000 08:02 795623 /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0
7f2d56d3f000-7f2d56d40000 r--p 00015000 08:02 795623 /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0
7f2d56d40000-7f2d56d41000 rw-p 00016000 08:02 795623 /usr/lib/x86_64-linux-gnu/libICE.so.6.3.0
7f2d56d41000-7f2d56d44000 rw-p 00000000 00:00 0
7f2d56d44000-7f2d56d4b000 r-xp 00000000 08:02 795695 /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1
7f2d56d4b000-7f2d56f4a000 ---p 00007000 08:02 795695 /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1
7f2d56f4a000-7f2d56f4b000 r--p 00006000 08:02 795695 /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1
7f2d56f4b000-7f2d56f4c000 rw-p 00007000 08:02 795695 /usr/lib/x86_64-linux-gnu/libSM.so.6.0.1
7f2d56f4c000-7f2d56f7e000 r-xp 00000000 08:02 3030150 /usr/lib/nvidia-378/libGL.so.1.0.0
7f2d56f7e000-7f2d56fb0000 r-xp 00032000 08:02 3030150 /usr/lib/nvidia-378/libGL.so.1.0.0
7f2d56fb0000-7f2d56fda000 r-xp 00064000 08:02 3030150 /usr/lib/nvidia-378/libGL.so.1.0.0
7f2d56fda000-7f2d571da000 ---p 0008e000 08:02 3030150 /usr/lib/nvidia-378/libGL.so.1.0.0
7f2d571da000-7f2d571db000 rw-p 0008e000 08:02 3030150 /usr/lib/nvidia-378/libGL.so.1.0.0
7f2d571db000-7f2d571dc000 rw-p 00000000 00:00 0
7f2d571dc000-7f2d5739b000 r-xp 00000000 08:02 2100370 /lib/x86_64-linux-gnu/libc-2.23.so
7f2d5739b000-7f2d5759b000 ---p 001bf000 08:02 2100370 /lib/x86_64-linux-gnu/libc-2.23.so
7f2d5759b000-7f2d5759f000 r--p 001bf000 08:02 2100370 /lib/x86_64-linux-gnu/libc-2.23.so
7f2d5759f000-7f2d575a1000 rw-p 001c3000 08:02 2100370 /lib/x86_64-linux-gnu/libc-2.23.so
7f2d575a1000-7f2d575a5000 rw-p 00000000 00:00 0
7f2d575a5000-7f2d575bb000 r-xp 00000000 08:02 2101769 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f2d575bb000-7f2d577ba000 ---p 00016000 08:02 2101769 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f2d577ba000-7f2d577bb000 rw-p 00015000 08:02 2101769 /lib/x86_64-linux-gnu/libgcc_s.so.1
7f2d577bb000-7f2d578c3000 r-xp 00000000 08:02 2100380 /lib/x86_64-linux-gnu/libm-2.23.so
7f2d578c3000-7f2d57ac2000 ---p 00108000 08:02 2100380 /lib/x86_64-linux-gnu/libm-2.23.so
7f2d57ac2000-7f2d57ac3000 r--p 00107000 08:02 2100380 /lib/x86_64-linux-gnu/libm-2.23.so
7f2d57ac3000-7f2d57ac4000 rw-p 00108000 08:02 2100380 /lib/x86_64-linux-gnu/libm-2.23.so
7f2d57ac4000-7f2d57c36000 r-xp 00000000 08:02 787980 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f2d57c36000-7f2d57e36000 ---p 00172000 08:02 787980 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f2d57e36000-7f2d57e40000 r--p 00172000 08:02 787980 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f2d57e40000-7f2d57e42000 rw-p 0017c000 08:02 787980 /usr/lib/x86_64-linux-gnu/libstdc++.so.6.0.21
7f2d57e42000-7f2d57e46000 rw-p 00000000 00:00 0
7f2d57e46000-7f2d57e53000 r-xp 00000000 08:02 3015624 /usr/lib/libsfml-system.so.2.4.2
7f2d57e53000-7f2d58052000 ---p 0000d000 08:02 3015624 /usr/lib/libsfml-system.so.2.4.2
7f2d58052000-7f2d58053000 rw-p 0000c000 08:02 3015624 /usr/lib/libsfml-system.so.2.4.2
7f2d58053000-7f2d58075000 r-xp 00000000 08:02 3015627 /usr/lib/libsfml-window.so.2.4.2
7f2d58075000-7f2d58275000 ---p 00022000 08:02 3015627 /usr/lib/libsfml-window.so.2.4.2
7f2d58275000-7f2d58276000 rw-p 00022000 08:02 3015627 /usr/lib/libsfml-window.so.2.4.2
7f2d58276000-7f2d58277000 rw-p 00000000 00:00 0
7f2d58277000-7f2d582c4000 r-xp 00000000 08:02 3015633 /usr/lib/libsfml-graphics.so.2.4.2
7f2d582c4000-7f2d584c3000 ---p 0004d000 08:02 3015633 /usr/lib/libsfml-graphics.so.2.4.2
7f2d584c3000-7f2d584c5000 rw-p 0004c000 08:02 3015633 /usr/lib/libsfml-graphics.so.2.4.2
7f2d584c5000-7f2d584c6000 rw-p 00000000 00:00 0
7f2d584c6000-7f2d584d6000 r-xp 00000000 08:02 2100348 /lib/x86_64-linux-gnu/ld-2.23.so
7f2d584d6000-7f2d584d7000 r-xp 00010000 08:02 2100348 /lib/x86_64-linux-gnu/ld-2.23.so
7f2d584d7000-7f2d584ec000 r-xp 00011000 08:02 2100348 /lib/x86_64-linux-gnu/ld-2.23.so
7f2d584f2000-7f2d58512000 rw-s 1eb561000 00:06 591 /dev/nvidiactl
7f2d58512000-7f2d58532000 rw-s 1eb65b000 00:06 591 /dev/nvidiactl
7f2d58532000-7f2d58572000 rw-s a20b8000 00:06 591 /dev/nvidiactl
7f2d58572000-7f2d58592000 rw-s a214e000 00:06 591 /dev/nvidiactl
7f2d58592000-7f2d58697000 rw-s 0ade7000 00:06 591 /dev/nvidiactl
7f2d58697000-7f2d586a1000 rw-p 00000000 00:00 0
7f2d586a1000-7f2d586bf000 r-xp 00000000 08:02 2097534 /lib/x86_64-linux-gnu/libudev.so.1.6.4
7f2d586bf000-7f2d586c0000 r--p 0001d000 08:02 2097534 /lib/x86_64-linux-gnu/libudev.so.1.6.4
7f2d586c0000-7f2d586c1000 rw-p 0001e000 08:02 2097534 /lib/x86_64-linux-gnu/libudev.so.1.6.4
7f2d586c1000-7f2d586c7000 rw-p 00000000 00:00 0
7f2d586d1000-7f2d586d2000 rw-p 00000000 00:00 0
7f2d586d2000-7f2d586d4000 rw-s 00000000 08:02 262928 /tmp/.gljLFg1G (deleted)
7f2d586d4000-7f2d586d5000 rw-s 1eb5f7000 00:06 591 /dev/nvidiactl
7f2d586d5000-7f2d586d9000 rw-s 1eb5f3000 00:06 591 /dev/nvidiactl
7f2d586d9000-7f2d586da000 rw-s cfde6000 00:06 592 /dev/nvidia0
7f2d586da000-7f2d586e5000 rw-p 00000000 00:00 0
7f2d586e5000-7f2d586e6000 rw-s cfde6000 00:06 592 /dev/nvidia0
7f2d586e6000-7f2d586e7000 rw-s cfde6000 00:06 592 /dev/nvidia0
7f2d586e7000-7f2d586e8000 rw-s 343e7000 00:06 591 /dev/nvidiactl
7f2d586e8000-7f2d586e9000 rw-s fa060000 00:06 592 /dev/nvidia0
7f2d586e9000-7f2d586eb000 rw-p 00000000 00:00 0
7f2d586eb000-7f2d586ec000 r--p 00025000 08:02 2100348 /lib/x86_64-linux-gnu/ld-2.23.so
7f2d586ec000-7f2d586ed000 rw-p 00026000 08:02 2100348 /lib/x86_64-linux-gnu/ld-2.23.so
7f2d586ed000-7f2d586ee000 rw-p 00000000 00:00 0
7ffd483cb000-7ffd483ec000 rw-p 00000000 00:00 0 [stack]
7ffd483f8000-7ffd483fa000 r--p 00000000 00:00 0 [vvar]
7ffd483fa000-7ffd483fc000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
Aborted (core dumped)
我尝试安装最新的 nvidia 驱动程序并重新启动系统,但没有成功。我是否缺少某些依赖项?
编辑:我尝试使用 GDB 进行调试,这是我得到的回溯:
Program received signal SIGABRT, Aborted.
0x00007ffff6dc2428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007ffff6dc2428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1 0x00007ffff6dc402a in __GI_abort () at abort.c:89
#2 0x00007ffff6e047ea in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7ffff6f1d2e0 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
#3 0x00007ffff6e0ce0a in malloc_printerr (ar_ptr=<optimised out>, ptr=<optimised out>, str=0x7ffff6f1a0b2 "free(): invalid pointer", action=3) at malloc.c:5004
#4 _int_free (av=<optimised out>, p=<optimised out>, have_lock=0) at malloc.c:3865
#5 0x00007ffff6e1098c in __GI___libc_free (mem=<optimised out>) at malloc.c:2966
#6 0x0000000000401750 in __gnu_cxx::new_allocator<unsigned int>::deallocate(unsigned int*, unsigned long) ()
#7 0x000000000040171f in __gnu_cxx::__alloc_traits<std::allocator<unsigned int> >::deallocate(std::allocator<unsigned int>&, unsigned int*, unsigned long) ()
#8 0x00000000004016ae in std::__cxx11::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::_M_destroy(unsigned long) ()
#9 0x0000000000401624 in std::__cxx11::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::_M_dispose() ()
#10 0x00000000004015a3 in std::__cxx11::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::~basic_string() ()
#11 0x000000000040156a in sf::String::~String() ()
#12 0x00007ffff7934f27 in (anonymous namespace)::ewmhSupported () at /usr/local/share/buildslave/debian-gcc-64/build/src/SFML/Window/Unix/WindowImplX11.cpp:253
#13 0x00007ffff7935da9 in sf::priv::WindowImplX11::WindowImplX11 (this=0x83c480, mode=..., title=..., style=7, settings=...)
at /usr/local/share/buildslave/debian-gcc-64/build/src/SFML/Window/Unix/WindowImplX11.cpp:451
#14 0x00007ffff792f229 in sf::priv::WindowImpl::create (mode=..., title=..., style=7, settings=...) at /usr/local/share/buildslave/debian-gcc-64/build/src/SFML/Window/WindowImpl.cpp:71
#15 0x00007ffff792e7b3 in sf::Window::create (this=0x7fffffffdc20, mode=..., title=..., style=7, settings=...) at /usr/local/share/buildslave/debian-gcc-64/build/src/SFML/Window/Window.cpp:124
#16 0x00007ffff7ba796b in sf::RenderWindow::RenderWindow (this=0x7fffffffdc20, mode=..., title=..., style=7, settings=...)
at /usr/local/share/buildslave/debian-gcc-64/build/src/SFML/Graphics/RenderWindow.cpp:45
#17 0x000000000040131e in main ()
最佳答案
所以答案可能应该是:自己构建 SFML 2.4.2。但是使用我自建的 SFML 在编译简单的 SFML 示例代码时也会产生错误,这次是在链接阶段由于 Ubuntu 中的一些已知错误。不过有一个简单的修复方法:
Download the SFML source code. Unpack it. Navigate to the root directory of the unzipped source code.
vim ./SFML/src/SFML/Graphics/CMakeLists.txt
Find the line on about line 149 -ish... yours may be different, since this is line 149 AFTER I made changes... which reads:
149 # ImageLoader.cpp must be compiled with the -fno-strict-aliasing
150 # when gcc is used; otherwise saving PNGs may crash in stb_image_write
151 if(SFML_COMPILER_GCC)
152 set_source_files_properties(${SRCROOT}/ImageLoader.cpp PROPERTIES COMPILE_FLAGS -fno-strict-aliasing)
153 endif()
Add the following lines BELOW
156 if(SFML_COMPILER_GCC AND BUILD_SHARED_LIBS)
157 message(WARNING "Applying workaround for https://bugs.launchpad.net/ubuntu/+source/gcc-5/+bug/1568899")
158 list(APPEND GRAPHICS_EXT_LIBS "-lgcc_s -lgcc")
159 endif()
Then cd to root dir of unpacked source
cmake .
make all
sudo make install
我在 SFML 论坛上找到的:http://en.sfml-dev.org/forums/index.php?topic=20638.0 .
如果您不关心在 Ubuntu 存储库中获取最新版本,也可以使用 SFML 2.3,您可以使用 apt-get 安装它。
关于c++ - 简单教程 SFML 代码在 Ubuntu 16.04 上崩溃,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42318800/
我有一段代码看起来像这样: void update_clock(uint8_t *time_array) { time_t time = *((time_t *) &time_array[0]
应用程序崩溃了 :( 请帮助我.. 在这方面失败了。我找不到错误?该应用程序可以连接到 iTunesConnect 但它会出错。 谁能根据下面的崩溃报告判断问题出在哪里? share_with_app
小二是新来的实习生,作为技术 leader,我给他安排了一个非常简单的练手任务,把前端 markdown 编辑器里上传的图片保存到服务器端,结果他真的就把图片直接保存到了服务器上,这下可把我气坏了,就
我正在创建一个函数,它将目录路径作为参数传递,或者如果它留空,则提示用户输入。 我已经设置了我的 PATH_MAX=100 和 if 语句来检查 if ((strlen(folder path) +
我已将“arial.ttf”文件(从我的/Windows/Fonts 文件夹中获取)加载到内存中,但是将其传递到 FT_New_Memory_Face 时会崩溃(在 FT_Open_Face 中的某处
我正在尝试在我的计算机上的两个控制台之间进行 rtsp 流。 在控制台 1 上,我有: ffmpeg -rtbufsize 100M -re -f dshow -s 320x240 -i video=
我正在尝试使用 scio_beast在一个项目中。我知道它还没有完成,但这并不重要。我已经设法让它工作得很好。 我现在正在尝试连接到 CloudFlare 后面的服务器,我知道我需要 SNI 才能工作
我有一个带有关联宏的下拉列表,如下所示: Sub Drop() If Range("Hidden1!A1") = "1" Then Sheets("Sheet1").Se
我对 bash 很陌生。我要做的就是运行这个nvvp -vm /usr/lib64/jvm/jre-1.8.0/bin/java无需记住最后的路径。我认为 instafix 就是这样做...... n
我在 Windows 上使用 XAMPP 已经两年左右了,它运行完美,没有崩溃没有问题。 (直到四个月前。) 大约四个月前,我们将服务器/系统升级到了更快的规范。 这是旧规范的内容 - Windows
我面临着一个非常烦人的 android 崩溃,它发生在大约 1% 的 PRODUCTION session 中,应用程序始终在后台运行。 Fatal Exception: android.app.Re
尝试使用下面的函数: public void createObjectType() { try { mCloudDB.createObjectType(ObjectTypeIn
由于我正在进行的一个项目,我在 CF11 管理员中弄乱了类路径,我设法使服务器崩溃,以至于我唯一得到的是一个漂亮的蓝屏和 500 错误.我已经检查了日志,我会把我能做的贴在帖子的底部,但我希望有人会启
关闭。这个问题不满足Stack Overflow guidelines .它目前不接受答案。 想改善这个问题吗?更新问题,使其成为 on-topic对于堆栈溢出。 10 个月前关闭。 Improve
我最近从 xcode 3.x 更新到 4.2,当我在 4.2 中运行应用程序时,我遇到了核心数据问题。我还更新到了 iOS 5,所以问题可能就在那里,我不太确定。 这些应用程序在 3.x 中运行良好,
我是一个相对较新的 iPhone 应用程序开发人员,所以我的知识有点粗略,所以如果这是一个微不足道的问题,请原谅我。 我有一个导航应用程序,它通过在navigationController对象上调用p
if ([MFMailComposeViewController canSendMail]) { MFMailComposeViewController *mailViewController
你能帮我吗? 我正在设置 UILocalNotification,当我尝试设置其 userInfo 字典时,它崩溃了。 fetchedObjects 包含 88 个对象。 这是代码: NSDi
为什么我的代码中突然出现 NSFastEnumeration Mutation Handler 崩溃。我很茫然为什么会突然出现这个崩溃以及如何解决它。 最佳答案 崩溃错误: **** 由于未捕获的异常
当我从表中删除行时,我的应用程序崩溃了。这是我检测到错误和堆栈跟踪的来源。谢谢! //delete row from database - (void)tableView:(UITableView *
我是一名优秀的程序员,十分优秀!