Bug #1035

When compiling error in libs\curl\libcurl.lib

Added by Odal over 2 years ago. Updated 2 months ago.

Status:New% Done:

0%

Priority:NormalSpent time:-
Assignee:-
Category:General
Target version:ALL
OS:Windows Arch:

Description

I installed from scratch VisualStudio 2017 (with options turned on for PC gaming/Unity/C++/etc), OS: WINDOWS10.

After getting the sources I created the etlegacy\build directory, then cd build and
cmake -G "NMake Makefiles" -DBUNDLED_LIBS=YES .. && nmake

After a while it stops with:

...
Scanning dependencies of target renderer_opengl2_x86
[ 41%] Building C object CMakeFiles/renderer_opengl2_x86.dir/glsl/tr_glslsources.c.obj
tr_glslsources.c
[ 42%] Linking C shared module renderer_opengl2_x86.dll
[ 50%] Built target renderer_opengl2_x86
[ 50%] Built target bundled_sdl
NMAKE : fatal error U1073: impossibile creare 'libs\curl\libcurl.lib'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX86\x86\nmake.exe"' : codice restituito '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Tools\MSVC\14.10.25017\bin\HostX86\x86\nmake.exe"' : codice restituito '0x2'
Stop.

D:\etlegacy\build>

It seems that there is a misuderstanding where the file libcurl.lib should be.
  • etlegacy\build\libs\curl\lib\libcurl.lib
  • etlegacy\build\libs\curl\libcurl.lib (this does not exist)

Infact I have a (stupid)
WORKAROUND:
to copy the first file to the second folder.

Then the compilation works

History

#1 Updated by IR4T4 over 2 years ago

  • Category set to General
  • Target version set to 2.76

#2 Updated by IR4T4 over 2 years ago

I’v had a similar error after checking out the latest changes from our lib submodule:

configure: error: cannot find install-sh, install.sh, or shtool in "." "./.." "./../.." 
CMakeFiles/bundled_curl.dir/build.make:51: recipe for target '../libs/curl/lib/.libs/libcurl.a' failed
make[2]: [../libs/curl/lib/.libs/libcurl.a] Error 1
CMakeFiles/Makefile2:60: recipe for target 'CMakeFiles/bundled_curl.dir/all' failed

After cleaning the working directories, deleting the libs folder with new checkout the issue was gone.
Did you use an old repository path which was used before for your new VS17 install?

#3 Updated by Odal over 2 years ago

Before to post the bug, I get a completly new repository. I repeated this 2 times to be sure.

But if microsoft decided to put "new features" in VS17, more opened to other worlds (Linux, and its native languages and libraries(?)) there can be strange side effects.

#4 Updated by IR4T4 over 1 year ago

  • Target version changed from 2.76 to ALL

#5 Updated by Saukko 2 months ago

This issue is still relevant in VS19. A possible fix or workaround (or whatever) is here:
https://github.com/etlegacy/etlegacy-libs/pull/10/commits/7a9e71aa1f6462856ebf3b4a6ab5510acd0768ef

I have used the piece of text (from the link) to fix the issue locally.

-*S

#6 Updated by Spyhawk 2 months ago

Yup, and I’m still waiting for you to confirm this works in both release and debug build - See the very same PR you linked to.
To expand on this, NMAKE tends to use a different`CMAKE_STATIC_LIBRARY_SUFFIX` in debug mode, which means your change might break here (not sure if that applies to curl though).

Also available in: Atom PDF