RError.com

RError.com Logo RError.com Logo

RError.com Navigation

  • 主页

Mobile menu

Close
  • 主页
  • 系统&网络
    • 热门问题
    • 最新问题
    • 标签
  • Ubuntu
    • 热门问题
    • 最新问题
    • 标签
  • 帮助
主页 / user-11102

shaman888's questions

Martin Hope
shaman888
Asked: 2020-05-06 21:00:51 +0000 UTC

使用 ++ malloc 未完全分配内存

  • 0

为什么我只为一个元素分配内存?

...
        double * dd = (double*)malloc(size*sizeof (double));
        std::cout << "multiple void dd " << sizeof (dd)/sizeof (double) << " size "<< size <<std::endl;
...
run

multiple void dd 1 size 2625

修复的第二个实现:

...
    double * dd = new double (size);
    free(dd);
    double dd1 = *dd;;
    std::cout << "multiple void dd1 " << sizeof (dd1)/sizeof (double) << " size "<< size <<std::endl;
...

run

multiple void dd1 1 size 2625
c++
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-05-03 19:06:04 +0000 UTC

无法通过公钥连接 ssh

  • 0

两台主机上的 Ubuntu 18.04x64

ssh-keygen -t rsa
ssh-copy-id -i ~/.ssh/id_rsa.pub user@192.168.0.10

ssh -vvv user@192.168.0.10

debug3: authmethod_lookup publickey 
debug3: remaining preferred: keyboard-interactive,password 
debug3: authmethod_is_enabled publickey debug1: Next authentication method: publickey debug1: Offering public key: RSA SHA256:0TxSX/JrA4MPDwj/iac86aOwmZbir+e6sGBp6CdiZK8 /home/alexandr/.ssh/id_rsa 
debug3: send_pubkey_test 
debug3: send packet: type 50 
debug2: we sent a publickey packet, wait for reply 
debug3: receive packet: type 51

user@user-desktop:~$ sudo nano /etc/ssh/sshd_config

UseDNS no
PermitRootLogin yes
SyslogFacility AUTH
LogLevel INFO
AddressFamily any
Protocol 1, 2
PubkeyAuthentication yes
RSAAuthentication yes
AuthorizedKeysFile      .ssh/authorized_keys .ssh/authorized_keys2 /etc/ssh/user/authorized_keys
ChallengeResponseAuthentication no
UsePAM yes
X11Forwarding yes
PrintMotd no
AcceptEnv LANG LC_*
Subsystem       sftp    /usr/lib/openssh/sftp-server


ls -alh ~/.ssh
итого 24K
drwx------  2 user user 4,0K мая  3 15:35 .
drwxrwxrwx 28 user user 4,0K мая  3 16:24 ..
-rw-------  1 user user 2,5K мая  3 15:47 authorized_keys
-rw-------  1 user user  771 мая  3 14:54 id_dsa
-rw-r--r--  1 user user  607 мая  3 14:54 id_dsa.pub
-rw-r--r--  1 user user  444 мая  3 14:56 known_hosts

在服务器上:

journalctl -f

Authentication refused: bad ownership or modes for directory /home/user/.ssh
linux
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-04-15 12:37:02 +0000 UTC

未定义对“Magick::Image::Image()”的引用

  • 0

告诉我缺少什么?

主文件

#include <iostream>
#include "image.h"
#include <Magick++.h>

using namespace std;
using namespace Magick;

int main(int argc,char **argv)
{
    Magick::InitializeMagick(*argv);
    Magick::Image image;
      try {
        // Read a file into image object
        image.read( "girl.gif" );

        // Crop the image to specified size (width, height, xOffset, yOffset)
        image.crop( Geometry(100,100, 100, 100) );

        // Write the image to a file
        image.write( "x.gif" );
      }
      catch( Exception &error_ )
        {
          cout << "Caught exception: " << error_.what() << endl;
          return 1;
        }
    return 0;
}

图像.cpp

#include "image.h"
#include <Magick++.h>

Image::Image()
{

}

图像.h

#ifndef IMAGE_H
#define IMAGE_H
#include <vector>
using namespace std;

class Image
{
public:
    Image();



};

#endif // IMAGE_H

CMakeLists.txt c

make_minimum_required(VERSION 3.5)

project(IimageReadObj)
###add_executable(${PROJECT_NAME} "main.cpp")

find_program(MAGICK_CONFIG "Magick++-config")
# Ask about CXX and lib flags/locations
execute_process(COMMAND "${MAGICK_CONFIG}" "--cxxflags" OUTPUT_VARIABLE MAGICK_CXX_FLAGS)
execute_process(COMMAND "${MAGICK_CONFIG}" "--libs" OUTPUT_VARIABLE MAGICK_LD_FLAGS)
# Remove trailing whitespace (CMAKE warns about this)
string(STRIP "${MAGICK_CXX_FLAGS}" MAGICK_CXX_FLAGS)
string(STRIP "${MAGICK_LD_FLAGS}" MAGICK_LD_FLAGS)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++11 ${MAGICK_CXX_FLAGS} ${MAGICK_LD_FLAGS}")
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall ")


# Create a list with all .cpp source files
set( project_sources
   main.cpp
   image.cpp
)

# Create executable with all necessary source files
add_executable(${PROJECT_NAME}
  ${project_sources}
)

find_package(ImageMagick COMPONENTS Magick++)
include_directories(${ImageMagick_INCLUDE_DIRS})

