HP-UX HB v13.00 Ch-11 - Software Development

HP-UX Handbook Rev 13.00 Page 67 (of 101)
Chapter 11 Software Development
October 29, 2013
Build Problems
Normally every build process should succeed without any message from the compiler or the
linker. Messages should never be ignored, even if the build process succeeds, because they could
lead to runtime problems.
Solving most of the build problems means to understand compiler and linker messages and to
take appropriate actions like code changes, different compiler or linker options etc. to remove the
reasons for the messages. As a basic rule, the first step to resolve such an issue is to look up man
pages, programmer’s guides and release notes. There is a good chance that one of these sources
contains an explanation for the situation encountered.
While this sounds quite easy, it can in fact become very complicated, because the pure mass of
information we get from there can make it difficult to find what we're looking for.
Compiler and linker distinguish between warnings and errors. Warnings are issued to tell the
developer about potential problems, but the build process will not be aborted. When an error
occurs, the build process will not complete, but it will also not stop after the first error. Instead it
will continue as far as possible to report subsequent errors, if any.
When fixing coding errors reported by the compiler, always start with the first message because
the others might be follow-ups from the first; e.g. a missing ending bracket, parentheses and/or
quote character in a C program can cause tons of error messages, and those errors may all
disappear when the missing character is added. Or, a missing header file can cause lot of errors
about undefined symbols. If you're not familiar with error messages, always fix only the first one
and recompile to see which errors remain.
This section will discuss some commonly seen errors and warnings, explain their meaning and
what corrections are required.
make(1) Errors
Make: Must be a separator on rules line 2. Stop.
This error is caused by a syntax error in the makefile. All commands in a rule must be preceded
by a tab character. Multiple spaces might look the same, but make(1) does not accept them.
Check the given line and replace leading blanks by one or more tabs. A common root cause for
this syntax error is using copy&paste on makefiles. The copying might expand tabs to spaces.
Make: Don't know how to make xxx. Stop.