#issues with header files I created

26 messages · Page 1 of 1 (latest)

iron viper
#

-I am using visual studio.

-In some cpp files the header files I created and included in my own code are

-able to be opened and work well. I tested these files too.
-The problem file im having is where the main function is. It glues the other
files together and acts as the driver code. I receive an error saying "cannot open source file" when trying to compile the code

bitter crowBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.

iron viper
#

I have 2 cpp files that include their respective header files. and a third file that includes their .h files

#

at the top of these header files "#pragma once" is written

#

they are all in the same directory

uncut crater
#

-Can you post the error message?
-Did you make sure you didn't typo the file name?

iron viper
#

Ill throw my pieces of code into a paste bin

#

headers

iron viper
uncut crater
#

I'm not sure posting the code is relevant. It seems to be an issue with your project setup.

#

What is the error message you got?

iron viper
#
Build started...
1>------ Build started: Project: ConsoleApplication2, Configuration: Debug x64 ------
1>Application.cpp
1>C:\Program Files\Microsoft Visual Studio\2022\Community\VC\Tools\MSVC\14.37.32822\include\format(43): warning STL4038: The contents of <format> are available only with C++20 or later.
1>C:\Users\Darka\source\repos\ConsoleApplication2\ConsoleApplication2\Application.cpp(9,10): fatal  error C1083: Cannot open include file: 'Database.h': No such file or directory
1>Done building project "ConsoleApplication2.vcxproj" -- FAILED.
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
========== Build started at 22:25 and took 02.782 seconds ==========
uncut crater
#

See if you maybe confused the folder by rightclicking on the file tab and selecting "Open Location" or similar.

#

Try Ctrl+Click on #include Database.h. The IDE is then supposed to open said file. Maybe the IDE finds the file that the build system failed to find.

#

Double-check that C:\Users\Darka\source\repos\ConsoleApplication2\ConsoleApplication2\Database.h exists and isn't misspelled.

#

Finally try rightclicking your solution -> clean, then rightclicking your solution -> rescan solution, then build it again.

iron viper
#

alright, thank you c:

#

the project configuration must be messed up for sure

#

!solved