clsocket
clsocket copied to clipboard
Install failing on visual studio 2017
The install is failing on visual studio 2017, on windows 7. I get the following error:
[1/2] Linking CXX shared library clsocket-CMAKE\clsocket.dll
FAILED: clsocket-CMAKE/clsocket.dll clsocket-CMAKE/clsocket.lib
cmd.exe /C "cd . && "C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -E vs_link_dll --intdir=clsocket-CMAKE\CMakeFiles\clsocket.dir --manifests -- C:\PROGRA~2\MIB055~1\2017\PROFES~1\VC\Tools\MSVC\1414~1.264\bin\Hostx86\x86\link.exe /nologo clsocket-CMAKE\CMakeFiles\clsocket.dir\src\SimpleSocket.obj clsocket-CMAKE\CMakeFiles\clsocket.dir\src\ActiveSocket.obj clsocket-CMAKE\CMakeFiles\clsocket.dir\src\PassiveSocket.obj /out:clsocket-CMAKE\clsocket.dll /implib:clsocket-CMAKE\clsocket.lib /pdb:clsocket-CMAKE\clsocket.pdb /dll /version:4.0 /machine:X86 /debug /INCREMENTAL Ws2_32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib && cd ."
RC Pass 1: command "rc /foclsocket-CMAKE\CMakeFiles\clsocket.dir/manifest.res clsocket-CMAKE\CMakeFiles\clsocket.dir/manifest.rc" failed (exit code 0) with the following output:
The system cannot find the file specified
ninja: build stopped: subcommand failed.
Install failed.
Is clsocket-CMAKE a folder you added? I don't recognize the name, and I'm pretty sure the repo path wouldn't show up in at least the first line.
I renamed the project but nothing more. I managed to make it work by exporting the classes. I made this definition
#ifdef _SHARED #define EXPORT __declspec(dllexport) #else #define EXPORT __declspec(dllimport) #endif
And the exported the classes I needed. e.g.
class EXPORT CSimpleSocket {
As a side request, could you give UDP example? I can't get any packets to send in UDP mode.
I'm not sure if this is the same problem but i've had this happen a few times. The issue is that if you use the ".bat" file that sets up the paths for msvc it's missing the framework setting e.g. default:
%comspec% /k ""D:\Program Files\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" x86
where as if you want to use "rc", "fxc" or other tools you need to use e.g:
%comspec% /k ""D:\Program Files\Microsoft Visual Studio 14.0\VC\vcvarsall.bat"" x86 8.1