pdb file is not the pdb file that was used when this precompiled header was created, recreated the precompiled header - c++17

I am using JUCE to create an audio plugin, and on first build, I received several of the following error.
C2859 C:\Users\ksa10\Desktop\LUX\LUX\Builds\VisualStudio2022\x64\Debug\Shared Code\LUX.pdb is not the pdb file that was used when this precompiled header was created, recreate the precompiled header.
I believe this is an repetition error with improper conditional compilation in the files automatically created by JUCE, but I have not found any answers yet. If it helps, all of my header files start with #pragma once.
I am new to c++ and completely self-taught, so go easy on me.

Related

Excluded Source File Name causes pod header file not found

There is an Objective-c framework in the project, the framework does not support running on simulator. It's not good for developing, so I excluded the file in Build Settings --> Excluded Source File Name, but this causes errors xxxx.h file not found. in Bridge-Header.h.
I also tried to set Validate workspace = yes, again, the framework seemed to be excluded, but it causes the errors.
How can I exclude framework correctly? and why the errors above happens?
Thanks.
This cause errors because Xcode can't find the files in the framework!You should find out all the files that have referred to any file of the framework. After you find them out, you'd better disable the functions provided by the framework, and remove all the reference in all the files. The errors will disappear after you remove all the reference
Don't delete or mess up the code, you need them when running on a real device after all.

Xcode .pch error while compiling. clang file not found

I have a very annoying problem.
I backed up my code on Dropbox but now i get this error while compiling
clang: error: no such file or directory: '../firstFoo-Prefix.pch'
Since the only .pch file in my project in Xcode and my project folder is secondFoo-Prefix.pch and I don't know how to fix this error I've decided to remove every .pch file so i went into Project> Build Settings and removed everything in the Prefix Header and set Precompile Prefix Header to NO.
Before this the Prefix Header had value secondFoo-Prefix.pch and not firstFoo-Prefix.pch.
Even though the compiler should not look for .pch files I still get that error.
I've looked everywhere in my project but I can't seem to find anywhere firstFoo-Prefix.pch.
Any ideas?
Thank you
This can occur (not your fault) when the Xcode project file database gets messed up such that the referenced file does not appear in the navigation area but is still somehow included in one of the various list of files used for the build phases.
To see if this is the case:
In the Finder, right click on the project file and select 'Show Package Contents'
Right click on the file 'project.pbxproj' and 'Open With->TextEdit.app'
In TextEdit menu: 'Edit->Find->Find...' [or command-F] then enter '.pch'
Look at all occurrences of '.pch' [command -G to move to next one]
If you find occurrences of '../firstFoo-Prefix.pch' then your project file is corrupted. Looking at the context of the occurrence(s) will give you some indication of which area the corruption occurs in (e.g. build phase compile files list).
Sometimes just deleting those references (after having backed-up the project file of course) has worked for us but other times it just makes matters worse. The safest recovery is to create a new project file and copy over all the folder groups and settings manually. Your source code is all fine, it's just the cross-references and build settings that need reworking.
Do a clean for build using this combination: Shift+Option+Command+K
In my case, I have Framework which need to add to main project from derived data after it building successful. So copy items if needed was not tick marked and that's why giving error and also #ZAZ and #chiwangc mentioned cleaned it before building.

Should I specify any path to access the header files in Xcode?

I have the source code for a video decoder. The code was executed without any problem on the MAC terminal.
Now, I need to port it on iOS. The source code has around 20 source files and 40 header files. I have created a project in Xcode 4.2 and put all of these in the project folder, without creating separate folders for headers and source files. When I tried building, its giving errors since the source files are not able to access the needed header files.
Is there any path that I need to specify for the headers?
Please help. Thanks in advance!
What about :
Project Target
Build Settings
User Header Search Paths (set it to your header path)
Always Search User Paths (set it to YES)
*These steps should (normally) resolve any "header not found"-related issues.

Is it possible to Add .pch File in project?

I Download Project for learning purpose. But in this project i got error that is display in MY Screen Shot . i know that Prefix headers are compiled and stored in a cache, and then automatically included in every file during compilation. This can speed up compilation, and lets you include a file without adding an import statement to every file using it. They are not required, and actually slow compilation whenever you change them.
Screenshot
My Question is that is it possible in my case to add .pch file or not ??? if possible then please explain it.
Thanks in Advance.
The screenshot shows that you do not have the pch file added to the physical folder or it is removed somehow from there even though it is added to the project. You need to add that file again and build to remove this error. You can remove the reference from project before doing that and add it as a new file to this project once you have added it in your physical folder.
A red file name in project as shown in screenshot normally represents a missing file from the project folder structure.

Use the dump framework ?

I just want to know how can I use the dumped framework's header in my application. I dump my public framework with Erica Sadun's class dump API and it successfully released the header files for me on my specified directory but when I tried to use them by pasting those files in to the framework's header folder it is not recognized by the compiler and it throw a compile time error by no such directory. What are compiler setting I have to do to make them a family of header files in my project from a particular framework. Will the functions declared in the header files be recognised and provide me the functionality of work upon them?

Resources