Tag Archives: C/C++

How to Fix gdb error: Failed to import the site module,No module named ‘_sysconfigdata_m’

GDB has been used recently and has been reporting errors:
Failed to import the site module
Traceback (the most recent call last) :
the File “/ usr/lib/python3.5/site. Py”, line 580, in & lt; module>

the main () the File “/ usr/lib/python3.5/site. Py”, line 566, in the main
known_paths = addusersitepackages (known_paths)
the File “/ usr/lib/python3.5/site. Py”, line 287, In addusersitepackages
user_site = getusersitepackages ()
the File “/ usr/lib/python3.5/site. Py”, line 263, In getusersitepackages
user_base = getuserbase # () this will also set user_base
the File “/ usr/lib/python3.5/site. Py”, line 253, In getuserbase
USER_BASE = get_config_var (‘ userbase)
the File “/ usr/lib/python3.5/sysconfig py”, line 595, In get_config_var
return get_config_vars () get (name)
the File “/ usr/lib/python3.5/sysconfig py”, line 538, In get_config_vars
_init_posix (_CONFIG_VARS)
the File “/ usr/lib/python3.5/sysconfig py”, line 410, In _init_posix
from _sysconfigdata import build_time_vars
File “/usr/lib/python3.5/_sysconfigdata.py”, line 6, in < module>
from _sysconfigdata_m import *
ImportError: No module named ‘_sysconfigdata_m’
I only searched the beginning one, which said it had to do with Python. Later, a colleague searched for the last sentence error and found a solution:

# cd /usr/lib/python3.4

# ln  -s /usr/lib/python3.4/plat-i386-linux-gnu/_sysconfigdata_m.py .

 

Unreal4 C++ error guidelines

 

I believe that students are now starting to use C++ development method to complete some functions or try to understand the internal application process of UnrealEngine4, the process is naturally indispensable
Epic
Self packaged C++ dealing.

The
Of course, C++ with UnrealEngine4 must be complied with
UE4 engineering
Rules such as the entire project configuration are basically done using the [NMaker] configuration. You need to compile the [UnrealHeaderTool] tool before compiling the code
UnrealHeaderTool to compile our own projects. Of course, the entire build process was compiled as for UnrealEngine3 using the command line (to address both platform expansion and IDE decoupling). The various \UnrealEngine\Engine\Build\ files \ folders under the BatchFiles start calling each other during the entire compilation of Windows… (Well, usually we don’t care.)

since the UnrealEngine4 has its own rules, the more problems we run into in the process of updating the UnrealEngine4. The following is a collection of problems I encountered to share with you, I hope you can quickly solve the problem, less detours.

1. compile when the following 2 errors occur, please do not question whether the UnrealEngine4 engine compilation tool has a problem or the automatically generated project configuration has a problem, there is only one problem is their own code has a problem. As follows:

 
The
EXEC: error: Failed to generate code for XXXX (XXXX is the name of our project)
The
The and

 
The
EXEC: error: UnrealHeaderTool failed for target ‘PandaEditor’ (platform: Win64, module info: C: \ Users \ User \ Documents \ UnrealProjects/Panda/Intermediate/Build \ Win64 \ PandaEditor \ Development
\UnrealHeaderTool.manifest).

 
The
this error resolution: check the.h file for cross-references to header files. If you do need to refer to each other, try [+class] before your class name and then refer to header files in.cpP.

 
The
The

 
The
of course this error is
[UnrealHeaderTool],
[UnrealHeaderTool] error detection is not strong enough to accurately prompt for compilation errors, and many problems can cause this. If you find [EXEC: error: Failed to generate code for XX], please check the code carefully

A call to an OS function failed

Recently encountered a problem in the project development, draw a Scrollbox with BCB6, and then use the program to build 10 scrollBox as the parent class panel, Panel in the child thread access. But whenever you access panel-> When the handle parameter is handled, the thread either gets stuck or reports an error “A call to an OS function failed”. I searched for a long time, but I couldn’t find the reason. Because the project code is relatively complex, then I want to build an empty project directly, click to add components, access can be normal. The appearance of the problem is vague. Later in the process of debugging found that when the panel was created, the first call panel-> Handle, then the subsequent access in the child thread will not make an error. Although the problem seems to be solved, we still don’t know why it happened. I will take this as a note for future reference.
PS: In access parameter panel-> In debugging Handle, an error will sometimes occur: “Class already exists. Code: 1410.”

