OpenSSL NMAKE Unresolved External Symbol - windows

I'm trying to compile a very light version of OpenSSL with many of the features disabled.
Using the post Build openssl with just RSA and AES I have run the build step successfully, but I have a problem when running nmake.
The first time it ran for a few minutes before failing. Now when I run nmake, it fails in the same way without all the previous text. Output shown below.
D:\xxxxxxxx\openssl-master>nmake
Microsoft (R) Program Maintenance Utility Version 14.23.28106.4
Copyright (C) Microsoft Corporation. All rights reserved.
"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\HostX64\x64\nmake.exe" / depend && "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\HostX64\x64\nmake.exe" / _all
Microsoft (R) Program Maintenance Utility Version 14.23.28106.4
Copyright (C) Microsoft Corporation. All rights reserved.
Microsoft (R) Program Maintenance Utility Version 14.23.28106.4
Copyright (C) Microsoft Corporation. All rights reserved.
IF EXIST test\evp_extra_test.exe.manifest DEL /F /Q test\evp_extra_test.exe.manifest
link /nologo /debug /subsystem:console /opt:ref /nologo /debug /out:test\evp_extra_test.exe #C:\Users\Jim\AppData\Local\Temp\nmBFB6.tmp
evp_extra_test-bin-evp_extra_test.obj : error LNK2019: unresolved external symbol d2i_DSAPrivateKey referenced in function load_example_dsa_key
evp_extra_test-bin-evp_extra_test.obj : error LNK2019: unresolved external symbol EVP_PKEY_set1_DSA referenced in function load_example_dsa_key
evp_extra_test-bin-evp_extra_test.obj : error LNK2019: unresolved external symbol DSA_free referenced in function load_example_dsa_key
test\evp_extra_test.exe : fatal error LNK1120: 3 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\HostX64\x64\link.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.23.28105\bin\HostX64\x64\nmake.exe"' : return code '0x2'
Stop.
I am using:
Windows 10
Start->Visual Studio 2019->x64 Native Tools Command Prompt for VS 2019 (Run as Administrator)
OpenSSL version 3.0.0 according to VERSION file. Downloaded 20191107
The build command:
perl Configure VC-WIN64A no-idea no-camellia no-seed no-bf no-cast no-des no-rc2 no-rc4 no-rc5 no-md2 no-md4 no-ripemd no-mdc2 no-dsa no-dh no-ec no-ecdsa no-ecdh no-sock no-ssl2 no-ssl3 no-err no-engine no-hw no-asm
Thanks in advance,
Jim

You seem to be using OpenSSL 3.0 which is the as-yet-unreleased still in development version of OpenSSL that you (presumably) downloaded from the git master branch - which is where all active OpenSSL development goes on. As a development branch this should be considered as unstable and not really suitable for any "real" use. It looks like the no-dsa support is currently broken. A fix is here:
https://github.com/openssl/openssl/pull/10375
One way to get things working would be to drop "no-dsa" from your Configure line. Or you could apply the fix at the above URL (or wait a couple of days for it to be merged). Probably though the best route is to just use a stable version of OpenSSL. The latest stable version is 1.1.1d which you can download as a tar from here:
https://www.openssl.org/source/
Alternatively if you have the git repo cloned locally then you can check that version out like this:
$ git checkout OpenSSL_1_1_1d

Related

error with the limits library visual c++

I've trying to compile libSVM on W10 with Visual Studio 2015 Enterprise compiler and I get this error.
I type nmake -f makefile.win
Microsoft (R) Program Maintenance Utility Version 14.00.24210.0
Copyright (C) Microsoft Corporation. All rights reserved.
cl.exe -nologo -O2 -EHsc -I. -D __WIN32__ -D _CRT_SECURE_NO_DEPRECATE -c timer.cpp
timer.cpp
timer.cpp(26): fatal error C1083: Cannot open include file: 'limits': No such file or directory
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\bin\cl.exe"' : return code '0x2'
Stop.
It seems some problem with visual studio installation?
I've think that was something related to the C++ Compiler.

Compile Apache APR on Windows

