Building with VS2015

97 views
Skip to first unread message

Jonathan Johansen

unread,
Mar 19, 2019, 8:31:37 AM3/19/19
to cormanlisp
Hi all, I'm trying to build with VS 2015, and have some linker errors (missing symbol _memcpy, etc.). Would anyone be willing to help? Perhaps I have the wrong setup?

Artem Boldariev

unread,
Mar 20, 2019, 6:33:22 AM3/20/19
to cormanlisp
I would be glad to help. I am sure that the project should be possible to build with default settings from the repository. Nothing except the Visual Studio is actually required. The only optional dependency is WiX which is used to build the installer.

Can you provide the additional information (e.g. build logs)?

вторник, 19 марта 2019 г., 14:31:37 UTC+2 пользователь Jonathan Johansen написал:

Jonathan Johansen

unread,
Mar 21, 2019, 7:02:53 AM3/21/19
to cormanlisp
Dear Artem

Thank you so much for offering to help! I learned a little C++ back over 10 years now, and have mostly used VBA, Common Lisp and other higher level languages since. I have used C++ a bit at work in the last month, and C# this last year, so am becoming more familiar with Visual Studio, but wow is it all complicated :-). Here is my setup:
  • Win 8.1 Pro, x64
  • Visual Studio 2015 Version 14.0.25431.01 Update 3, with Visual C++ 2015 installed of course.
  • I git cloned into C:\Users\%USERNAME%\Dropbox\Code\cormanlisp
When I opened src.sln, it went through an upgrade, which was unexpected. Then on a build I get this:

1>------ Rebuild All started: Project: zlib, Configuration: Standard Win32 ------
1>  adler32.c
1>  compress.c
1>  crc32.c
1>  deflate.c
1>  gzio.c
1>  infback.c
1>  inffast.c
1>  inflate.c
1>  inftrees.c
1>  minigzip.c
1>  trees.c
1>  uncompr.c
1>  zutil.c
1>  Generating Code...
1>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(1357,5): warning MSB8012: TargetPath(C:\Users\jonathanj\Dropbox\Code\cormanlisp\zlib\.\bin\zlib.lib) does not match the Library's OutputFile property value (C:\Users\jonathanj\Dropbox\Code\cormanlisp\zlib\zlib.lib). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Lib.OutputFile).
1>  zlib.vcxproj -> C:\Users\jonathanj\Dropbox\Code\cormanlisp\zlib\.\bin\zlib.lib
2>------ Rebuild All started: Project: CormanLispServer, Configuration: Standard Win32 ------
3>------ Rebuild All started: Project: license, Configuration: Standard Win32 ------
2>  CharBuf.cpp
3>  EncryptDes.cpp
3>  license.cpp
2>  CoConnectionPoint.cpp
3>license.cpp(277): warning C4477: 'sprintf_s' : format string '%d' requires an argument of type 'int', but variadic argument 1 has type 'time_t'
3>  license.cpp(277): note: consider using '%lld' in the format string
3>  license.cpp(277): note: consider using '%I64d' in the format string
3>  Generating Code...
2>  CoCormanLisp.cpp
3>     Creating library ../license.lib and object ../license.exp
3>  license.vcxproj -> C:\Users\jonathanj\Dropbox\Code\cormanlisp\license\..\license.dll
2>  CoEnumConnectionPoints.cpp
2>  CoEnumConnections.cpp
2>  Compx86.cpp
2>  CormanLispServer.cpp
2>src\CormanLispServer.cpp(65): warning C4996: 'GetVersionExA': was declared deprecated
2>  C:\Program Files (x86)\Windows Kits\8.1\Include\um\sysinfoapi.h(433): note: see declaration of 'GetVersionExA'
2>src\CormanLispServer.cpp(235): warning C4996: 'GetVersionExA': was declared deprecated
2>  C:\Program Files (x86)\Windows Kits\8.1\Include\um\sysinfoapi.h(433): note: see declaration of 'GetVersionExA'
2>  Disasm.cpp
2>  Gc.cpp
2>  Lisp.cpp
2>  Lispfunc.cpp
2>  LispMath.cpp
2>  LispThreadQueue.cpp
2>  MemoryReport.cpp
2>src\MemoryReport.cpp(73): warning C4477: 'fprintf' : format string '%08.8x' requires an argument of type 'unsigned int', but variadic argument 1 has type 'Node *'
2>src\MemoryReport.cpp(74): warning C4477: 'fprintf' : format string '%08.8x' requires an argument of type 'unsigned int', but variadic argument 1 has type 'Node *'
2>src\MemoryReport.cpp(75): warning C4477: 'fprintf' : format string '%08.8x' requires an argument of type 'unsigned int', but variadic argument 1 has type 'Node *'
2>src\MemoryReport.cpp(76): warning C4477: 'fprintf' : format string '%08.8x' requires an argument of type 'unsigned int', but variadic argument 1 has type 'Node *'
2>src\MemoryReport.cpp(117): warning C4477: 'fprintf' : format string '%08.8x' requires an argument of type 'unsigned int', but variadic argument 1 has type 'LispObj *'
2>src\MemoryReport.cpp(124): warning C4477: 'fprintf' : format string '%08.8x' requires an argument of type 'unsigned int', but variadic argument 1 has type 'LispObj *'
2>src\MemoryReport.cpp(737): warning C4477: 'fprintf' : format string '%08.8x' requires an argument of type 'unsigned int', but variadic argument 1 has type 'LispObj *'
2>src\MemoryReport.cpp(738): warning C4477: 'fprintf' : format string '%08.8x' requires an argument of type 'unsigned int', but variadic argument 1 has type 'LispObj *'
2>src\MemoryReport.cpp(767): warning C4477: 'fprintf' : format string '%08.8x' requires an argument of type 'unsigned int', but variadic argument 1 has type 'LispObj *'
2>src\MemoryReport.cpp(798): warning C4477: 'fprintf' : format string '%08.8x' requires an argument of type 'unsigned int', but variadic argument 1 has type 'LispObj *'
2>src\MemoryReport.cpp(806): warning C4477: 'fprintf' : format string '%08.8x' requires an argument of type 'unsigned int', but variadic argument 1 has type 'LispObj *'
2>src\MemoryReport.cpp(856): warning C4477: 'fprintf' : format string '%08.8x' requires an argument of type 'unsigned int', but variadic argument 1 has type 'LispObj *'
2>src\MemoryReport.cpp(1104): warning C4477: 'fprintf' : format string '%08.8x' requires an argument of type 'unsigned int', but variadic argument 1 has type 'void *'
2>  Read.cpp
2>  Stdafx.cpp
2>  ThreadClasses.cpp
2>  Write.cpp
2>  Generating Code...
2>C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V140\Microsoft.CppBuild.targets(1189,5): warning MSB8012: TargetPath(C:\Users\jonathanj\Dropbox\Code\cormanlisp\CormanLispServer\.\bin\CormanLispServer.dll) does not match the Linker's OutputFile property value (C:\Users\jonathanj\Dropbox\Code\cormanlisp\CormanLispServer.dll). This may cause your project to build incorrectly. To correct this, please make sure that $(OutDir), $(TargetName) and $(TargetExt) property values match the value specified in %(Link.OutputFile).
2>     Creating library .\./bin/CormanLispServer.lib and object .\./bin/CormanLispServer.exp
2>zlib.lib(inflate.obj) : error LNK2001: unresolved external symbol _memcpy
2>Lispfunc.obj : error LNK2001: unresolved external symbol _memcpy
2>Write.obj : error LNK2001: unresolved external symbol _memcpy
2>zlib.lib(gzio.obj) : error LNK2001: unresolved external symbol _memcpy
2>zlib.lib(deflate.obj) : error LNK2001: unresolved external symbol _memcpy
2>CharBuf.obj : error LNK2001: unresolved external symbol _memcpy
2>Compx86.obj : error LNK2001: unresolved external symbol _memcpy
2>Gc.obj : error LNK2001: unresolved external symbol _memcpy
2>Lisp.obj : error LNK2001: unresolved external symbol _memcpy
2>Lispfunc.obj : error LNK2001: unresolved external symbol __imp__strcpy_s
2>CharBuf.obj : error LNK2001: unresolved external symbol __imp__strcpy_s
....

