CppServer icon indicating copy to clipboard operation
CppServer copied to clipboard

Getting Cmake Error while Building

Open Saurabh2109 opened this issue 3 years ago • 4 comments

CMake Error at C:/Users/dataman/AppData/Local/Programs/Python/Python310/Lib/site-packages/cmake/data/share/cmake-3.22/Modules/SystemInformation.cmake:35 (file): file failed to open for writing (No such file or directory):

D:/Andre/CppTrader/modules/CppCommon/

Call Stack (most recent call first): modules/CppCommon/CMakeLists.txt:27 (include)

CMake Error at C:/Users/dataman/AppData/Local/Programs/Python/Python310/Lib/site-packages/cmake/data/share/cmake-3.22/Modules/SystemInformation.cmake:35 (file): file failed to open for writing (No such file or directory):

D:/Andre/CppTrader/modules/CppCommon/

Call Stack (most recent call first): modules/CppCommon/CMakeLists.txt:27 (include)

CMake Error at C:/Users/dataman/AppData/Local/Programs/Python/Python310/Lib/site-packages/cmake/data/share/cmake-3.22/Modules/SystemInformation.cmake:35 (file): file failed to open for writing (No such file or directory):

D:/Andre/CppTrader/modules/CppCommon/

Call Stack (most recent call first): modules/CppCommon/CMakeLists.txt:27 (include)

Saurabh2109 avatar Jan 14 '22 18:01 Saurabh2109

Did you do the following step? image

chronoxor avatar Jan 14 '22 19:01 chronoxor

yes i followed all the steps.this error was coming from running vs.bat.Is there any path related issue.

Saurabh2109 avatar Jan 15 '22 05:01 Saurabh2109

Now i am getting this error.

"D:\Andre\CppTrader\temp\ALL_BUILD.vcxproj" (default target) (1) -> "D:\Andre\CppTrader\temp\cpptrader-tests.vcxproj" (default target) (17) -> (Link target) -> cppcommon.lib(path.obj) : error LNK2019: unresolved external symbol __imp_GetUserProfileDirectoryW referenced in function "public: static class CppCommon::Path __cdecl CppCommon::Path::home(void)" (?home@Path@CppCommon@@SA ?AV12@XZ) [D:\Andre\CppTrader\temp\cpptrader-tests.vcxproj] cppcommon.lib(uuid.obj) : error LNK2019: unresolved external symbol __imp_UuidCreate referenced in function "p ublic: static class CppCommon::UUID __cdecl CppCommon::UUID::Random(void)" (?Random@UUID@CppCommon@@SA?AV12@XZ) [D:\Andre\CppTrader\temp\cpptrader-tests.vcxproj] cppcommon.lib(uuid.obj) : error LNK2019: unresolved external symbol __imp_UuidCreateSequential referenced in f unction "public: static class CppCommon::UUID __cdecl CppCommon::UUID::Sequential(void)" (?Sequential@UUID@CppCo mmon@@SA?AV12@XZ) [D:\Andre\CppTrader\temp\cpptrader-tests.vcxproj] D:\Andre\CppTrader\temp\RelWithDebInfo\cpptrader-tests.exe : fatal error LNK1120: 3 unresolved externals [D:\A ndre\CppTrader\temp\cpptrader-tests.vcxproj]

Saurabh2109 avatar Jan 15 '22 06:01 Saurabh2109

UuidCreate and UuidCreateSequential come from MS, you need to link Rpcrt4.lib. GetUserProfileDirectoryW is also a MS function and comes from userenv.lib.

Arguably these should be public dependencies of cppcommon module, or at least interface dependencies if you want to rely on the user to link these

uniflare avatar Dec 29 '23 07:12 uniflare