Answer the question
In order to leave comments, you need to log in
How to determine Ubuntu version in code?
There is code for libv8-dev that works on ubuntu 18. But on 19.10 it no longer works because the version of the libv8-dev library is different on it. Therefore, I had to rewrite the code for a new one. But since you need to do something that would work on both versions, I think that it's easy to write in one file for both versions. And separate the code with the #ifdef switch. I just can’t find anywhere by what define to do code switching depending on the version of Ubuntu.
Answer the question
In order to leave comments, you need to log in
The standard solution is to use autoconf
It is able to determine the libraries in the system and assign the necessary defines
https://www.gnu.org/software/autoconf/manual/
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question