/home/alexandr/programming/IimageReadObj/IimageReadObj/main.cpp:10:错误:未定义引用Magick::InitializeMagick(char const*)' /home/alexandr/programming/IimageReadObj/IimageReadObj/main.cpp:11: ошибка: undefined reference toMagick::Image::Image()' /home/alexandr/programming/IimageReadObj/IimageReadObj/main.cpp:14:错误: 未定义对 Magick::Image::read(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /home/alexandr/programming/IimageReadObj/IimageReadObj/main.cpp:17: ошибка: undefined reference toMagick::Geometry::Geometry(unsigned long, unsigned long, long, long, bool, bool)' /home/alexandr/programming/IimageReadObj/IimageReadObj/main.cpp:17 的引用:错误:未定义对Magick::Image::crop(Magick::Geometry const&)' /home/alexandr/programming/IimageReadObj/IimageReadObj/main.cpp:17: ошибка: undefined reference toMagick的引用::Geometry::~Geometry()' /home/alexandr/programming/IimageReadObj/IimageReadObj/main.cpp:20: 错误:未定义对 Magick::Image::write(std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&)' /home/alexandr/programming/IimageReadObj/IimageReadObj/main.cpp:11: ошибка: undefined reference toMagick::Image::~Image()' /home/alexandr/programming/ 的引用IimageReadObj/IimageReadObj/main.cpp:17:错误:未定义的引用Magick::Geometry::~Geometry()' /home/alexandr/programming/IimageReadObj/IimageReadObj/main.cpp:11: ошибка: undefined reference toMagick::Image::~Image()' /home/alexandr/programming/IimageReadObj/build-IimageReadObj-Desktop_Qt_5_12_0_GCC_64bit-u0412u044bu043fu0443u0441u043a/CMakeFiles/IimagetypeReadObj.dir/main.cpp.o:-1: 错误:未定义对`的引用Magick::Exception' :-1: error: collect2: error: ld returned 1 exit status

c++
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-04-15 12:00:47 +0000 UTC

Ubuntu 18.04 上的 Python3.7 Traceback(最后一次调用)

  • 0

我的行动:

sudo apt install python3.7
sudo apt install python-pip
pip install --user stdin
pip install --user serial
pip install --user numpy

python3.7
>>> ar2.py
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NameError: name 'ar2' is not defined
>>> 

来源

在 Windows 7 中,由于某种原因,ubuntu 18.04 x64 没有问题,它不起作用。

python
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-04-08 11:34:58 +0000 UTC

带有模板的类中未定义的引用

  • 0

分配器.pro

TEMPLATE = app
CONFIG += console c++17
CONFIG -= app_bundle
CONFIG -= qt

SOURCES += \
        main.cpp \
    allocuser.cpp

HEADERS += \
    allocuser.h

分配用户.h

#ifndef ALLOCUSER_H
#define ALLOCUSER_H

#include <bitset>
using namespace std;

class AllocUser
{
private:
public:
    AllocUser();
    const static int maxItem = 1000;
    const static int maxSize = 32;

    static std::bitset<maxItem> bufmap;
    static inline char buf[maxItem * maxSize];
    static int freeblock;

    template <typename T>
        static T *allocate(void) {
                int i;
                static_assert( sizeof(T) < AllocUser::maxSize, "Max size for this allocator excessed " );
                    for(i=AllocUser::freeblock; i<AllocUser::maxItem; i++) {
                            if( !AllocUser::bufmap.test(i) )
                                break;
                }
                if( i==AllocUser::maxItem ) throw new bad_alloc();
                AllocUser::bufmap.set(i, true);
                AllocUser::freeblock=i+1;
                return static_cast<T*> (new (&buf[AllocUser::maxSize*i]) T());
        }
    template <typename T>
        static void deallocate(T *ptr) {
                int i = ( ((char*)ptr)-&buf[0] )/maxSize;
  //              if( !bufmap.test(i) ) throw new logic_error("Wrong deallocate");
                ptr->~T();
                bufmap.set(i, false);
                if( freeblock > i ) freeblock=i;
        }

};
#endif // ALLOCUSER_H

分配用户.cpp

#include "allocuser.h"
using namespace std;

AllocUser::AllocUser()
{
std::bitset<maxItem> bufmap;
}

主文件

#include <iostream>
#include <allocuser.h>
#define MAX_SZ 32
#define MAX_ITEM 1000
using namespace std;

int AllocUser::freeblock=0;

int main()
{
    cout << "Hello World!" << endl;

 //   AllocUser *allocu = new AllocUser ();
  //  int allocu->freeblock=0;
    for(long i=0; i<1000; i++) {
        for(int j=0; j<3; j++){
            int *a = AllocUser::allocate<int>();
            *a=5;
            AllocUser::deallocate( a );
        }
    }
    return 0;
}
c++
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-01-03 20:51:44 +0000 UTC

使用视频 Linux 识别传感器参数

  • 0

有一个传感器,需要从视频中读取其参数。在Linux中根据预设参数识别视频照片的方法是什么?例如,确定箭头的位置,或温度计的水平?

linux
  • 2 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-12-25 15:53:27 +0000 UTC

从 kdenlive rendersources.xml 文件加载提供程序时出错

  • 0

Ubuntu 16.04 x64 Kdenlive 15.12.3

设置->下载新的渲染配置文件...

从文件加载提供程序时出错:https ://kdenlive.org/data/rendersources.xml

如何解决这种情况?

linux
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-11-09 15:43:19 +0000 UTC

/usr/lib/automoc4/Automoc4Config.cmake 处的警告(开发)

  • 1

如何通过满足依赖关系来安静 cmake?

-- Found Qt-Version 4.8.7 (using /usr/bin/qmake-qt4)
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
-- Found KDE 4.12 include dir: /usr/include
-- Found KDE 4.12 library dir: /usr/lib
-- Found the KDE4 kconfig_compiler preprocessor: /usr/bin/kconfig_compiler
-- Found automoc4: /usr/bin/automoc4
-- Found Qt-Version 4.8.7 (using /usr/bin/qmake-qt4)
-- Found X11: /usr/lib/x86_64-linux-gnu/libX11.so
CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1094 (_automoc4_kde4_pre_target_handling)
  src/CMakeLists.txt:218 (kde4_add_library)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  src/CMakeLists.txt:255 (kde4_add_executable)
  src/CMakeLists.txt:284 (add_import_export_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  src/CMakeLists.txt:255 (kde4_add_executable)
  src/CMakeLists.txt:284 (add_import_export_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  src/CMakeLists.txt:255 (kde4_add_executable)
  src/CMakeLists.txt:284 (add_import_export_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  src/CMakeLists.txt:255 (kde4_add_executable)
  src/CMakeLists.txt:284 (add_import_export_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  src/CMakeLists.txt:255 (kde4_add_executable)
  src/CMakeLists.txt:284 (add_import_export_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  src/CMakeLists.txt:255 (kde4_add_executable)
  src/CMakeLists.txt:284 (add_import_export_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  src/CMakeLists.txt:255 (kde4_add_executable)
  src/CMakeLists.txt:284 (add_import_export_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
  src/CMakeLists.txt:268 (kde4_add_unit_test)
  src/CMakeLists.txt:287 (add_datablocks_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
  src/CMakeLists.txt:268 (kde4_add_unit_test)
  src/CMakeLists.txt:287 (add_datablocks_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
  src/CMakeLists.txt:268 (kde4_add_unit_test)
  src/CMakeLists.txt:287 (add_datablocks_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
  src/CMakeLists.txt:268 (kde4_add_unit_test)
  src/CMakeLists.txt:287 (add_datablocks_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
  src/CMakeLists.txt:268 (kde4_add_unit_test)
  src/CMakeLists.txt:287 (add_datablocks_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
  src/CMakeLists.txt:268 (kde4_add_unit_test)
  src/CMakeLists.txt:287 (add_datablocks_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
  src/CMakeLists.txt:268 (kde4_add_unit_test)
  src/CMakeLists.txt:287 (add_datablocks_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
  src/CMakeLists.txt:268 (kde4_add_unit_test)
  src/CMakeLists.txt:287 (add_datablocks_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
  src/CMakeLists.txt:273 (kde4_add_unit_test)
  src/CMakeLists.txt:290 (add_database_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:897 (kde4_add_executable)
  src/CMakeLists.txt:273 (kde4_add_unit_test)
  src/CMakeLists.txt:290 (add_database_test)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/lib/automoc4/Automoc4Config.cmake:179 (get_directory_property):
  Policy CMP0059 is not set: Do no treat DEFINITIONS as a built-in directory
  property.  Run "cmake --help-policy CMP0059" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.
Call Stack (most recent call first):
  /usr/lib/automoc4/Automoc4Config.cmake:243 (_add_automoc4_target)
  /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:1038 (_automoc4_kde4_pre_target_handling)
  src/CMakeLists.txt:339 (kde4_add_executable)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/share/kde4/apps/cmake/modules/MacroOptionalAddSubdirectory.cmake:38 (ADD_SUBDIRECTORY):
  Policy CMP0013 is not set: Duplicate binary directories are not allowed.
  Run "cmake --help-policy CMP0013" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The binary directory

    /home/alexandr/build-krecipes-4_8_7_x64-debug-krecipes/doc

  is already used to build a source directory.  This command uses it to build
  source directory

    /home/alexandr/krecipes/doc

  which can generate conflicting build files.  CMake does not support this
  use case but it used to work accidentally and is being allowed for
  compatibility.
Call Stack (most recent call first):
  CMakeLists.txt:31 (macro_optional_add_subdirectory)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at doc/CMakeLists.txt:1 (add_subdirectory):
  Policy CMP0013 is not set: Duplicate binary directories are not allowed.
  Run "cmake --help-policy CMP0013" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The binary directory

    /home/alexandr/build-krecipes-4_8_7_x64-debug-krecipes/doc/uk

  is already used to build a source directory.  This command uses it to build
  source directory

    /home/alexandr/krecipes/doc/uk

  which can generate conflicting build files.  CMake does not support this
  use case but it used to work accidentally and is being allowed for
  compatibility.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:311 (add_custom_target):
  Policy CMP0002 is not set: Logical target names must be globally unique.
  Run "cmake --help-policy CMP0002" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
Call Stack (most recent call first):
  doc/uk/CMakeLists.txt:1 (kde4_create_handbook)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at doc/CMakeLists.txt:2 (add_subdirectory):
  Policy CMP0013 is not set: Duplicate binary directories are not allowed.
  Run "cmake --help-policy CMP0013" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The binary directory

    /home/alexandr/build-krecipes-4_8_7_x64-debug-krecipes/doc/sv

  is already used to build a source directory.  This command uses it to build
  source directory

    /home/alexandr/krecipes/doc/sv

  which can generate conflicting build files.  CMake does not support this
  use case but it used to work accidentally and is being allowed for
  compatibility.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:311 (add_custom_target):
  Policy CMP0002 is not set: Logical target names must be globally unique.
  Run "cmake --help-policy CMP0002" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
Call Stack (most recent call first):
  doc/sv/CMakeLists.txt:1 (kde4_create_handbook)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at doc/CMakeLists.txt:3 (add_subdirectory):
  Policy CMP0013 is not set: Duplicate binary directories are not allowed.
  Run "cmake --help-policy CMP0013" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The binary directory

    /home/alexandr/build-krecipes-4_8_7_x64-debug-krecipes/doc/en_US

  is already used to build a source directory.  This command uses it to build
  source directory

    /home/alexandr/krecipes/doc/en_US

  which can generate conflicting build files.  CMake does not support this
  use case but it used to work accidentally and is being allowed for
  compatibility.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:311 (add_custom_target):
  Policy CMP0002 is not set: Logical target names must be globally unique.
  Run "cmake --help-policy CMP0002" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
Call Stack (most recent call first):
  doc/en_US/CMakeLists.txt:1 (kde4_create_handbook)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at doc/CMakeLists.txt:4 (add_subdirectory):
  Policy CMP0013 is not set: Duplicate binary directories are not allowed.
  Run "cmake --help-policy CMP0013" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  The binary directory

    /home/alexandr/build-krecipes-4_8_7_x64-debug-krecipes/doc/pt_BR

  is already used to build a source directory.  This command uses it to build
  source directory

    /home/alexandr/krecipes/doc/pt_BR

  which can generate conflicting build files.  CMake does not support this
  use case but it used to work accidentally and is being allowed for
  compatibility.
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) at /usr/share/kde4/apps/cmake/modules/KDE4Macros.cmake:311 (add_custom_target):
  Policy CMP0002 is not set: Logical target names must be globally unique.
  Run "cmake --help-policy CMP0002" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.
Call Stack (most recent call first):
  doc/pt_BR/CMakeLists.txt:1 (kde4_create_handbook)
This warning is for project developers.  Use -Wno-dev to suppress it.

CMake Warning (dev) in CMakeLists.txt:
  No cmake_minimum_required command is present.  A line of code such as

    cmake_minimum_required(VERSION 3.5)

  should be added at the top of the file.  The version specified may be lower
  if you wish to support older CMake versions for this project.  For more
  information run "cmake --help-policy CMP0000".
This warning is for project developers.  Use -Wno-dev to suppress it.

-- Configuring done
-- Generating done
-- Build files have been written to: /home/alexandr/build-krecipes-4_8_7_x64-debug-krecipes
linux
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-11-04 19:56:12 +0000 UTC

将 Qt4 设置为 cmake Ubuntu 16.04 的默认值

  • 0

Linux 4.10.0-38-generic #42~16.04.1-Ubuntu SMP Tue Oct 10 16:32:20 UTC 2017 Qtcreator 需要运行一个 cmake 项目。应该指定哪些启动选项来为 Qt4 设置项目?

附言

将部分问题移至答案。

linux
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-10-26 23:15:33 +0000 UTC

启动wifi BCM43228 Ubuntu 16.04 x64

  • 0

该模块适用于较早安装的操作系统。重新安装 Ubuntu 16.04 x64 操作系统后,网络管理器中不再检测到 wi-fi 适配器。我正在使用本指南。

lspci -knn | grep Net -A2
04:00.0 Network controller [0280]: Broadcom Limited BCM43228 802.11a/b/g/n [14e4:4359]
    Subsystem: Foxconn International, Inc. BCM43228 802.11a/b/g/n [105b:e04b]
    Kernel driver in use: bcma-pci-bridge

之前下载的:

wget http://www.lwfinger.com/b43-firmware/broadcom-wl-5.100.138.tar.bz2

决定在一个干净的系统上运行 live_cd ubuntu 16.04.3 x64

sudo dpkg -i '/media/ubuntu/428c4f8e-4a77-44ea-abd7-655ca90cb321/home/alex/dkms_2.2.0.3-2ubuntu11_all.deb' 
export FIRMWARE_INSTALL_DIR="/lib/firmware"
tar xjf broadcom-wl-5.100.138.tar.bz2
sudo dpkg -i '/media/ubuntu/428c4f8e-4a77-44ea-abd7-655ca90cb321/home/alex/b43-fwcutter_019-2_amd64.deb' 
sudo b43-fwcutter -w "$FIRMWARE_INSTALL_DIR" broadcom-wl-5.100.138/linux/wl_apsta.o
sudo dpkg -i '/media/ubuntu/428c4f8e-4a77-44ea-abd7-655ca90cb321/home/alex/bcmwl-kernel-source_6.30.223.141+bdcom-0ubuntu2_amd64.deb' 
(Чтение базы данных … на данный момент установлен 194521 файл и каталог.)
Подготовка к распаковке …/bcmwl-kernel-source_6.30.223.141+bdcom-0ubuntu2_amd64.deb …
Removing all DKMS Modules
Done.
Распаковывается bcmwl-kernel-source (6.30.223.141+bdcom-0ubuntu2) на замену (6.30.223.141+bdcom-0ubuntu2) …
Настраивается пакет bcmwl-kernel-source (6.30.223.141+bdcom-0ubuntu2) …
Loading new bcmwl-6.30.223.141+bdcom DKMS files...
Building only for 4.10.0-28-generic
Building for architecture x86_64
Building initial module for 4.10.0-28-generic
ERROR: Cannot create report: [Errno 17] File exists: '/var/crash/bcmwl-kernel-source.0.crash'
Error! Bad return status for module build on kernel: 4.10.0-28-generic (x86_64)
Consult /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/make.log for more information.
modprobe: FATAL: Module wl not found in directory /lib/modules/4.10.0-28-generic
update-initramfs is disabled since running on read-only media

build_make.log

DKMS make.log for bcmwl-6.30.223.141+bdcom for kernel 4.10.0-28-generic (x86_64)
Вс окт 29 03:53:06 UTC 2017
make: вход в каталог «/usr/src/linux-headers-4.10.0-28-generic»
CFG80211 API is prefered for this kernel version
Using CFG80211 API
  LD      /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/built-in.o
  CC [M]  /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/shared/linux_osl.o
  CC [M]  /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.o
/var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.c: In function ‘wl_alloc_linux_if’:
/var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.c:1354:64: error: macro "alloc_netdev" requires 4 arguments, but only 3 given
  dev = alloc_netdev(sizeof(priv_link_t), intf_name, ether_setup);
                                                                ^
/var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.c:1354:8: error: ‘alloc_netdev’ undeclared (first use in this function)
  dev = alloc_netdev(sizeof(priv_link_t), intf_name, ether_setup);
        ^
/var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.c:1354:8: note: each undeclared identifier is reported only once for each function it appears in
/var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.c: In function ‘wl_dump_ver’:
/var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.c:2047:3: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time]
   __DATE__, __TIME__, EPI_VERSION_STR);
   ^
/var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.c:2047:13: error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time]
   __DATE__, __TIME__, EPI_VERSION_STR);
             ^
cc1: some warnings being treated as errors
scripts/Makefile.build:294: ошибка выполнения рецепта для цели «/var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.o»
make[1]: *** [/var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.o] Ошибка 1
Makefile:1524: ошибка выполнения рецепта для цели «_module_/var/lib/dkms/bcmwl/6.30.223.141+bdcom/build»
make: *** [_module_/var/lib/dkms/bcmwl/6.30.223.141+bdcom/build] Ошибка 2
make: выход из каталога «/usr/src/linux-headers-4.10.0-28-generic»

bcmwl-kernel-source.0.crash

ProblemType: Package
DKMSBuildLog:
 DKMS make.log for bcmwl-6.30.223.141+bdcom for kernel 4.10.0-28-generic (x86_64)
 Вс окт 29 03:50:17 UTC 2017
 make: вход в каталог «/usr/src/linux-headers-4.10.0-28-generic»
 CFG80211 API is prefered for this kernel version
 Using CFG80211 API
   LD      /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/built-in.o
   CC [M]  /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/shared/linux_osl.o
   CC [M]  /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.o
 /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.c: In function ‘wl_alloc_linux_if’:
 /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.c:1354:64: error: macro "alloc_netdev" requires 4 arguments, but only 3 given
   dev = alloc_netdev(sizeof(priv_link_t), intf_name, ether_setup);
                                                                 ^
 /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.c:1354:8: error: ‘alloc_netdev’ undeclared (first use in this function)
   dev = alloc_netdev(sizeof(priv_link_t), intf_name, ether_setup);
         ^
 /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.c:1354:8: note: each undeclared identifier is reported only once for each function it appears in
 /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.c: In function ‘wl_dump_ver’:
 /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.c:2047:3: error: macro "__DATE__" might prevent reproducible builds [-Werror=date-time]
    __DATE__, __TIME__, EPI_VERSION_STR);
    ^
 /var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.c:2047:13: error: macro "__TIME__" might prevent reproducible builds [-Werror=date-time]
    __DATE__, __TIME__, EPI_VERSION_STR);
              ^
 cc1: some warnings being treated as errors
 scripts/Makefile.build:294: ошибка выполнения рецепта для цели «/var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.o»
 make[1]: *** [/var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.o] Ошибка 1
 Makefile:1524: ошибка выполнения рецепта для цели «_module_/var/lib/dkms/bcmwl/6.30.223.141+bdcom/build»
 make: *** [_module_/var/lib/dkms/bcmwl/6.30.223.141+bdcom/build] Ошибка 2
 make: выход из каталога «/usr/src/linux-headers-4.10.0-28-generic»
DKMSKernelVersion: 4.10.0-28-generic
Date: Sun Oct 29 03:50:23 2017
DuplicateSignature: dkms:bcmwl-kernel-source:6.30.223.141+bdcom-0ubuntu2:/var/lib/dkms/bcmwl/6.30.223.141+bdcom/build/src/wl/sys/wl_linux.c:1354:64: error: macro "alloc_netdev" requires 4 arguments, but only 3 given
Package: bcmwl-kernel-source 6.30.223.141+bdcom-0ubuntu2
PackageVersion: 6.30.223.141+bdcom-0ubuntu2
SourcePackage: bcmwl
Title: bcmwl-kernel-source 6.30.223.141+bdcom-0ubuntu2: bcmwl kernel module failed to build

更新:4

sudo  modprobe  -r  b43
sudo  modprobe  b43

执行上级命令后,尽管报错,还是可以通过live_cd上网,但不是通过安装的系统进行登录。

sudo dpkg -i 'bcmwl-kernel-source_6.30.223.141+bdcom-0ubuntu2_amd64.deb'(Чтение базы данных … на данный момент установлено 177476 файлов и каталогов.)
Подготовка к распаковке bcmwl-kernel-source_6.30.223.141+bdcom-0ubuntu2_amd64.deb …
Removing all DKMS Modules
Done.
Распаковывается bcmwl-kernel-source (6.30.223.141+bdcom-0ubuntu2) на замену (6.30.223.141+bdcom-0ubuntu2) …
Настраивается пакет bcmwl-kernel-source (6.30.223.141+bdcom-0ubuntu2) …
Loading new bcmwl-6.30.223.141+bdcom DKMS files...
Building only for 4.10.0-37-generic
Building for architecture x86_64
Module build for the currently running kernel was skipped since the
kernel source for this kernel does not seem to be installed.
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.10.0-37-generic/modules.dep.bin'
modprobe: FATAL: Module wl not found in directory /lib/modules/4.10.0-37-generic
update-initramfs: deferring update (trigger activated)
Обрабатываются триггеры для initramfs-tools (0.122ubuntu8.8) …
update-initramfs: Generating /boot/initrd.img-4.10.0-28-generic
W: Possible missing firmware /lib/firmware/i915/kbl_dmc_ver1_01.bin for module i915
sudo  modprobe  -r  b43
modprobe: ERROR: ../libkmod/libkmod.c:586 kmod_search_moddep() could not open moddep file '/lib/modules/4.10.0-37-generic/modules.dep.bin'

sudo depmod
depmod: ERROR: could not open directory /lib/modules/4.10.0-37-generic: No such file or directory
depmod: FATAL: could not search modules: No such file or directory

投票修复错误

linux
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-10-19 20:14:15 +0000 UTC

从 Ubuntu 16.04 x64 源编译 gdb 7.12

  • 0

我不明白这个问题以及如何解决它。 下载的 gdb-7.12.tar.gz 解压到 /media/bigdata/home/alexandr1/Program/gdb-7.12 文件夹

cd /media/bigdata/home/alexandr1/Program/gdb-7.12    
./configure
make
sudo make install | grep шибка
/media/bigdata/home/alexandr1/Program/gdb-7.12/missing: 81: /media/bigdata/home/alexandr1/Program/gdb-7.12/missing: makeinfo: not found
WARNING: 'makeinfo' is missing on your system.
         You should only need it if you modified a '.texi' file, or
         any other file indirectly affecting the aspect of the manual.
         You might want to install the Texinfo package:
         <http://www.gnu.org/software/texinfo/>
         The spurious makeinfo call might also be the consequence of
         using a buggy 'make' (AIX, DU, IRIX), in which case you might
         want to install GNU make:
         <http://www.gnu.org/software/make/>
make[5]: *** [gdb.info] Ошибка 127
Makefile:503: ошибка выполнения рецепта для цели «gdb.info»
make[4]: *** [subdir_do] Ошибка 1
Makefile:1519: ошибка выполнения рецепта для цели «subdir_do»
make[3]: *** [install-only] Ошибка 2
Makefile:1253: ошибка выполнения рецепта для цели «install-only»
make[2]: *** [install] Ошибка 2
Makefile:1250: ошибка выполнения рецепта для цели «install»
make[1]: *** [install-gdb] Ошибка 2
Makefile:9190: ошибка выполнения рецепта для цели «install-gdb»
make: *** [install] Ошибка 2
Makefile:2253: ошибка выполнения рецепта для цели «install»
linux
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-10-19 17:25:18 +0000 UTC

更改区域设置 Ubuntu 16.04 x64

  • 1

在对系统进行一些操作后,操作系统界面变成了英文,就像默认启动的所有应用程序一样。我试图通过 GUI 更改语言环境,但一切都在那里。

locale
LANG=ru_RU.UTF-8
LANGUAGE=C.UTF-8
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_COLLATE="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_MESSAGES="ru_RU.UTF-8"
LC_PAPER="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_ALL=ru_RU.UTF-8

locale -a
C
C.UTF-8
en_AG
en_AG.utf8
en_AU.utf8
en_BW.utf8
en_CA.utf8
en_DK.utf8
en_GB.utf8
en_HK.utf8
en_IE.utf8
en_IN
en_IN.utf8
en_NG
en_NG.utf8
en_NZ.utf8
en_PH.utf8
en_SG.utf8
en_US.utf8
en_ZA.utf8
en_ZM
en_ZM.utf8
en_ZW.utf8
POSIX
ru_RU.utf8
ru_UA.utf8

cat /etc/default/locale 
#  File generated by update-locale
LANG="ru_RU.UTF-8"
LANGUAGE="ru:en"
LC_NUMERIC="ru_RU.UTF-8"
LC_TIME="ru_RU.UTF-8"
LC_MONETARY="ru_RU.UTF-8"
LC_PAPER="ru_RU.UTF-8"
LC_IDENTIFICATION="ru_RU.UTF-8"
LC_NAME="ru_RU.UTF-8"
LC_ADDRESS="ru_RU.UTF-8"
LC_TELEPHONE="ru_RU.UTF-8"
LC_MEASUREMENT="ru_RU.UTF-8"

nano ~/.bashrc
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
#export LC_xxx=C.UTF-8
export LC_ALL=ru_RU.UTF-8
...

cat /proc/$(pgrep -u $(whoami) | head -n 1)/environ | xargs -0 -n 1 echo | grep '^\(LANG\|LC\)'
LANG=ru_RU.UTF-8
LANGUAGE=ru:en
LC_ADDRESS=ru_RU.UTF-8
LC_IDENTIFICATION=ru_RU.UTF-8
LC_MEASUREMENT=ru_RU.UTF-8
LC_MONETARY=ru_RU.UTF-8
LC_NAME=ru_RU.UTF-8
LC_NUMERIC=ru_RU.UTF-8
LC_PAPER=ru_RU.UTF-8
LC_TELEPHONE=ru_RU.UTF-8
LC_TIME=ru_RU.UTF-8

localectl
   System Locale: LANG=ru_RU.UTF-8
                  LANGUAGE=ru:en
       VC Keymap: n/a
      X11 Layout: us,ru
       X11 Model: pc105
     X11 Variant: ,
     X11 Options: grp:alt_shift_toggle,grp_led:scroll

由于 gdb 在控制台中用俄语编写,因此使用其 PID 执行命令:

cat /proc/4274/environ 2>/dev/null | xargs -0 -n 1 echo | grep '^\(LANG\|LC\)'
LC_PAPER=ru_RU.UTF-8
LC_ADDRESS=ru_RU.UTF-8
LC_MONETARY=ru_RU.UTF-8
LC_NUMERIC=ru_RU.UTF-8
LC_TELEPHONE=ru_RU.UTF-8
LC_IDENTIFICATION=ru_RU.UTF-8
LANG=ru_RU.UTF-8
LC_MEASUREMENT=ru_RU.UTF-8
LANGUAGE=ru
LC_TIME=ru_RU.UTF-8
LC_NAME=ru_RU.UTF-8

用英语讲:

许格

cat /proc/1257/environ 2>/dev/null | xargs -0 -n 1 echo | grep '^\(LANG\|LC\)'

yandex_browser

cat /proc/2642/environ 2>/dev/null | xargs -0 -n 1 echo | grep '^\(LANG\|LC\)'

更新:1

env | grep '^\(LANG\|LC\)' 
LC_PAPER=ru_RU.UTF-8
LC_ADDRESS=ru_RU.UTF-8
LC_MONETARY=ru_RU.UTF-8
LC_NUMERIC=ru_RU.UTF-8
LC_TELEPHONE=ru_RU.UTF-8
LC_IDENTIFICATION=ru_RU.UTF-8
LANG=ru_RU.UTF-8
LC_MEASUREMENT=ru_RU.UTF-8
LANGUAGE=ru
LC_TIME=ru_RU.UTF-8
LC_NAME=ru_RU.UTF-8

sudo nano /etc/X11/Xsession.d/00upstart

更新:2

添加行:

env | grep '^\(LANG\|LC\)' >> /tmp/log.file

重新启动会话

cat /tmp/log.file 
LC_PAPER=ru_RU.UTF-8
LC_ADDRESS=ru_RU.UTF-8
LC_MONETARY=ru_RU.UTF-8
LC_NUMERIC=ru_RU.UTF-8
LC_TELEPHONE=ru_RU.UTF-8
LC_IDENTIFICATION=ru_RU.UTF-8
LANG=ru_RU.UTF-8
LC_MEASUREMENT=ru_RU.UTF-8
LANGUAGE=C.UTF-8
LC_TIME=ru_RU.UTF-8
LC_NAME=ru_RU.UTF-8
linux
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-10-17 20:17:10 +0000 UTC

在 Ubuntu 16.04 上通过 ssh 获取 github

  • 1
git push -u origin master
Bad owner or permissions on /home/alex/.ssh/config
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

sudo nano /home/alex/.ssh/config 
HOST localhost
HostName localhost

我的行动:

sudo apt-get install git-repo

在页面https://github.com/settings/keys添加了“New SSH key” Title:"ggshaman888" Key:"file content ~/.ssh/id_rsa.pub"

在页面https://github.com/ggshaman888/work_experience/settings字段中的“源您的 GitHub Pages 站点当前正在从主分支构建。了解更多。” 选择“主分支”

cd ~/folder_project
git init
git remote add origin git@github.com:ggshaman888/work_experience.git
git remote -v show
origin  git@github.com:ggshaman888/work_experience.git (fetch)
origin  git@github.com:ggshaman888/work_experience.git (push)
git config --global user.email "gg.shaman888@gmail.com"
git config --global user.name "ggshaman888"
git commit -m "reinitial commit"
linux
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-10-02 18:51:13 +0000 UTC

Qt5中路径的最大字符串长度是多少

  • 0

我注意到更改源的位置会影响对错误的未定义引用,因此我认为问题出在路径的长度上(英文)。我想问一下 Qt5 应用程序中可以使用的最大路径长度是多少?Ubuntu 16.04 x64、qt 5.1、qtcreator 3.5.1

linux
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-09-26 22:09:57 +0000 UTC

Qt5 调试器给出不可读的文本

  • 1

Ubuntu 16.04 x64、qt 5.1、qtcreator 3.5.1 如何使(很快)文本可读?

Отладка запущена
&"warning: GDB: Failed to set controlling terminal: \320\235\320\265\320\277\321\200\320\270\320\274\320\265\320\275\320\270\320\274\321\213\320\271 \320\272 \320\264\320\260\320\275\320\275\320\276\320\274\321\203 \321\203\321\201\321\202\321\200\320\276\320\271\321\201\321\202\320\262\321\203 ioctl\n"
&"Cannot exec  -c exec /media/bigdata/home/alexandr1/Qt/program/progQT/SmtpClient-for-Qt-1.1/demos/build-demo2-5_6-Debug/demo2 .\n"
&"Error: \320\235\320\265\321\202 \321\202\320\260\320\272\320\276\320\263\320\276 \321\204\320\260\320\271\320\273\320\260 \320\270\320\273\320\270 \320\272\320\260\321\202\320\260\320\273\320\276\320\263\320\260\n"
Отладка завершена

在控制台中:

locale
LANG=ru_RU.UTF-8
LANGUAGE=ru
LC_CTYPE="ru_RU.UTF-8"
LC_NUMERIC=ru_RU.UTF-8
LC_TIME=ru_RU.UTF-8
LC_COLLATE="ru_RU.UTF-8"
LC_MONETARY=ru_RU.UTF-8
LC_MESSAGES="ru_RU.UTF-8"
LC_PAPER=ru_RU.UTF-8
LC_NAME=ru_RU.UTF-8
LC_ADDRESS=ru_RU.UTF-8
LC_TELEPHONE=ru_RU.UTF-8
LC_MEASUREMENT=ru_RU.UTF-8
LC_IDENTIFICATION=ru_RU.UTF-8
LC_ALL=

UPD2:

通过控制台运行时:

LC_ALL=C qtcreator

产生:

Отладка запущена
&"warning: GDB: Failed to set controlling terminal: Inappropriate ioctl for device\n"
&"Cannot exec  -c exec /media/bigdata/home/alexandr1/Qt/program/progQT/SmtpClient-for-Qt-1.1/demos/build-demo2-5_6-Debug/demo2 .\n"
&"Error: No such file or directory\n"
Отладка завершена

在代码中:

qDebug() << QLocale::c();

产生(无论 Qt 是如何启动的):

C QLocale(C, Default, Default)
qt
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-09-26 15:15:05 +0000 UTC

/usr/bin/ld: 找不到 -lSMTPEmail

  • 0

有Qt5.6 Ubuntu 16.04x64,源码v1.1

固定 *.pro

# Location of SMTP Library
SMTP_LIBRARY_LOCATION = $$PWD/../../../build/build-SMTPEmail-5_6-Debug

添加 libSMTPEmail.so 到 /usr/lib 构建尝试:

g++ -m64 -o demo2 demo2.o sendemail.o moc_sendemail.o   -L/usr/X11R6/lib64 -L/media/bigdata/home/alexandr1/Qt/program/progQT/SmtpClient-for-Qt-1.1/demos/demo2/../../../build/build-SMTPEmail-5_6-Debug -lSMTPEmail -lQt5Widgets -lQt5Gui -lQt5Core -lGL -lpthread 
/usr/bin/ld: cannot find -lSMTPEmail
Makefile:169: recipe for target 'demo2' failed
collect2: error: ld returned 1 exit status

cd /media/bigdata/home/alexandr1/Qt/program/progQT/build-SMTPEmail-5_6-Debug
# ls | grep libSMTPEmail.so
libSMTPEmail.so
libSMTPEmail.so.1
libSMTPEmail.so.1.0
libSMTPEmail.so.1.0.0
qt
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-06-28 20:08:04 +0000 UTC

具有 8 MB RAM 的 PC 操作系统 [关闭]

  • 7
关闭。这个问题不可能给出客观的回答。目前不接受回复。

想改进这个问题? 重新设计问题,以便可以根据事实和引文来回答。

5 年前关闭。

改进问题

我有一台 90 年代初的计算机,计划用作“微型”控制器。我希望能够用 bash 编写脚本并使用网络。RAM 只有 8 兆字节,可以从硬盘加载。

linux
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-06-28 19:28:20 +0000 UTC

如何从第一个虚拟控制台 ubuntu 16.04 获取消息

  • 0

使用远程访问,您需要查看来自第一个虚拟控制台的消息,因此问题是如何从 ssh 到达第一个 Ubuntu 16.04 终端,或者以其他方式访问输出。

linux
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-06-26 19:11:28 +0000 UTC

/etc/hosts 没有定义 Ubuntu 16.04 主机

  • 0

名称和 IP 地址在 ubuntu 16.04 服务器中不匹配。他所做的只是选择 samba 配置并将用户添加到系统中。可能是什么问题以及如何解决?

sudo /etc/init.d/samba restart
sudo: unable to resolve host servername

sudo nano /etc/hosts
127.0.1.2       servername

ping -c1 servername
ping: unknown host servername

更新 1:

cat /etc/hosts
127.0.0.1       localhost
127.0.1.1       r2d2
127.0.1.2       servername

cat /etc/hostname
r2d2

ip a sh scope host
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN group default qlen 1
    link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
    inet 127.0.0.1/8 scope host lo
       valid_lft forever preferred_lft forever
    inet6 ::1/128 scope host 
       valid_lft forever preferred_lft forever

cat /etc/nsswitch.conf
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc-reference' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.

passwd:         compat
group:          compat
shadow:         compat
gshadow:        files

hosts:          iles mdns4_minimal [NOTFOUND=return] dns mdns4 wins
networks:       files

protocols:      db files
services:       db files
ethers:         db files
rpc:            db files

netgroup:       nis

又一堆错误:

sudo: unable to resolve host r2d2
linux
  • 1 个回答
  • 10 Views
Martin Hope
shaman888
Asked: 2020-06-26 15:21:46 +0000 UTC

Linux Ubuntu 16.04 上的 samba 授权

  • 0

无法登录到名为 hb1c 的远程计算机。ubuntu 16.04 服务器上的服务器

cat /etc/samba/smb.conf | grep -v '#'


[global]


   workgroup = WORKGROUP

    server string = %h server (Samba, Ubuntu)


;   wins server = w.x.y.z

   dns proxy = no


;   interfaces = 127.0.0.0/8 eth0

;   bind interfaces only = yes




   log file = /var/log/samba/log.%m

   max log size = 1000


   syslog = 0

   panic action = /usr/share/samba/panic-action %d



   server role = standalone server

   passdb backend = tdbsam

   obey pam restrictions = yes

   unix password sync = yes

   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

   pam password change = yes

   map to guest = bad user



;   logon path = \\%N\profiles\%U

;   logon drive = H:

;   logon script = logon.cmd

; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u

; add group script = /usr/sbin/addgroup --force-badname %g


;   include = /home/samba/etc/smb.conf.%m

;   idmap uid = 10000-20000
;   idmap gid = 10000-20000
;   template shell = /bin/bash


;   usershare max shares = 100

   usershare allow guests = yes


;[homes]
;   comment = Home Directories
;   browseable = no

;   read only = yes

;   create mask = 0700

;   directory mask = 0700

;   valid users = %S

;[netlogon]
;   comment = Network Logon Service
;   path = /home/samba/netlogon
;   guest ok = yes
;   read only = yes

;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = no
;   browseable = no
;   create mask = 0600
;   directory mask = 0700

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no
;   write list = root, @lpadmin

[hb1c-base]
path = /home/hb1c/1cbase
browseble = yes
guest ok = no
read only = no
valid users = hb1c
create mask = 0750
directory mask = 0750

地位:

watch smbstatus
smbstatus only works as root!

samba -V
Version 4.3.11-Ubuntu
linux
  • 1 个回答
  • 10 Views

Sidebar

Stats

  • 问题 10021
  • Answers 30001
  • 最佳答案 8000
  • 用户 6900
  • 常问
  • 回答
  • Marko Smith

    我看不懂措辞

    • 1 个回答
  • Marko Smith

    请求的模块“del”不提供名为“default”的导出

    • 3 个回答
  • Marko Smith

    "!+tab" 在 HTML 的 vs 代码中不起作用

    • 5 个回答
  • Marko Smith

    我正在尝试解决“猜词”的问题。Python

    • 2 个回答
  • Marko Smith

    可以使用哪些命令将当前指针移动到指定的提交而不更改工作目录中的文件?

    • 1 个回答
  • Marko Smith

    Python解析野莓

    • 1 个回答
  • Marko Smith

    问题:“警告:检查最新版本的 pip 时出错。”

    • 2 个回答
  • Marko Smith

    帮助编写一个用值填充变量的循环。解决这个问题

    • 2 个回答
  • Marko Smith

    尽管依赖数组为空,但在渲染上调用了 2 次 useEffect

    • 2 个回答
  • Marko Smith

    数据不通过 Telegram.WebApp.sendData 发送

    • 1 个回答
  • Martin Hope
    Alexandr_TT 2020年新年大赛! 2020-12-20 18:20:21 +0000 UTC
  • Martin Hope
    Alexandr_TT 圣诞树动画 2020-12-23 00:38:08 +0000 UTC
  • Martin Hope
    Air 究竟是什么标识了网站访问者? 2020-11-03 15:49:20 +0000 UTC
  • Martin Hope
    Qwertiy 号码显示 9223372036854775807 2020-07-11 18:16:49 +0000 UTC
  • Martin Hope
    user216109 如何为黑客设下陷阱,或充分击退攻击? 2020-05-10 02:22:52 +0000 UTC
  • Martin Hope
    Qwertiy 并变成3个无穷大 2020-11-06 07:15:57 +0000 UTC
  • Martin Hope
    koks_rs 什么是样板代码? 2020-10-27 15:43:19 +0000 UTC
  • Martin Hope
    Sirop4ik 向 git 提交发布的正确方法是什么? 2020-10-05 00:02:00 +0000 UTC
  • Martin Hope
    faoxis 为什么在这么多示例中函数都称为 foo? 2020-08-15 04:42:49 +0000 UTC
  • Martin Hope
    Pavel Mayorov 如何从事件或回调函数中返回值?或者至少等他们完成。 2020-08-11 16:49:28 +0000 UTC

热门标签

javascript python java php c# c++ html android jquery mysql

Explore

  • 主页
  • 问题
    • 热门问题
    • 最新问题
  • 标签
  • 帮助

Footer

RError.com

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

帮助

© 2023 RError.com All Rights Reserve   沪ICP备12040472号-5