How To Fix Include Errors in C++

How To Fix Include Errors in C++

The Cherno

11 месяцев назад

73,394 Просмотров

Ссылки и html тэги не поддерживаются


Комментарии:

@marscitizen42
@marscitizen42 - 05.01.2024 21:35

alternatively you can be programming on linux and avoid stupid problems like these

Ответить
@johnvonachen1672
@johnvonachen1672 - 25.10.2023 03:33

I literally, like, you know, couldn't, like, listen to, like, your, like video. Guess, like, why?

Ответить
@vesk4000
@vesk4000 - 30.09.2023 21:09

You should do a video on the new C++20 module system

Ответить
@paultait1955
@paultait1955 - 26.09.2023 12:26

I don't know how many people picked it up but I noticed you using "/" instead of the more tradition "\\" as a directory separator. I do it all the time as it saves a character and the \ is way over to the top right. PLUS it makes it UNIX compatible 🙂

Ответить
@chastitywhiterose
@chastitywhiterose - 01.09.2023 22:56

I don’t use visual studio but if I ever do this could save me a lot of trouble.

Ответить
@AlberTesla1024
@AlberTesla1024 - 01.09.2023 17:16

The best error is when after including a header one gets circular dependency error. 😂

Ответить
@gabrielcarreno-jk1cy
@gabrielcarreno-jk1cy - 29.08.2023 21:41

I FUCKING HATE IT TOO 😫😤

Ответить
@Netryon
@Netryon - 08.08.2023 18:25

It's all about Ukraine war, so if you can fix it it with these <> - do it, because I want to talk about what I would like to see and create a T-shirt that I wanted. So you don't want to deal with this connection string mess, you want install it and run it. I'm not rethinking how I fixed Ferrari in the past - what if I had that class diagram before. This is now as simple as PHP was, but try remember how it was with all the memory pointers and addresses. Don't you copy those rap songs in a radio you working now.

Ответить
@nasralkhteeb4362
@nasralkhteeb4362 - 28.07.2023 21:51

ks amak

Ответить
@kebabimpaler
@kebabimpaler - 19.07.2023 14:07

Man I forgot just how horrible the visual studio filter stuff is in terms of getting in the way of obfuscating how stuff actually works. Excellent video.

Ответить
@Tacos4brekky
@Tacos4brekky - 18.07.2023 19:08

New to C++ and coding in general, I just wanted to say that this was the video that made classes click for me. Every video I've seen explains classes using people as an example, just creating like categories for age, height, weight, etc. I never understood the point. Seeing how the timer class is just structured functions within a broader shared category really did the trick. Also immediately showed me why using namespace std is bad.

Ответить
@ramikassouf1822
@ramikassouf1822 - 14.07.2023 18:49

thought this would talk about CMake and that whole shabang cz usually linking hpp and cpp files is a pain

Ответить
@ikategame
@ikategame - 10.07.2023 20:41

cool

Ответить
@sajjadjawadkadhim303
@sajjadjawadkadhim303 - 05.07.2023 20:59

This is just a window + visual studio overhead

Ответить
@user-qs1tt1of6l
@user-qs1tt1of6l - 25.06.2023 05:07

Hi Cherno, I have watched many of your turtorials of cpp. I realy learned a lot from your videos, even more than how much teachers taught me in my college. Thank you very much

Ответить
@yassinesafraoui
@yassinesafraoui - 20.06.2023 12:00

you could add the Headers directory to the include path of vs that you shown in the beginning in the project, i mean just to not have to write Headers each time you import something 😅

Ответить
@merthyr1831
@merthyr1831 - 19.06.2023 17:18

Visual Studio devs making development 10 times harder than it should be while pretending to be helpful as usual.

Ответить
@harshithgowda6227
@harshithgowda6227 - 19.06.2023 12:00

Why is that my VScode and The cherno's VS code doesnot look similar?, a lot of options available in The cherno's C++ is not available in Visual Studio Code even though I have it up to date
Can anyone help me as to why this is the case and how I can resolve it?

Ответить
@zdspider6778
@zdspider6778 - 14.06.2023 17:57

These "filters" are a huge design flaw in Visual Studio. Microsoft should just get rid of them. Or at the very least not make them the default.

Ответить
@spicygaming9528
@spicygaming9528 - 10.06.2023 09:31

Cherno can you make a video about concepts in c++?

Ответить
@Mhmhind
@Mhmhind - 08.06.2023 21:32

Can you make tutorials for Embarcadreo C++?

Ответить
@PoppsMadeThis
@PoppsMadeThis - 08.06.2023 08:23

could you drop a video about creating the hello triangle using different API's that can be changed at runtime ?

Ответить
@niki3352
@niki3352 - 07.06.2023 17:06

could you make a video about c++20 modules and your opinion on its usefulness?

Ответить
@harsh__dev
@harsh__dev - 07.06.2023 13:13

Cherno please make a course on C++ 😢

Ответить
@meem71
@meem71 - 06.06.2023 17:02

