qc20.0 cannot open the file in console output
-
Hi, I think the FILE macro is not the best way to find your main.cpp file since it usually skips giving you the full path to the file. For the MSVC compiler you can try the /FC compile switch
-
Hi, I think the FILE macro is not the best way to find your main.cpp file since it usually skips giving you the full path to the file. For the MSVC compiler you can try the /FC compile switch
@hskoglund but qc18 is ok, qc20 cannot open the same FILE MACRO
-
in https://learn.microsoft.com/en-us/cpp/build/reference/fc-full-path-of-source-code-file-in-diagnostics?view=msvc-170
it says:
In Visual Studio 2017 and earlier versions, /FC outputs full paths in lower case. Starting in Visual Studio 2019, /FC uses the same casing as the file system for full paths.it's because the upper case?
-
I think Qt Creator 20 works just fine with VS2022, the behavior you're seeing with the FILE macro is a bit of lottery (50/50 chance of success). To even out the odds:
try open just 1 app in Qt Creator (not 2) and bulld in release mode (not a mix of debug and release). -
@QtTester
After you have tried @hskoglund's suggestions.Forget for now about
__FILE__, it's not relevant in itself. By the time you click on a string in the Output window the fact that it came from a macro in C++ has no effect. You say there is a change in behaviour. You sayfile://..\main.cppused to work. For now just output a literal string for whatever the absolute path of a file is. See whether that works. If it does not the problem is in clicking any link. If that works, figure out what relative path (if any) works. If that has changed then maybe QtC 20 is sitting in a different directory from before. Whatever you will know where the difference comes from. -
I agree that
..\main.cpplooks a little suspicious. The question is, what is your directory structure? Where is your compiled executable located? And what is the working directory when executing the program? The two have to be the same for this to work. -
I agree that
..\main.cpplooks a little suspicious. The question is, what is your directory structure? Where is your compiled executable located? And what is the working directory when executing the program? The two have to be the same for this to work.@SimonSchroeder
The question is why the change in behaviour:but qc18 is ok, qc20 cannot open the same FILE MACRO
Your statements are true, but why does behaviour apparently differ from Creator 18 to 20?