Perhaps I'll have dig around too...

Regards
Jonathan

Jonathan Johansen

unread,
Mar 21, 2019, 7:20:54 AM3/21/19
to cormanlisp
I looked into a git diff of what the upgrade I mentioned did, and the zlib.vcxproj project file version was updated from:

<_ProjectFileVersion>12.0.30501.0</_ProjectFileVersion>
to
 <_ProjectFileVersion>14.0.25431.1</_ProjectFileVersion>

I suppose I should try to downgrade if all else fails... and that may explain my problems building. Other things changed with that:
  • <Project ... ToolsVersion="12.0" changed to "14.0"
  • <PlatformToolset>v120_xp</PlatformToolset> changed to v140
Regards
Jonathan

Jonathan Johansen

unread,
Mar 21, 2019, 7:44:14 AM3/21/19
to cormanlisp
Then I thought I'd try to eliminate the MSB8012 warnings about output/target directories not matching. I managed to do that (zlib Output Directory to ".\" instead of ".\bin\", and CormanLispServer Output Directory to "..\" instead of ".\bin\"), but still no luck on the linker issues.

I'm wondering if I shouldn't just figure out the exact version others have. I wonder if VS2017 being installed alongside it has unintentionally upgraded some process too.

On Thursday, 21 March 2019 21:20:54 UTC+10, Jonathan Johansen wrote:
I looked into a git diff of what the upgrade I mentioned did, and the zlib.vcxproj project file version was updated from:

<_ProjectFileVersion>12.0.30501.0</_ProjectFileVersion>
to
 <_ProjectFileVersion>14.0.25431.1</_ProjectFileVersion>

I suppose I should try to downgrade if all else fails... and that may explain my problems building. Other things changed with that:
  • <Project ... ToolsVersion="12.0" changed to "14.0"
  • <PlatformToolset>v120_xp</PlatformToolset> changed to v140
Regards
Jonathan

On Thursday, 21 March 2019 21:02:53 UTC+10, Jonathan Johansen wrote:
Dear Artem

Thank you so much for offering to help! I learned a little C++ back over 10 years now, and have mostly used VBA, Common Lisp and other higher level languages since. I have used C++ a bit at work in the last month, and C# this last year, so am becoming more familiar with Visual Studio, but wow is it all complicated :-). Here is my setup:
... 

Artem Boldariev

unread,
Mar 21, 2019, 8:16:00 AM3/21/19
to cormanlisp

No need to downgrade, you seem to use corect version of VS - v140 is VS2015. I believe that the projects in the repository use v140_xp - is it available?

I have VS2013, VS2015 and VS2017 installed on my machine. Having multiple versions of Visual Studio should not cause any problems.

It is strange that you have problems building it, I believe it should be straightforward to build.

Jonathan Johansen

unread,
Mar 21, 2019, 10:04:57 AM3/21/19
to cormanlisp
Cool - I have just tried to build again, with all projects set to v140_xp. No joy. Perhaps I just need to wait till I get a new computer in about a year :-P, this computer has worked hard for at least six years.

I might try to create a basic C++ project to see if a new project has the same problem. It's getting late, so another evening.

Regards
Reply all
Reply to author
Forward
0 new messages