Doxygen - Could NOT find FLEX (missing: FLEX_EXECUTABLE)
Asked Answered
S

1

34

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>
Surpass answered 22/6, 2018 at 10:34 Comment(9)
Message "The program 'flex' can be found in the following packages:" means that flex is not installed. Probably, apt autoremove removes it.Evoy
Thanks, I so I will try the install steps again, leaving out that last part...Surpass
@Evoy 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.Surpass
Hm, the problem seems to be with using apt for install the package, which is not a programming problem...Evoy
@Evoy maybe this question should be moved to the 'AskUbuntu' Forum, what do you think?Surpass
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.Evoy
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 meta.#254369Surpass
I'm voting to close this question as off-topic because it should be in AskUbuntu I believeSurpass
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 autoremoveMylohyoid
S
67

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

Surpass answered 22/6, 2018 at 11:10 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.