Line_descriptor not included in build package

An old code snippet from version 3.4 shows use of a createLSDDetector object.
Is there any new code to detect line segments from an image?

this is the link i am seeing:

that will be found in the contrib repository. official builds do not include contrib modules. you will have to build OpenCV yourself, or find an existing build with contrib modules.

documentation for that detector is available, so I’m sure the source code for it is also still in OpenCV (contrib).

OpenCV comes with a Hough transform for lines and line segments (HoughLinesP). that is in the main repository, so it’s always available.

you can use Fast line detector in contrib module. see the sample code