cmake isn't finding -lgnutls, however, it says it sees [$50] #362

Open
niterain opened this Issue Oct 3, 2016 · 3 comments

Projects

None yet

2 participants

@niterain
niterain commented Oct 3, 2016 edited

This is what I see when using cmake-gui:

CMAKE_BUILD_TYPE = Release
VERSION = 1.6.0
BUILD_TIMESTAMP = 2016-10-03 01:10
32-bit build
Resource compiler: C:/mingw/bin/windres.exe
Found GnuTLS: C:/mingw/lib/libgnutls.dll.a
Attempting to link static binaries...
Configuring done
Generating done

It looks like it has found gnutls, however when running make I end up with this response:

[ 69%] Linking CXX executable vncconfig.exe
cd /d C:\tigervnc-1.6.0\build\win\vncconfig && "C:\Program Files\CMake\bin\cmake.exe" -E cmake_link_script CMakeFiles\vncconfig.dir\link.txt --verbose=1
"C:\Program Files\CMake\bin\cmake.exe" -E remove -f CMakeFiles\vncconfig.dir/objects.a
C:\mingw\bin\ar.exe cr CMakeFiles\vncconfig.dir/objects.a @CMakeFiles\vncconfig.dir\objects1.rsp
C:\mingw\bin\g++.exe -IC:/mingw/include -LC:/mingw/lib -LC:/mingw/lib/libgnutls.dll.a -Wall -Wformat=2 -O3 -DNDEBUG -UNDEBUG -nodefaultlibs -mwindows -Wl,--whole-archive CMakeFiles\vncconfig.dir/objects.a -Wl,--no-whole-archive -o vncconfig.exe -Wl,--out-implib,libvncconfig.dll.a -Wl,--major-image-version,0,--minor-image-version,0 @CMakeFiles\vncconfig.dir\linklibs.rsp -Wl,-Bstatic -lstdc++ -Wl,-Bdynamic -lmingw32 -lgcc_eh -lgcc -lmoldname -lmingwex -lmsvcrt -luser32 -lkernel32 -ladvapi32 -lshell32 -lmingw32 -lgcc_eh -lgcc -lmoldname -lmingwex -lmsvcrt
C:/mingw/bin/../lib/gcc/i686-w64-mingw32/6.1.0/../../../../i686-w64-mingw32/bin/ld.exe: cannot find -lgnutls
collect2.exe: error: ld returned 1 exit status
make[3]: *** [win\vncconfig\CMakeFiles\vncconfig.dir\build.make:178: win/vncconfig/vncconfig.exe] Error 1
make[3]: Leaving directory 'c:/tigervnc-1.6.0/build'
make[2]: *** [CMakeFiles\Makefile2:549: win/vncconfig/CMakeFiles/vncconfig.dir/all] Error 2
make[2]: Leaving directory 'c:/tigervnc-1.6.0/build'
make[1]: *** [Makefile:130: all] Error 2
make[1]: Leaving directory 'c:/tigervnc-1.6.0/build'

I am using mingw64 on windows, and msys2

--- There is a **[$50 open bounty](https://www.bountysource.com/issues/38060193-cmake-isn-t-finding-lgnutls-however-it-says-it-sees?utm_campaign=plugin&utm_content=tracker%2F3557444&utm_medium=issues&utm_source=github)** on this issue. Add to the bounty at [Bountysource](https://www.bountysource.com/?utm_campaign=plugin&utm_content=tracker%2F3557444&utm_medium=issues&utm_source=github).
@CendioOssman
Member

Attempting to link static binaries...

You have turned on the setting to do a semi-static build rather than a normal dynamic one. Do you have a static version of gnutls in your lib directory?

@niterain
niterain commented Oct 4, 2016

That was my problem. I compiled the static library, and removed the static requirement. And it compiled. Is there anyway to compile down to two static executables so there is only two files (vncviewer.exe, and winvnc4.exe)?

@CendioOssman CendioOssman changed the title from cmake isn't finding -lgnutls, however, it says it sees to cmake isn't finding -lgnutls, however, it says it sees [$50] Oct 4, 2016
@CendioOssman CendioOssman added the bounty label Oct 4, 2016
@CendioOssman
Member

Yes, that's what the static build option is for. But it only works if you have static versions of all dependencies.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment