Here to keep track of the bugs I ran into and how to fix them.
"relocation truncated to fit: R_X86_64_32S against '.bss'"
This happen when the program needs more than 2GB of data.
Compile with -mcmodel=medium/large.
see http://amiatypist.blogspot.de/2010/05/relocation-truncated-to-fit-rx866432s.html
"Warning: ignoring incorrect section type for .lbss"
This follows last error, I did not find how to solve this. According to a post, this is because that the physical memory in computer is not enough.
see https://answers.launchpad.net/mg5amcnlo/+question/219687
"error: ‘exit’ was not declared in this scope "
This maybe a stupid error, but since it may happen for a new C++ user like me.
Including <iostream> and adding 'using namespace std' are not enough, need to add '#include <cstdlib>' to fix this.
" no matching function for call to 'sort(std::vector<Solution::Interval>::iterator, std::vector<Solution::Interval>::iterator, <unresolved overloaded function type>)"
Get this when I was trying to use std::sort. I defined my own comp() function, the problem is that it is defined as a member function within a class, so there is a 'this' parameter. Add 'static' or define the function outside the body of the class.
declaration of ‘std::stack<char> s’ shadows a parameter
stupid error caused by using the same name for different variables.
java STL like List and Map are abstract classes, and when using HashMap, it is better to use containsKey() to check if a key value exists.
java StringBuffer can be initialized with String and int, but not char. The char value will be converted to int, so the compiler does not say anything, but in reality the char is converted to integer.
org.apache.catalina.core.ContainerBase : A child container failed during start
Spring or Tomcat just breaks all of a sudden. The problem I think is answered in
http://stackoverflow.com/questions/28102134/a-child-container-failed-during-start-java-util-concurrent-executionexception
, where an answer points out that we shouldn't inculde `servlet-api.jar` in WEB-INF/lib.
Although I did use providedCompile for servlet-api, it somehow finds its way to the /lib.
"relocation truncated to fit: R_X86_64_32S against '.bss'"
This happen when the program needs more than 2GB of data.
Compile with -mcmodel=medium/large.
see http://amiatypist.blogspot.de/2010/05/relocation-truncated-to-fit-rx866432s.html
"Warning: ignoring incorrect section type for .lbss"
This follows last error, I did not find how to solve this. According to a post, this is because that the physical memory in computer is not enough.
see https://answers.launchpad.net/mg5amcnlo/+question/219687
"error: ‘exit’ was not declared in this scope "
This maybe a stupid error, but since it may happen for a new C++ user like me.
Including <iostream> and adding 'using namespace std' are not enough, need to add '#include <cstdlib>' to fix this.
" no matching function for call to 'sort(std::vector<Solution::Interval>::iterator, std::vector<Solution::Interval>::iterator, <unresolved overloaded function type>)"
Get this when I was trying to use std::sort. I defined my own comp() function, the problem is that it is defined as a member function within a class, so there is a 'this' parameter. Add 'static' or define the function outside the body of the class.
declaration of ‘std::stack<char> s’ shadows a parameter
stupid error caused by using the same name for different variables.
java STL like List and Map are abstract classes, and when using HashMap, it is better to use containsKey() to check if a key value exists.
java StringBuffer can be initialized with String and int, but not char. The char value will be converted to int, so the compiler does not say anything, but in reality the char is converted to integer.
org.apache.catalina.core.ContainerBase : A child container failed during start
Spring or Tomcat just breaks all of a sudden. The problem I think is answered in
http://stackoverflow.com/questions/28102134/a-child-container-failed-during-start-java-util-concurrent-executionexception
, where an answer points out that we shouldn't inculde `servlet-api.jar` in WEB-INF/lib.
Although I did use providedCompile for servlet-api, it somehow finds its way to the /lib.
没有评论:
发表评论