The end result is I am trying to compile something that requires the APR from Apache on Windows.
Edit: Tried Visual Studio command line tools for VS2013 & VS2014.
Link for SVN checkout shows 404: http://apr.apache.org/anonsvn.txt
so...
From this link http://apr.apache.org/compiling_win32.html I have downloaded the three files. I unzipped them and renames them as the directory structure suggested.
C:\work\apr\
C:\work\apr-iconv\
C:\work\apr-util\
Moved to the apr-util directory and ran the following make command and received the following errors.
Note there is the comment about "Current versions of APR do not need awk..." but the link does not work, does it matter?
Anybody have any luck compiling this, do I need other lib/include/objects?
nmake -f Makefile.win buildall checkall installall clean
Received the following errors:
<clip>
rc.exe /l 0x409 /fo".\Release\libapriconv.res" /i "./include" /i "../apr/include" /d "NDEBUG" /d "API_VERSION_ONLY" .\libapriconv.rc
Microsoft (R) Windows (R) Resource Compiler Version 6.3.9600.17336
Copyright (C) Microsoft Corporation. All rights reserved.
link.exe #C:\Users\JOHNAT~1\AppData\Local\Temp\nm390A.tmp
Creating library .\Release\libapriconv-1.lib and object .\Release\libapriconv-1.exp
if exist .\Release\libapriconv-1.dll.manifest mt.exe -manifest .\Release\libapriconv-1.dll.manifest -outputresource:.\Release\libapriconv-1.dll;2
echo Helper for Post-build step > ".\Release\postbld.dep"
cd ccs
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe" -nologo -f Makefile.win all BUILD_MODE="Win32 Release" BIND_MODE=shared adobe-stdenc.c
Creating library ..\Release\iconv\adobe-stdenc.lib and object ..\Release\iconv\adobe-stdenc.exp
adobe-stdenc.obj : error LNK2011: precompiled object not linked in; image may not run
..\Release\iconv\adobe-stdenc.so : fatal error LNK1120: 1 unresolved externals
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\link.EXE"' : return code '0x460'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
It's a little late, but here is how I fixed it.
In the build\modules.mk.win makefile change line 221 from
$(SILENT)link $(ALL_LDFLAGS) $*.obj $(API_LIBS) /out:$# \
To
$(SILENT)link $(ALL_LDFLAGS) $*.obj $(MODRES).obj $(API_LIBS) /out:$# \
The shared library target will now read:
.c{$(OUTPUT_DIR)}.so:
$(SILENT)cl $(ALL_CFLAGS) /Fo$*.obj /Yuiconv.h /c $<
$(SILENT)link $(ALL_LDFLAGS) $*.obj $(MODRES).obj $(API_LIBS) /out:$# \
/base:#"..\build\BaseAddr.ref",$(#F)
$(SILENT)if exist $#.manifest \
$(SILENT)mt -nologo -manifest $#.manifest -outputresource:$#;2 \
& del "$#.manifest"
$(SILENT)del "$*.exp" & del "$*.lib"
Source: https://gist.github.com/mkhon/01a1536b01e0065ae799
From the apache-apr project site under heading:
Developer Studio Workspace/Microsoft Development Environment IDE Build::
Open the apr-util/aprutil.dsw workspace, and choose either aprutil or libaprutil (for static or dynamic libraries) with the Release or Debug build as the Active Project. aprutil.dsw causes all related projects to be built.
Maybe you overlooked this statement : choose either aprutil or libaprutil as the Active Project...
Then build the active project.

Problems using qxt in Windows

I've been trying to get qxt working in Windows with MSVC 2010.
I have installed Qt 4.8.4 into "D:\Qt\4.8.4", and installed qxt into "D:\libqxt". I configured qxt as follows:
D:\libqxt>configure -prefix D:\libqxt -debug_and_release
And then compiled from the Qt command line:
D:\libqxt>nmake
No errors show up on configuration or compilation, but when I try to compile the examples, I get the following:
D:\libqxt\examples>qmake examples.pro
D:\libqxt\examples>nmake
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
cd displaysettings\ && "C:\Program Files (x86)\Microsoft Visual Studio 1
0.0\VC\BIN\nmake.exe" -f Makefile
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
d:\Qt\4.8.4\bin\qmake.exe -o Makefile displaysettings.pro
"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe" -
f Makefile.Debug all
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
compiling .\displaysettingsdialog.cpp .\main.cpp
displaysettingsdialog.cpp
D:\libqxt\include\QxtGui\QxtScreen(1) : fatal error C1083: Cannot open include f
ile: 'qxtscreen.h': No such file or directory
main.cpp
D:\libqxt\include\QxtGui\QxtScreen(1) : fatal error C1083: Cannot open include f
ile: 'qxtscreen.h': No such file or directory
Generating Code...
NMAKE : fatal error U1077: 'echo' : return code '0x2'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\BIN\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
Examining the makefiles, I see that "D:\libqxt\include" is in the include path, but that isn't where "qxtscreen.h" is located--it's in the "D:\libqxt\src" tree. I could, of course, manually edit the makefiles to add this, but I feel like that shouldn't be required, and perhaps this indicates that I've missed a step. What have I done wrong?
Thanks for your help!

