ntop / n2n

Peer-to-peer VPN
GNU General Public License v3.0
6.28k stars 943 forks source link

[windows] compilation error in 2.7(latest) source code #251

Closed 244849530 closed 4 years ago

244849530 commented 4 years ago

When I compile using the latest version of the source code, I get the following error:

“C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\n2n-dev\build\edge.vcxproj”(Build target) (1) -> “C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\n2n-dev\build\n2n.vcxproj”(default target) (3) -> (ClCompile target) -> C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\n2n-dev\edge_utils.c(57,8): error C2065: “LZO1X_1_MEM_COMPRESS”: Undeclared identifier [C:\Program F iles (x86)\Microsoft Visual Studio\2019\BuildTools\n2n-dev\build\n2n.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\n2n-dev\edge_utils.c(57,8): error C2057: Constant expression should be entered [C:\Program Files (x86)\Microsoft Vi sual Studio\2019\BuildTools\n2n-dev\build\n2n.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\n2n-dev\edge_utils.c(57,8): error C2466: Cannot allocate an array of constant size 0 [C:\Program Files (x86)\Micro soft Visual Studio\2019\BuildTools\n2n-dev\build\n2n.vcxproj] C:\Program Files (x86)\Microsoft Visual Studio\2019\BuildTools\n2n-dev\edge_utils.c(57,48): error C2133: “wrkmem”: Unknown size [C:\Program Files (x86)\Micr osoft Visual Studio\2019\BuildTools\n2n-dev\build\n2n.vcxproj]

System: Windows 10 Compile Tool:Visual Studio 2019 build tools (use Visual Studio 2017 will get the same error)

In the same enviroment,the stable release can be successfully compiled.

Logan007 commented 4 years ago

Disclaimer: I am absolutely not a Windows expert... but you could try to add a minilzo.c entry to the add_library( ...) section of the CMakeLists.txt file, around line 55.

244849530 commented 4 years ago

Disclaimer: I am absolutely not a Windows expert... but you could try to add a minilzo.c entry to the add_library( ...) section of the CMakeLists.txt file, around line 55.

thanks for your help,I try to insert the minilzo.c entry in CMakeList addlibrary(...), but still get the same error. It seems that edge_utils.c cannot get definition from minilzo.h.

244849530 commented 4 years ago

Disclaimer: I am absolutely not a Windows expert... but you could try to add a minilzo.c entry to the add_library( ...) section of the CMakeLists.txt file, around line 55.

So I added #include<minilzo.h> in edge_utils.c, which can successfully compile the source code, and then run the edge program, showing the version is 2.5.1

Logan007 commented 4 years ago

Great to hear that it works for you!

I just wonder if you really have cloned the full current dev code base as edge_utils.c already should include such a line.