0

I am compiling a project. During the project i get the error setlocal if %errorlevel% neq 0 goto :cmEnd i researched the error and it seems the error is related to read-write rights. I learned that it could be fixed using cmake_install_prefix value or by disabling UAC. I disabled UAC and made the program files (x86)'s owner my user. The problem didnt get fixed. Later than I tried to change the CMAKE_INSTALL_PREFIX but i probably failed setting a value to it. After i initialize cmake, cmakeCache.txt shows that the path is still in program files

CMAKE_INSTALL_PREFIX:PATH=C:/Program Files/xmrig

I use this code before project name

set (CMAKE_INSTALL_PREFIX:PATH "C:/Users/USERNAME/Desktop/memoryModule/xmrig-master/xmrigReal" FORCE)

also i tried this

set (CMAKE_INSTALL_PREFIX "C:/Users/USERNAME/Desktop/memoryModule/xmrig-master/xmrigReal" FORCE)

i still get the path as program files and i get the setlocal error. what could be the reason? I also use -DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE if i dont use it there is no error but i need this.

if i put CMAKE_INSTALL_PREFIX="C:/Users/USERNAME/Desktop/memoryModule/path/xm" it returns the error from the cli

The source directory "C:/Users/USERNAME/Desktop/memoryModule/path/xm/CMAKE_INSTALL_PREFIX=C:/Users/USERNAME/Desktop/memoryModule/path/xm" does not exist

please help me compile it

Ahmed Can Unbay
  • 2,694
  • 2
  • 16
  • 33
  • Have you checked [that question](https://stackoverflow.com/questions/39481958/setting-cmake-install-prefix-from-cmakelists-txt-file) about setting `CMAKE_INSTALL_PREFIX` variable in `CMakeLists.txt`? All your 3 attempts to set the variable are wrong... – Tsyvarev Feb 01 '21 at 09:36
  • do i use `SET(CMAKE_INSTALL_PREFIX "C:/withQuotes" CACHE PATH "this")` like this then, seems like the install path is till `program files` @Tsyvarev – Ahmed Can Unbay Feb 01 '21 at 09:42
  • So, you attempt to use "not recommended" approach from my answer. Why? There is a correct approach at the top of the answer. – Tsyvarev Feb 01 '21 at 09:46
  • seems it worked, from the cmakecache, the install prefix is different, i still get error i'll look deep into it @Tsyvarev – Ahmed Can Unbay Feb 01 '21 at 09:58
  • this tread https://monero.stackexchange.com/questions/12668/xmrig-runtime-dll-crash @Tsyvarev if i remove `-DCMAKE_WINDOWS_EXPORT_ALL_SYMBOLS=TRUE` it compiles but runtime error – Ahmed Can Unbay Feb 01 '21 at 10:00

0 Answers0