32

I know there are very similar worded questions on here, but I could not find an answer to my question there, so here we go:
I'm trying to see which of my C++ methods are called by others so I found Doxygen after googling.
On their page the installation seems pretty straightforward:

If you have the necessary build tools installed (i.e. g++, python, cmake, flex, bison), you should do the following to get the initial copy of the repository:

git clone https://github.com/doxygen/doxygen.git
cd doxygen
mkdir build
cd build
cmake -G "Unix Makefiles" ..
make

Until cmake -G "Unix Makefiles" .. everything goes well, then on that command following error occurs:

test@test-VirtualBox:~/doxygen/build$ cmake -G "Unix Makefiles" ..
CMake Error at /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:148 (message):
  Could NOT find FLEX (missing: FLEX_EXECUTABLE)
Call Stack (most recent call first):
  /usr/share/cmake-3.5/Modules/FindPackageHandleStandardArgs.cmake:388 (_FPHSA_FAILURE_MESSAGE)
  /usr/share/cmake-3.5/Modules/FindFLEX.cmake:230 (FIND_PACKAGE_HANDLE_STANDARD_ARGS)
  CMakeLists.txt:84 (find_package)

I thought: No big deal, why should anything work out of the box...seems I have to install flex.
So I do:
sudo apt-get update
sudo apt-get install flex
sudo apt autoremove (because after installation the command line recommended me to do this)

Now it seems to me that flex has been installed, I try cmake -G "Unix Makefiles" .. again...same error. I close the command line, start it up again, try it again - same error...
So now I'm slowly gettin' pissed and turn to Stack Overflow for help :D
What am I doing wrong???

And because I saw someone asking this in the other question's comment, here's the output of flex:

test@test-VirtualBox:~/doxygen/build$ flex
The program 'flex' can be found in the following packages:
 * flex
 * flex-old
Try: sudo apt install <selected package>
albert
  • 8,285
  • 3
  • 19
  • 32
Cold_Class
  • 3,214
  • 4
  • 39
  • 82
  • 1
    Message "The program 'flex' can be found in the following packages:" means that flex is **not installed**. Probably, `apt autoremove` removes it. – Tsyvarev Jun 22 '18 at 10:36
  • Thanks, I so I will try the install steps again, leaving out that last part... – Cold_Class Jun 22 '18 at 10:39
  • @Tsyvarev this indeed fixed my problem - you can post it as an answer if you like - the thing is still not working completetly but I will google it first and I'll have to post another question for that anyway, because it's a different problem now. – Cold_Class Jun 22 '18 at 10:45
  • Hm, the problem seems to be with using `apt` for install the package, which is not a *programming* problem... – Tsyvarev Jun 22 '18 at 11:23
  • 1
    @Tsyvarev maybe this question should be moved to the 'AskUbuntu' Forum, what do you think? – Cold_Class Jun 22 '18 at 12:02
  • Yes, you may move it to AskUbuntu. But before that, make the question to be about `apt` and its using. E.g. "Why 'apt autoremove' removes explicitely installed package". Make sure to check that no questions about that problem has already asked. – Tsyvarev Jun 22 '18 at 12:12
  • I'm gonna delete this question then, migration is not that easy as it seems and only worth it for really good questions a shown here https://meta.stackoverflow.com/questions/253869/can-we-have-more-options-in-the-closing-off-topic-migration – Cold_Class Jun 22 '18 at 12:23
  • I'm voting to close this question as off-topic because it should be in AskUbuntu I believe – Cold_Class Jun 22 '18 at 12:31
  • I would not close it as it gives the warning for other users that use the same procedure and will see that thère might be a problem with `sudo apt autoremove – albert Jun 22 '18 at 12:43

1 Answers1

65

It seems like apt autoremove really removed the package I just installed in the previous step.
So what worked for me was:

git clone https://github.com/doxygen/doxygen.git
cd doxygen
mkdir build
cd build

These are new:


sudo apt-get install flex
sudo apt-get install bison

cmake -G "Unix Makefiles" ..
make

...but of course the horror wouldn't end there, see my next question :D

Cold_Class
  • 3,214
  • 4
  • 39
  • 82