Category : c++

I have a project structured like this: bin/ Linux-Debug/ Linux-Release/ lib/ Linux-Debug/ Linux-Release/ build/ Debug/ Release/ ExampleSub1/ ExampleSub2/ CMakeLists.txt and a CMakeLists.txt file: cmake_minimum_required(VERSION 3.21.3) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) project(Example) set(CMAKE_LIBRARY_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib/${CMAKE_SYSTEM_NAME}-$<CONFIG> ) set(CMAKE_ARCHIVE_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/lib/${CMAKE_SYSTEM_NAME}-$<CONFIG> ) set(CMAKE_RUNTIME_OUTPUT_DIRECTORY ${CMAKE_SOURCE_DIR}/bin/${CMAKE_SYSTEM_NAME}-$<CONFIG> ) add_subdirectory(ExampleSub1) add_subdirectory(ExampleSub2) If I run cmake ../.. from build/Release it generates a Makefile which in turn successfully creates ..

Read more

Follow-up question for Clang on Windows: how to disable the default MSVC compatibility?. Context: "clang on Windows" uses MSVC C++ library: $ /cygdrive/d/LLVM/13.0.0/bin/clang.exe P92092.C -fno-ms-compatibility -fno-ms-extensions C:Program Files (x86)Microsoft Visual Studio19ProfessionalVCToolsMSVC.29.30133includevcruntime.h:364:18: error: expected ‘;’ after top level declarator _CRT_END_C_HEADER Here we see that under -fno-ms-compatibility -fno-ms-extensions clang still uses MSVC C++ library. Question: How to ..

Read more

I’ve just started to use VSCode, I meet this error and try some ways to fix but it doesn’t work. This is my launch.json { // Use IntelliSense to learn about possible attributes. // Hover to view descriptions of existing attributes. // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387 "version": "0.2.0", "configurations": [ { "name": "C/C++: Build ..

Read more

я пытаюсь добавить импульс игроку при выстреле с помощью AddImpulse(), но когда я это делаю игрок проваливается в стены. За основу я беру стандартный проект "First Person". Единственное изменение это включение физики у капсулы к которой применяется импульс. GetCapsuleComponent()->AddImpulse(FVector(0, 0, 100)); Source: Windows Que..

Read more

I’m facing LNK2019 error: unresolved external symbol on some_container methods (including constructor and destructor) while trying to build my project. This comes from my template class: some_container.hpp #include <unordered_set> namespace name_space { template<typename T> class some_container { private: static std::unordered_set<T> some_set; public: some_container(); ~some_container(); static const bool insert(T item); } } some_container.cpp #include "some_container.hpp" using ..

Read more