dhewm3 icon indicating copy to clipboard operation
dhewm3 copied to clipboard

Error: ld returned 1 exit Status. Undefined reference to `curl_easy_perform'

Open Eonfge opened this issue 4 months ago • 3 comments

Describe the bug

Latest version of GCC fails to build Dhewm 3

/run/build/dhewm3/framework/FileSystem.cpp:3528:(.text+0x898): undefined reference to `curl_easy_perform'
collect2: error: ld returned 1 exit status
[363/365] Building CXX object CMakeFiles/d3xp.dir/d3xp/physics/Physics_StaticMulti.cpp.o

Your System Flatpak using FreeDesktop runtime 25.08.

To Reproduce

Build log of the pipeline:

https://github.com/flathub-infra/vorarbeiter/actions/runs/17383033281/job/49344575690

Eonfge avatar Sep 01 '25 19:09 Eonfge

It should be linking against libcurl (-lcurl) but doesn't. Specifically this long-ass line: https://github.com/flathub-infra/vorarbeiter/actions/runs/17383033281/job/49344575690#step:14:894 should contain -lcurl or something like /usr/lib/aarch64-linux-gnu/libcurl.so

According to https://github.com/flathub-infra/vorarbeiter/actions/runs/17383033281/job/49344575690#step:14:355 "libcurl found and enabled", and according to this unrelated warning: https://github.com/flathub-infra/vorarbeiter/actions/runs/17383033281/job/49344575690#step:14:514 the curl headers have been found

Not sure why that fails, you'll have to debug it in your buildsystem. https://github.com/dhewm/dhewm3/blob/86152bb83728c82bd4f44d5382d8027b1578e1ed/neo/CMakeLists.txt#L248-L253 and https://github.com/dhewm/dhewm3/blob/86152bb83728c82bd4f44d5382d8027b1578e1ed/neo/CMakeLists.txt#L1284-L1290 are relevant.. I'd log the value of the CURL_LIBRARY variable (in CMake) - it should be -lcurl or something like /usr/lib/aarch64-linux-gnu/libcurl.so.

Maybe find_package(CURL QUIET) doesn't set CURL_LIBRARY in your CMake version, for whatever reason (sometimes CMake randomly breaks shit like that), IDK

DanielGibson avatar Sep 02 '25 00:09 DanielGibson

Flatpak has updated its CMAKE to v4.1.1 so that might give some issues.

I'll have to try this locally, so I can add some debug statements. Care to help?

Eonfge avatar Sep 03 '25 06:09 Eonfge

I can try to help if you can reproduce the problem locally.. however I just successfully built dhewm3 with curl support on an Arch Linux system which also uses CMake 4.1.1

one debug output change you could do is replacing message(STATUS "libcurl found and enabled") with message(STATUS "libcurl found and enabled - CURL_LIBRARY = ${CURL_LIBRARY}")

On my system running CMake then prints libcurl found and enabled - CURL_LIBRARY = /usr/lib/libcurl.so

DanielGibson avatar Sep 06 '25 15:09 DanielGibson