Error building OpenSSL 1.0.1c with MSVC 2010

I have successfully configured OpenSSL for building, but when I run nmake I get this:
c:\Development\Qt\5\OpenSSL>nmake -f ms\ntdll.mak test
Microsoft (R) Program Maintenance Utility Version 10.00.30319.01
Copyright (C) Microsoft Corporation. All rights reserved.
cl /Fotmp32dll\md4test.obj -Iinc32 -Itmp32dll /MD /Ox /O2 /Ob2 -DOPENSSL_THREADS -DDSO_WIN32
-W3 -Gs0 -GF -Gy -nologo -DOPENSSL_SYSNAME_WIN32 -DWIN32_LEAN_AND_MEAN -DL_ENDIAN -D_CRT_SECURE_NO_DEPRECATE
-DOPENSSL_USE_APPLINK -I. -DOPENSSL_NO_RC5 -DOPENSSL_NO_MD2 -DOPENSSL_NO_KRB5 -DOPENSSL_NO_JPAKE
-DOPENSSL_NO_STATIC_ENGINE /Zi /Fdtmp32dll/app -c .\crypto\md4\md4test.c
.\crypto\md4\md4test.c : fatal error C1033: cannot open program database 'c:\development\qt\5\openssl\tmp32dll\app.pdb'
NMAKE : fatal error U1077: '"c:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2'
Stop.
Advices appreciated.
This usually happens when some other application is trying access the file at the same time. For me, it was Dropbox. So, I had to disable the sync.
Another program which accesses the PDB files during compilation is mspdbsrv.exe. This program is started automatically by the build process. Kill it, and remove all the files in tmp32dll folder. It may have been left over from the previous build attempts.
Hope that helps!
I've had this error when I accidentally built with "ms\nt.mak", but then tried to test with "ms\ntdll.mak". Make sure you build and test with the same make file.

Qt 4.8.3 Windows 7 Compile Using Visual Studio Express 2012

I'm still new to Qt. In the past I used to download Qt on a computer and install it without any problems and I get immediate access to all Qt SDK resources including QtCreator.
Now, I downloaded Qt SDK 4.8.3 and after some reading I ended up installing Windows SDK 7. Then I extracted Qt files to C:\Qt. I also added C:\Qt\4.8.3\ to the system path. Then I ran configure which is concluded with no errors. Then I attempted to run nmake which failed with the following error:
Generating Code...
link /LIBPATH:"c:\Qt\4.8.3\lib" /LIBPATH:"c:\Qt\4.8.3\lib" /NOLOGO /DYNAMICBASE /NXCOMPAT /BASE:0x67000000 /DEBUG /DLL /MANIFEST /MANIFESTFILE:"tmp\obj\debug_shared\QtCored.intermediate.manifest" /VERSION:4.83 /OUT:....\lib\QtCored4.dll #C:\Users\MELKAM~1\AppData\Local\Temp\nm5A03.tmp
Creating library ....\lib\QtCored4.lib and object ....\lib\QtCored4.exp
LINK : fatal error LNK1123: failure during conversion to COFF: file invalid or corrupt
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\Bin\amd64\link.EXE"' : return code '0x463'
Stop.
NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0
\VC\Bin\amd64\nmake.exe"' : return code '0x2'
Stop.
NMAKE : fatal error U1077: 'cd' : return code '0x2'
Stop.
Now I have tried the above twice with no luck. Any pointer where should I look? any suggestions are appreciated.
Thanks.
What are you compiling with? MSVC or mingw? If the former, I have found this link incredibly helpful...
http://www.holoborodko.com/pavel/2011/02/01/how-to-compile-qt-4-7-with-visual-studio-2010/
I have followed his instructions for 64bit and 32bit builds many times.
Edit: You have your qt build configured for a MSVC2010 (1600) build, so it's looking in the "C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\Bin\amd64\nmake.exe" directory, which doesn't exist if you only have MSVC2012 (which is version 11.0).
Qt 4.8 doesn't officially support MSVC2012 (yet?), but if you really want to use 2012 then you can try the suggestions at this link. It's complicated, especially if this is your first source build, but seems do-able if you're willing to tinker with the Qt source code.
I had the same issue. the problem was installing visual studio 2012 on a machine with visual studio 2010.
May be this can help https://stackoverflow.com/a/15132209/1933829
Did you run configure from the 64bit tools command tool in vs?
Did you add -platform win32-msvc2010 to the configure commandline (yes even for 64bit builds you need -win32- )

Resources