Reproduced in: https://www.cnblogs.com/kamiya/p/11162723.html

launch failed.Binary Not found in Linux / Ubuntu solution

launch failed.Binary not found the solution:

first of all when you’re confused about mingw solutions online, I’ll tell you to stop reading about mingw. Under Linux, mingw is not used, but

is directly completed by Linux GCC

1, look at your Eclipse Console output, if there is g++ not found, it means your system g++ did not install successfully.

Solution: Ctrl+Alt+t to terminal (console) mode, enter sudo apt-get install g++

2, not yet?

Project-> Properties-> C/C++Build-> Settings-> Binary Parsers

check GNU Elf Parser and Elf Parser

and then don’t forget about Project-> Build All (Ctrl+B), then run (Ctrl+ F11)

. If you see the item below come out called Binaries, Congradulations! Configured successfully, ready to run!

3, not yet?

check your file name is XXX. CPP ?And XXX must not contain “. “such symbols


under Windows is best used mingw…

http://hi.baidu.com/doctorjohnson/blog/item/2fafa2431187e11d9213c67e.html

On the coercion of C language

programming encountered such an error

error: aggregate value used where an integer was expected
printf(“t1 = %d\n”,(unsigned char)t1;
error: aggregate value used where an integer was expected
printf(“t1 = %d\n”,(unsigned char)t1;

the reason is that
C language Type casting can only be converted between quantitative types. The structural types (including union and struct) are not Scalar types, so the casting cannot be performed.

quantitative types include arithmetic types and pointer types, and arithmetic types include integer types and floating point types.

can use union instead of data conversion

I generally use union instead of type conversion

union {
long l;
struct {
long a:10;
loing b: 10;

long c: 12} bits;
}

VS2015 TRK0005 CL.exe

Failed to locate: “CL.exe”. The system cannot find the file specified.

error MSB6006: “cl.exe” has been quit, the code is 5.

uninstall and reinstall several times is still useless, all kinds of ways to find are not good..

find the method

TRACKER: error TRK0005: Failed to locate: “CL. Exe”. The system cannot find The file specified.

TRACKER: error TRK0005: Failed to locate: “CL. Exe”

properties-> vc++ directories-> The executable directories
C:\Program Files (x86)\Microsoft Visual Studio 12.0\ bin

results to the 2015 installation directory

X:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin

found no even CL.EXE… VC from another computer the whole directory copy over it; VS2015 installation program still has a problem

Solutions to the problem of “symbol lookup error xxxxx, undefined symbol”

symbollookup error gxio_mpipe_init, undefined symbol problem.

symbollookup error _mpipe_init, undefined symbol problem. A large part of the problem with this issue is due to the fact that the dynamic library version is too old for the application to find the corresponding symbol.

However, analyzing Makefile files and updating the dynamic libraries on which gxio depends on the tilera platform will not solve this problem. Finally, the problem was solved by combining NM with LDD. The analysis steps are as follows:

  1. use LDD to test the dynamic libraries on which the application sequence depends
  2. use nm + grep to analyze whether gxio related dynamic libraries contain gxio_mpipe_init symbol
  3. 0

  4. 1 2 3 detection found that gxio related dynamic libraries do not contain gxio_mpipe_init, $nm libgxio.so | grep gxio_mpipe_init. but gxio static library (libgxio. A) contains gxio_mpipe_init
  5. modify the application’s Makefile , connect gxio’s static library to the application, compile test problem solved.
  6. the wish to cause the above problem is that the gxio dynamic library on which the application depends does not have a specific symbol corresponding to gxio_mpipe_init, causing a run-time problem.

summary: the reason for this problem is that the version of the dynamic library is too old, so the application cannot find the corresponding symbol. The problem can be solved by updating the dynamic library to support the exact symbol. Nm and LDD tools can be used in the analysis.

pay attention to the public, “running code tsai, access to more premium content