fireice-uk / xmr-stak-cpu

Monero CPU miner
GNU General Public License v3.0
1.11k stars 478 forks source link

CMake Error at CMakeLists.txt #298

Open KevinLu opened 7 years ago

KevinLu commented 7 years ago

When building the source with the Wincompile guide, it returns these errors after executing the build command.

You have called ADD_LIBRARY for library xmr-stak-c without any source files. This typically indicates a problem with your CMakeLists.txt file
CMake Error at CMakeLists.txt:173 (add_executable):
  add_executable called with incorrect number of arguments
CMake Error at CMakeLists.txt:178 (target_link_libraries):
  Cannot specify link libraries for target "xmr-stak-cpu" which is not built
  by this project.
-- Configuring incomplete, errors occurred!
See also "C:/Users/USER/source/build/CMakeFiles/CMakeOutput.log".
See also "C:/Users/USER/source/build/CMakeFiles/CMakeError.log".

CMakeOutput.log

https://pastebin.com/zyw24FiM

CMakeError.log

https://pastebin.com/iq0C5VCz

System is Windows 10 64 bit Intel CPU

psychocrypt commented 7 years ago

Please provide us with all commands you executed on the terminal

KevinLu commented 7 years ago

Extracted the source code to C:/xmr-stak-cpu Extracted the binaries to C:/xmr-stak-dep cd C:/xmr-stak-cpu "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\Common7\Tools\VsMSBuildCmd.bat" set CMAKE_PREFIX_PATH=C:\xmr-stak-dep\hwloc;C:\xmr-stak-dep\libmicrohttpd;C:\xmr-stak-dep\openssl mkdir build cd build cmake -G "Visual Studio 15 2017 Win64" -T v141,host=x64 ..

Then it returns the errors in the original post.

psychocrypt commented 7 years ago

Could you compile xmr-stak in a clean folder again, it looks like there is something cashed

KevinLu commented 7 years ago

Compiled again. Returned this error

CMake Error at CMakeLists.txt:74 (message):
  microhttpd NOT found: use `-DMICROHTTPD_ENABLE=OFF` to build without http
  deamon support
CrateMayne commented 7 years ago

I seem to be getting same issue after following the Windows Compile Guide exactly :( Shouldn't be issue of caching as it was first attempt.... But not skilled enough to know what the issue is.

Win 10 Home with VS 2017. Tried CMake 3.9.1 originally, then went back to try with the tested 3.9.0 but no luck.

Same error as posted above:

CMake Error at CMakeLists.txt:74 (message): microhttpd NOT found: use `-DMICROHTTPD_ENABLE=OFF` to build without http deamon support

Adr3nl commented 7 years ago

I'm having the exact same issue following the provided windows compilation guide:

C:\Users\tiago\monero_mining_cpu_xmr-stak_dep\xmr-stak-cpu-master\build>cmake -G "Visual Studio 15 2017 Win64" -T v141,host=x64 .. -- The C compiler identification is MSVC 19.11.25507.1 -- The CXX compiler identification is MSVC 19.11.25507.1 -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX64/x64/cl.exe -- Check for working C compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX64/x64/cl.exe -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX64/x64/cl.exe -- Check for working CXX compiler: C:/Program Files (x86)/Microsoft Visual Studio/2017/Community/VC/Tools/MSVC/14.11.25503/bin/HostX64/x64/cl.exe -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done -- Looking for pthread.h -- Looking for pthread.h - not found -- Found Threads: TRUE CMake Error at CMakeLists.txt:74 (message): microhttpd NOT found: use-DMICROHTTPD_ENABLE=OFFto build without http deamon support

psychocrypt commented 7 years ago

The error message say that a dependency was not found. Add -DMICROHTTPD_ENABLE=OFF to disable the dependency.

KONIKPK commented 7 years ago

Where i put -DMICROHTTPD_ENABLE=OFF ?

MarcelliusKGitHub commented 7 years ago

I have the same problem. I have the dependicies on the correct path.

psychocrypt commented 7 years ago

cmake . -DMICROHTTPD_ENABLE=OFF

Gordi90 commented 7 years ago

I think, the problem is a semicolon when setting a variable

set CMAKE_PREFIX_PATH=C:\xmr-stak-dep\hwloc;C:\xmr-stak-dep\libmicrohttpd;C:\xmr-stak-dep\openssl

Instead I inserted the following to my CMakeLists.txt (line 14) set(CMAKE_PREFIX_PATH C:\\xmr-stak-dep\\hwloc;C:\\xmr-stak-dep\\libmicrohttpd;C:\\xmr-stak-dep\\openssl)

This way, you don't have to disable microhttpd.

MarcelliusKGitHub commented 7 years ago

I got it running. I tried to do the guide in de normal cmd prompt, this didn't work. Instead of that I used the MSVS prompt. Now it is running!

znowfox commented 6 years ago

make sure in the folder you link mhtd the lib is called microhttpd.lib