Skip to content

Commit

Permalink
Added a troubleshooting section to the documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
JusticeRage committed Mar 27, 2016
1 parent a3546f6 commit cc24390
Show file tree
Hide file tree
Showing 4 changed files with 36 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ There are few things I hate more than checking out an open-source project and sp

### On Linux and BSD (tested on Debian Jessie and FreeBSD 10.2)
```
$> [sudo or as root] apt-get install libboost-regex-dev libboost-program-options-dev libboost-system-dev libboost-filesystem-dev build-essential cmake
$> [sudo or as root] apt-get install libboost-regex-dev libboost-program-options-dev libboost-system-dev libboost-filesystem-dev build-essential cmake git
$> [alternatively, also sudo or as root] pkg install boost-libs-1.55.0_8 cmake
$> git clone https://github.com/JusticeRage/Manalyze.git && cd Manalyze
$> cmake .
Expand Down
28 changes: 27 additions & 1 deletion docs/obtaining-manalyze.rst
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Next, get Manalyze's source code and try building it::
make
cd bin && ./manalyze --version

If everything went well, the tool's version should be displayed. Otherwise, look for error messages during the build process and get in touch with the maintainer to request help!
If everything went well, the tool's version should be displayed. Otherwise, jump to the `Troubleshooting`_ section below or look for error messages during the build process and get in touch with the maintainer to request help!

.. TIP:: You can enable debug builds with the following command: ``cmake . -DDebug=ON``

Expand Down Expand Up @@ -91,3 +91,29 @@ Now take the whole ``Manalyze`` folder to the computer on which you intend to bu
cmake . -DGitHub=OFF
...and continue as you normally would.

Troubleshooting
===============

This section lists some common compilation errors you may face when building Manalyze, along with their solution.

1. Boost is obsolete
--------------------

This compilation error is usually encountered on Debian 7 (Wheezy)::

In file included from ~/Manalyze/manacommons/escape.cpp:18:0:
~/Manalyze/include/manacommons/escape.h:115:97: error: macro "BOOST_STATIC_ASSERT" passed 3 arguments, but takes just 1
~/Manalyze/include/manacommons/escape.h:148:66: error: macro "BOOST_STATIC_ASSERT" passed 2 arguments, but takes just 1
~/Manalyze/include/manacommons/escape.h: In function ‘io::pString io::_do_escape(const string&)’:
~/Manalyze/include/manacommons/escape.h:115:2: error: ‘BOOST_STATIC_ASSERT’ was not declared in this scope
~/Manalyze/include/manacommons/escape.h: In function ‘io::pString io::escape(const string&)’:
~/Manalyze/include/manacommons/escape.h:148:2: error: ‘BOOST_STATIC_ASSERT’ was not declared in this scope
~/Manalyze/include/manacommons/escape.h: In instantiation of ‘io::pString io::_do_escape(const string&) [with Grammar = io::escaped_string_raw<std::back_insert_iterator<std::basic_string<char> > >; io::pString = boost::shared_ptr<std::basic_string<char> >; std::string = std::basic_string<char>]’:
~/Manalyze/manacommons/escape.cpp:24:53: required from here
~/Manalyze/include/manacommons/escape.h:125:10: error: could not convert ‘nullptr’ from ‘std::nullptr_t’ to ‘io::pString {aka boost::shared_ptr<std::basic_string<char> >}’
make[2]: *** [CMakeFiles/manacommons.dir/manacommons/escape.cpp.o] Error 1
make[1]: *** [CMakeFiles/manacommons.dir/all] Error 2
make: *** [all] Error 2

This issue has been traced to the `Boost libraries <http://www.boost.org/>`_ in Wheezy repositories being too old (1.49.0). You'll need to either upgrade them manually or switch to Debian Jessie.
6 changes: 3 additions & 3 deletions docs/reusing-manape.rst
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ Let's start by writing some sample code that would read a PE file using Manalyze
{
mana::PE pe("file.exe");
if (pe.is_valid()) { // Always check this.
std::cout << "File parsed successfully: " << *pe.get_path() << std::endl;
std::cout << "File parsed successfully: " << *pe.get_path() << std::endl;
}
else
{
std::cout << "The file is invalid!" << std::endl;
std::cout << "The file is invalid!" << std::endl;
return 1;
}

Expand Down Expand Up @@ -46,4 +46,4 @@ You don't have to follow the same folder structure, it's only given as an exampl
.data
.rsrc

Obviously, you'll want to write a Makefile or use CMake, but this should be enough to get you started. If you need detailed information on available methods that you can use from here, please see this section on by :ref:`pe_objects`.
Obviously, you'll want to write a Makefile or use CMake, but this should be enough to get you started. If you need detailed information on available methods that you can use from here, please see this section on :ref:`pe_objects`.
10 changes: 5 additions & 5 deletions include/manacommons/escape.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ class OutputFormatter;

/**
* @brief Performs the actual string escaping based on the grammar given as
* template parameter.
*
* @param const std::string& s The string to escape.
*
* @return A pointer to the escaped string, or a null pointer if an error occurred.
* template parameter.
*
* @param const std::string& s The string to escape.
*
* @return A pointer to the escaped string, or a null pointer if an error occurred.
*/
template<typename Grammar>
pString _do_escape(const std::string& s)
Expand Down

0 comments on commit cc24390

Please sign in to comment.