Tag Archives: Compilation error

Execution failed for task ‘:app:stripDebugDebugSymbols‘.

Android compilation error

Execution failed for task ‘:app:stripDebugDebugSymbols’.

Specific:

solve:

The solution is also given above, that is, an appropriate NDK version is required. Then you can specify the NDK version in build.gradle
 

android {

    ......


    ndkVersion "22.1.7171670"
} 

 

Then compile again and there will be no problem.

ps:

The key to this problem is that it can run normally a few days ago, but it can’t run now!

In retrospect, I upgraded NDK two days ago. It should be caused by this reason.

Error 3 error C2065: ‘endl‘ : undeclared identifier-Error 2 error C2065: ‘cout‘ : undeclared identif

As you can see, I just want to print something, and iostream is added, but that means I cout can’t use it.

hold   If StdAfx. H is placed at the front of the whole file, no error will be reported

In fact, if other header files are mentioned to the front, an error will be reported – this may be the provision of VS2010,   StdAfx. H must be first.

 

Even if you comment it out   All include in StdAfx. H are commented out. Whether the compilation passes or not.

 

 

[Solved] Communications–8–Generated resource conflict: two resources of the same name: /Radioxx

  1. Ecplise: Right-click project -> Properties -> C\C++ Build -> Tool Chain Editor.
    Current Builder: choose  ‘Gnu make builder’ -> Apply (or Ok).

    The reason for the problem: the builder that does not support GCC and G++ compilers is selected. ‘CDT internal builder’

Error:java: Compilation failed: internal java compiler error

Compilation error

Error:java: Compilation failed: internal java compiler error

Solution (two cases):

    setting–> Build,Execution,Deployment–> The build process heap size (Mbytes): 700 is changed to 2000, or 5000 (it is possible that the company’s project needs a lot, so try to make it larger). The JDK version does not correspond. It needs to be in file — & gt; Project structure–> Project check whether the JDK version corresponds to

[Solved] Compilation error: dereferencing pointer to incomplete type…

Today my colleague asked me a question. He reported an error when he made “Line 201 : dereferencing pointer to incomplete type”. I immediately checked a lot of information, but I didn’t see why. Finally, the problem was solved, and the principle was understood, so I recorded it.

His question is specifically like this.

1
2
3
4
5
6
#include <netinet/ip_icmp.h>
...
struct icmp* aaa;
    aaa = (struct icmp*)malloc(sizeof(struct icmp)); 行;
    aaa->icmp_type=1;
...

 

Error on line 201 during make: dereferencing pointer to incomplete type.

First of all, let me talk about the meaning of this error. In layman’s terms, I tried to access the variable pointed to by the pointer, but found that the variable was an incomplete type, and more errors occurred in accessing the members of the structure union. It can be seen from the code that the variable pointed to by icmp_type is actually accessed from line 201, and line 200 has not been accessed yet.

So I guessed, is struct icmp not defined? Then I checked the /usr/include/netinet/ip_icmp.h file and found that there is a definition of struct icmp. It’s weird, isn’t it? After writing some demo tests, the final conclusion is that there is really no definition of struct icmp!

It’s even stranger to see this. Why is this conclusion? Looking closely at the /usr/include/netinet/ip_icmp.h file, you will find that the definition of struct icmp is contained in a macro j, as shown below:

1
2
3
4
5
6
7
8
9
...
#ifdef __USE_BSD
...
struct icmp {
...
}
...
#endif /*END OF ifdef __USE_BSD*/
...

 

When you see this, you should understand. When compiling, if -D__USE_BSD is not added to the compile command gcc …, then the definition of struct icmp will not be included, so the previous line 201 error is reported: Dereferencing pointer to incomplete type, and that’s how it led me to start wondering why it is clearly defined, but it is said to be an incomplete type. So in order to verify this conclusion, I wrote a small demo to test, and found that the compiler will pass if -D__USE_BSD is added, otherwise it will fail to compile.

In the process of solving this problem, I wrote a lot of demos, let’s summarize below.

1. If the error “dereferencing pointer to incomplete type ” is reported , first try to find out whether the definition of the structure variable in the line can be found, you can use the grep “struct xxx” /usr/include -R command to recursively search the /usr/include directory If found, you can #include in the .c file. If it is a non-standard header file, add the -I header file directory to the compile command, for example (-I/usr/local/xxx/include).

2. If the error “dereferencing pointer to incomplete type ” is still reported after #include , try to check the file carefully to see if the definition of the structure is wrapped by a compiled macro. If it is indeed in the package of a compiled macro, Add -D compilation macro in the compilation command (such as -D__USE_BSD)

After the above two steps, the error of “dereferencing pointer to incomplete type ” can basically be solved