unknowguys Posted July 4, 2022 Posted July 4, 2022 Hi, I have created a new Unigine project. My setup: API + IDE : C++ (CMake) I generate the cmake project correctly without any type of error, but when doing a build of the projec, I have error on this file: 'UnigineThread.h', Error: C:\PROGRA~1\JETBRA~1\CLION2~1.1\bin\mingw\bin\G__~1.EXE -DDEBUG -isystem E:/Development/unigine/unigine_project/source/../include -g -m64 -march=athlon64 -msse4.2 -ffast-math -fno-strict-aliasing -Wall -Wno-unknown-pragmas -Wno-unused-parameter -std=c++14 -MD -MT CMakeFiles/unigine_project.dir/main.cpp.obj -MF CMakeFiles\unigine_project.dir\main.cpp.obj.d -o CMakeFiles/unigine_project.dir/main.cpp.obj -c E:/Development/unigine/unigine_project/source/main.cpp In file included from E:/Development/unigine/unigine_project/include/UniginePool.h:17, from E:/Development/unigine/unigine_project/include/UnigineHashMap.h:19, from E:/Development/unigine/unigine_project/include/UnigineString.h:19, from E:/Development/unigine/unigine_project/include/UnigineEngine.h:18, from E:/Development/unigine/unigine_project/source/main.cpp:15: In function 'bool Unigine::AtomicCAS(volatile char*, char, char)': /UnigineThread.h:43:25: error: '_InterlockedCompareExchange8' was not declared in this scope; did you mean '_InterlockedCompareExchange'? 43 | return (_InterlockedCompareExchange8(ptr, new_value, old_value) == old_value); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~ | _InterlockedCompareExchange /UnigineThread.h: In function 'char Unigine::AtomicAdd(volatile char*, char)': /UnigineThread.h:98:24: error: '_InterlockedExchangeAdd8' was not declared in this scope; did you mean '_InterlockedExchangeAdd'? 98 | return _InterlockedExchangeAdd8(ptr, value); | ^~~~~~~~~~~~~~~~~~~~~~~~ | _InterlockedExchangeAdd /UnigineThread.h: In function 'short int Unigine::AtomicAdd(volatile short int*, short int)': /UnigineThread.h:110:24: error: '_InterlockedExchangeAdd16' was not declared in this scope; did you mean '_InterlockedExchangeAdd64'? 110 | return _InterlockedExchangeAdd16(ptr, value); | ^~~~~~~~~~~~~~~~~~~~~~~~~ | _InterlockedExchangeAdd64 But if instead of using CMake if i generate the project for Visual Studio, it work it does the compilation correctly. How can i solve this error? do i am missing something, is a new project generated with the Unigine SDK Browser
bmyagkov Posted July 5, 2022 Posted July 5, 2022 Hello! @unknowguys Building project with Mingw compiler does not support at the moment, please switch to visual studio instead. Thanks!
vyacheslav.shahtarov Posted August 21, 2024 Posted August 21, 2024 (edited) Проблему компилятора так и не починили? Я работаю в VS Code, создал проект CMake, компилятор GCC и падают те же ошибки. Как это можно починить? P.s. переходить в Visual Studio что-то не очень хочется. Edited August 21, 2024 by vyacheslav.shahtarov
silent Posted August 22, 2024 Posted August 22, 2024 Под Windows можно собрать только MSVC, компилятор можно поставить отдельно от студии, но как его заставить работать - это уже отдельная боль :) В статье про С++ разработку на VS Code есть упоминание: https://code.visualstudio.com/docs/cpp/config-msvc#_prerequisites How to submit a good bug report --- FTP server for test scenes and user uploads: ftp://files.unigine.com user: upload password: 6xYkd6vLYWjpW6SN
vyacheslav.shahtarov Posted August 22, 2024 Posted August 22, 2024 Спасибо, я смог заставить работать CMake с cl компилятором под VS Code. Оказалось что это просто. Вам бы добавить это в доку, малоли кому пригодится))
Recommended Posts