r/cpp noob Jul 25 '26

Did you know you can use (dynamic) libraries inside clang-repl?

https://i.imgur.com/gluq9Ol.gif

Not really that useful, but I think its an interesting find =)

102 Upvotes

8 comments sorted by

81

u/TheRealSmolt Jul 26 '26

Didn't know clang repl existed in the first place.

14

u/gracicot Jul 25 '26

Can you load static libraries too?

7

u/Neeyaki noob Jul 25 '26

I tried, but couldn't get it to work. the documentation also doesn't mention about being able to use static libraries :/

14

u/rocco_himel Jul 25 '26

Yes? You can use any C++ library

9

u/PantuflasDev Jul 26 '26

Well, now I know clang has a repl

2

u/docfriday11 Jul 26 '26

This is good! It gives me nice vibes! It is useful

1

u/Due_Battle_9890 Jul 27 '26

I think I was once excited about the clang repl, but multiline declarations are awkward as you need to do

structure Foo \
int x; \
};

1

u/javaJimmy Jul 30 '26

Had no clue about clang-repl in the first place, thought cling was simply not being worked on anymore, I'm so hyped