Tag Archives: Compile Error

[Solved] Compile Error: undefined reference to `google::FlagRegisterer::FlagRegisterer

1. Problem description

Compilation error

CMakeFiles/run_mapping_offline.dir/run_mapping_offline.cc.o: In function `__static_initialization_and_destruction_0':
/home/wong/workspace_demo/packagetest_faster_lio_ws/src/***/***/app/run_mapping_offline.cc:16: undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
/home/wong/workspace_demo/packagetest_faster_lio_ws/src/***/***/app/run_mapping_offline.cc:17: undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
/home/wong/workspace_demo/***/src/***/***/app/run_mapping_offline.cc:18: undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
/home/wong/workspace_demo/***/src/***/***/app/run_mapping_offline.cc:19: undefined reference to `google::FlagRegisterer::FlagRegisterer<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >(char const*, char const*, char const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*)'
collect2: error: ld returned 1 exit status
***/***/app/CMakeFiles/run_mapping_offline.dir/build.make:678: recipe for target '/home/wong/workspace_demo/***/devel/lib/faster_lio/run_mapping_offline' failed

2. Solution

Add the following line in CMakeLists.txt:

find_package(gflags REQUIRED)

This is our own solution. If you have any other better solutions, please leave a comment and let me know.

Overleaf PDF Rendering Error Something went wrong while rendering this PDF [How to Solve]

1. Problems

I just came into contact with overleaf . I thought it was very simple, but when I downloaded a template for compilation, I found that I always reported an error:
PDF rendering error something went wrong while rendering this PDF

2. Solutions

Google didn’t find the answer after a while. Later, it thought to itself, why every time there is a PDF download page for IDM , and whether the problem is caused by the IDM plug-in. Sure enough, turned off the IDM plug-in and the problem was solved.

After vs2019 is installed, the original vs2017 project cannot compile various error reports

The MFC project does not report an error when compiling VS2017, but it will report the following error when opening the project after upgrading VS2019.
The platform toolset used by the project under VS2017 is Visual Studio 2017-Windows XP(x141_XP) (although marked deprecated, it is still installable)
The problem was resolved after installing the platform toolset used by the original project. Many components of VS2019 need to be checked before installation.
1. Misdescription:

2. Solutions:
1). Platform toolset installation
Tools (T) → Get Tools and Features (T), open Visual Studio Installer, select Modify → Single Component, and check the component you want to install.

1). Right-click Solution → Properties → General → Modify the Platform toolset and select the toolset used by the original project.

 

What is cs0120 error

The original address: https://support.unity3d.com/hc/en-us/articles/206496883-What-is-CS0120-
symptoms
I got the following error on the Console:

Error CS0120: An object reference is required to access non-static member ‘__’

why
There are two situations that can cause this error, listed below:
This error occurs when ol> attempts to directly reference a non-static variable in a static method.


The error message given in this example is:

Error CS0120: An object reference is required to access non-static member ‘myscript.name’

This error occurs when ol> calls another non-static method in a static method.


The error message given in this example is:

Error CS0120: An object reference is required to access non-static member ‘myscript.methodb ()’

The solution

    CS0120 can be resolved by creating an instance that references this non-static variable:

    CS0120 can be resolved by creating an instance that references this non-static method:


For more information
https://msdn.microsoft.com/en-us/library/s35hcfh7.aspx

Eclipse Syntax error, annotations are only available if source level is 1.5 or greater

I. Problem descriptionSyntax error, annotations are only available if source level is 1.5 or greater, indicating that the annotations are only available in jdk1.5 or higher, as shown in the figure below:

My JDK is configured to be 1.8, which is not supposed to be the case. I checked the configuration of my project and found the problem

Second, the cause of the problem

The compiler followed a low compilation level, used the default configuration file at project creation time, and did not update as configured with the JDK version

Here is the configuration information for the configuration file:

3. Solutions

1. Click the project shortcut Alt + Enter or right-click the project and select Properties at the bottom to enter the project configuration page

2. Modify the compilation level of the compiler

3. Change the configuration

4. The configuration file was modified successfully

Ok, problem solved

 

 

How to Fix char cannot be dereferenced Error

error: char cannot be dereferenced
Error code

	if(row.charAt(m).equals('0')){
		matrix[i][j]=0;
	}

Where the row is a string.
2. Error reason
Ross: Yeah, I mean, derefrence. The value that points to

The type char is a primitive — not an object — so it cannot be dereferenced
derefer0 derefer0 is The process of authentication The value green to by a reference. Since a char is already a value (not a) reference), it can not be dereferenced.
use Character class:
if(Character.isLetter())

char
char
char is a primitive type.
Character is its wrapper class, reference type, and equals() method. == instead of directly comparing values.

Xcode compilation error: failed to initiate service connection to simulator

Failed to initiate service connection to simulator Error returned in reply: connection invalid

opened xcode and ran successfully. Then click on the simulator and there was no response. Reruns this prompt box and clear the cache.
solution: you need to close all the different versions of xcode and the emulator, and just reopen and run.
because multiple versions of xcode are open running

Error: unable to resolve dependency for… Could not resolve project

changed some things of the project two days ago. After submitting, I found that the compiler always reported errors, but the packaging was ok. Error message is as follows:

ERROR: Unable to resolve the dependency for ‘: XXX @ debugProduction/compileClasspath’ : Could not resolve project: yyy.
Show Details
Affected Modules: XXX

where ‘XXX’ and ‘yyy’ are the two modules in my project. I looked for many ways on the Internet, but I couldn’t solve them.
later went back to the last change and found that I had changed build.gradle for module x, but not for module y, and the configuration of buildTypes for the two modules was inconsistent.

so the obvious solution is to copy the configuration of buildTypes in build.gradle of module x into build.gradle of module y.

does not have to be copied exactly, only has to be configured in the same format as the two modules . My error was caused by the buildTypes in Module X, which added the configuration of the releaseTest mode, but not in Module Y.