The worst part is when you are you trying to include header file, typing name of this file, intellisense shows it, but later intelli says "no", no this file doesnt exists

Ответить
@DarioCorno
@DarioCorno - 06.06.2023 14:22

Include errors are the nightmare of new C++ programmers. I remember banging my head on the table solving circular includes and compilation errors.

Ответить
@vorpal22
@vorpal22 - 06.06.2023 14:20

...or you could just use CLion, where it doesn't do this silly deceptive filter thing and actually mirrors the structure of your filesystem in the project. CLion is the only C++ IDE that I've not only found tolerable, but actually pleasant to use.

Ответить
@diconicabastion5790
@diconicabastion5790 - 06.06.2023 11:26

I never have these issue with headers. I honestly don't get how people do.
With C++ you the programmer are supposed to know what you are doing.
Could we make tools to include lots more stuff. Sure and it would either increase compile time at linking mostly or it would result in programs being bloated with more code that isn't used.
I don't like either of those options.
That said it would be easy to have the IDE search for that or give it a directory to look for those in. There are IDEs that do that code blocks allows you to do it for example.
You can set such paths in your make files.
It really isn't an issue with the language so much as either the tools you are using or lack of knowledge of that tool. Apparently you can set library paths in visual studio as well.
You can set them up as a default. If you don't use them the compiler will just not include them at link time.
Then you don't have to worry about it. You won't need to set it up every project you make and it will automatically be found.

Ответить
@Byynx
@Byynx - 06.06.2023 11:14

First time i see someone explaining clearly the difference between "" and <> weather on videos or forums. Who are you man ?

Ответить
@Maicowerk
@Maicowerk - 06.06.2023 05:55

You can fix all errors in C++ by rewriting it in a real language like C

Ответить
@miguelandresa.m106
@miguelandresa.m106 - 06.06.2023 05:32

Necesitaba este video hace 1 año y pico

Ответить
@guilherme5094
@guilherme5094 - 06.06.2023 03:46

👍Thanks.

Ответить
@lake5044
@lake5044 - 05.06.2023 22:43

Would it be so hard for Visual Studio to just scan all the files in my project and suggest the correct path like it already does for so many other languages? I think issues like these are IDE issues, not really language issues, but they frustrate people so much that they just switch languages instead for better IDE support.

Ответить
@xeridea
@xeridea - 05.06.2023 21:52

Why not just add Headers to your include directories?

Ответить
@AhmedAli-oe4oh
@AhmedAli-oe4oh - 05.06.2023 21:17

did you like windows 11, or you are ashamed of yourself?

Ответить
@oleksijm
@oleksijm - 05.06.2023 21:11

AFAIK, you can always also just list the full path every time.

Ответить
@nexby323
@nexby323 - 05.06.2023 20:53

Thank you, me too strugle a lot with file not found and because of this reason i stoped multiple projects including your open gl series

Ответить
@Coding-to4zj
@Coding-to4zj - 05.06.2023 20:17

so you just moved it there and moved it back and you call it a logical fix?

Ответить
@martinchekurov5726
@martinchekurov5726 - 05.06.2023 20:05

Including a header file by it's path is not a practical solution. If you change the location of the header file you need to change how it is included in all places. The practical solution is to let the compiler know where to search for the header files with the -I option.

Ответить
@SergeyBerengard
@SergeyBerengard - 05.06.2023 19:59

Have you ever had a linking error in release but not in debug, where it can't find a library in release, but in debug it compiles just fine?
What if the library it can't find in release is <vector>?? I compared all the setting in VS2019 between release and debug and the libraries are the same.
No idea where to look to figure this out

Ответить
@lykuan8053
@lykuan8053 - 05.06.2023 19:28

Is there anyone knows what theme Cherno uses is?

Ответить
@5cover
@5cover - 05.06.2023 19:13

Which directory separator to use? Slash or antislash? Does it depend on your operating system?
Because if that's the case, it means that if you send some code you wrote on windows (which uses backslashes) to a friend who uses a different os, he may not be able to compile your code.

Ответить
@sundarrajn1003
@sundarrajn1003 - 05.06.2023 19:08

Need design patterns series in cpp. That would be awesome.

Ответить
@adrianocana2112
@adrianocana2112 - 05.06.2023 18:52

This doesn't happen in JDSL, because Tom is a genius

Ответить
@simonmaracine4721
@simonmaracine4721 - 05.06.2023 18:33

I thought you were going to talk about cyclic includes and dependency management with headers in C++. :)

Ответить
@xankersmith9194
@xankersmith9194 - 05.06.2023 18:23

It took me forever to learn how the C pre-processor & build system works because hardly anyone covers them in detail in tutorials and you don't know that's the problem when you're a beginner. Every tutorial on C/C++ uses IDEs that hide these details (and generally don't circle back) which is fine if you're speed-running hello world, but not if you're trying to learn how to include other people's code you find online.

Ответить
@spicygaming9528
@spicygaming9528 - 05.06.2023 18:03

U are the best

Ответить