2,089
questions
0
votes
0
answers
28
views
undefined reference to llvm.x86.rdrand.16.sl_s intrinsic
I have an LLVM pass inserting a call to the RDRAND intrinsic (using irBuilder.CreateIntrinsic(Intrinsic::x86_rdrand_16, {ReturnType}, {})). I'm able to successfully generate this IR:
%1 = alloca i32, ...
1
vote
1
answer
79
views
non-ASM statement in naked function
I am trying to create a class containing custom prologue/epilogues that shall be used by methods of other "consumer" classes.
It should look like the following example. (Keep in mind that ...
3
votes
1
answer
82
views
reinterpret_cast to span of wrappers
Given the following wrapper (simplified):
template <std::integral T> class Wrapper {
public: auto val() { return t; }
private: T t;
};
I am trying to obtain a span of wrappers to a ...
0
votes
0
answers
34
views
iostream not found with g++ and clang on macos
I'm trying to compile StegHide from source and I got an error message, saying that iostream can't be found.
I wrote the following program and compiled it with -std set to all standards that my system ...
-4
votes
0
answers
71
views
<iostream> file not found in VS Code on macOS (M1), tried multiple configurations and reinstallations [closed]
I'm trying to set up a C++ development environment in Visual Studio Code on macOS with an M1 chip. However, whenever I include <iostream>, I get an error saying that the file is not found. I’ve ...
1
vote
1
answer
102
views
Why compilers treat differently parenthesized type followed by an initializer list in C++?
Why the same code below compiles fine with CLang and doesn't compile with MSVC?
#include <iostream>
const char * NumberToText(int val)
{
return (const char *[]) {
"Zero",
...
-1
votes
0
answers
16
views
Trying to create an example template Stack class with separate class method declarations/definitions [duplicate]
I'm creating my own C++ tutorial, and I'm immersed in providing some template examples.
I know that the C++ Standard Library contains a Stack class, but I'm trying to provide relatively simple ...
0
votes
0
answers
22
views
Bug with Clang 14 produces no object code when compiling c++ classes
I'm porting some code to c++ and I've started by writing a simple timer class for benchmarking.
#include <chrono>
using namespace std::chrono;
class run_timer {
private:
steady_clock::...
0
votes
0
answers
68
views
Emscripten Multiply defined symbol, vtable
I have compiled a variety of LLVM Object files.
However, when linking them together, I get this error:
error: Linking globals named '_ZTV4CRpg': symbol multiply defined!
I debugged and found there ...
0
votes
0
answers
34
views
How to execute NDK/Clang in Android 11 using Java to compile C++ code within app environment?
I'm working on an Android app that needs to compile C++ code using the NDK and Clang(linux). In Android 11, I'm unable to execute Clang directly from internal storage due to storage and execution ...
0
votes
1
answer
45
views
clang: undefined symbol boost::archive::archive_exception
I'm building the demo from the tutorial
https://www.boost.org/doc/libs/1_85_0/libs/serialization/doc/tutorial.html
I created the project using cmake for VS22 with clang-cl.exe, and the cmakefile.txt ...
7
votes
1
answer
157
views
clang error on exception specification from C++20 on
This code compiles on gcc and msvc but not with clang from C++20 on:
#include <type_traits>
class IBase {
protected:
IBase() noexcept = default;
public:
virtual ~IBase() noexcept ...
1
vote
0
answers
56
views
error: static AddressSanitizer runtime is not supported on darwin
I often use -fsanitize=address when building using clang++ for getting the line number of issues, but on 9/18/2024, Apple had me agree to a new terms of service or something via the command line, and ...
0
votes
0
answers
27
views
Preprocessor #warning does not work anymore in Xcode 16?
I have check like below to make an error or a warning on Macos during compilation.
SomeHeader.hpp
#if SOME_CONDITION
#warning This is a warning.
#endif
But the line with #warning has started to ...
5
votes
1
answer
2k
views
can't compile c++ hello world with clang on mac sequoia 15.0 and VS Code
I have updated XCode(v. 16.0) and made sure the xcode command line tools (xcode-select version 2409) are updated.
I have installed the C/C++ VS Code extension v.1.21.6
My compiler path is set to /usr/...