So I've written code in OpenCV which contains 2 header files using Code::Blocks. When I compile the files, there are no errors except two "undefined reference..." errors which occur because I have used functions that I have declared in the header files. I assumed that code blocks automatically linked the header files? I have used the "#include.." to include the header files at the top of the programs so not sure what the problem could be. Anyone have any idea? Thanks.
I was having a similar problem, but happened upon a solution
Click the "Project" tab, it's in the top right side.
Within the "Project" tab click the "Add Files..." option.
Highlight your Header file and any other files associated with your header file, like if you put your header files definitions in a .cpp file.
Compile and Run.
Hopefully this helps, it worked for me but our issues could be different.
Related
The other answers i've seen proved to be ineffective.
I'm using c++ and it gives me error(red squiggle) when i include vector or string.
It tells me that my include path is not updated so i click on the lightbulb and try to edit intellisense configurations.
In this window there's an include path section, inside the box there's this string: ${workspaceFolder}/**.
So is this string the problem?
I've tried to put in this box the following path as well:
/usr/local/include but it doesn't change anything...
Please what should i change about this include path??
What is there supposed to be in it?
Press Ctrl+Shift+P to open the Command Palette
Start typing "C/C++" and then choose Edit Configurations (UI) from the list of suggestions. This opens the C/C++ Configurations page. When you make changes here, VS Code writes them to a file called c_cpp_properties.json in the .vscode folder.
Find the Compiler path setting. VS Code will attempt to populate it with a default compiler based on what it finds on your system. For Clang on macOS, the path should look like this: /usr/bin/clang.
The Compiler path setting is the most important setting in your configuration. The extension uses it to infer the path to the C++ standard library header files. When the extension knows where to find those files, it can provide lots of useful information to you as you write code.
Set IntelliSense mode to ${default}, which on macOS is clang-x64.
You only need to modify the Include path setting if your program includes header files that are not in your workspace or in the standard library path.
On macOS, you must set the macFrameworkPath to point to the system header files.
Visual Studio code places these settings in .vscode/c_cpp_properties.json.
Original documentation here!
I've been struggling with this for a couple of hours and then I just fixed that.
Problem is, when I was creating another .cpp file I misspelled the extension with .cp and then I immediately changed that file back to .cpp with Visual Studio's rename file feature.
The linking just stopped working after that. It was saying to me that i have unresolved external. My .h file couldn't be linked with that .cpp file which I renamed from .cp.
Somehow, when I created the file with a wrong extension, VS remembered that and even after renaming that file back to the correct extension, it still didn't recognize it.
I fixed my problem by just creating a new .cpp file (this time without an error), and everything just started working.
Has anyone experienced that before? Someone probably knows but I have not found anything related to this problem yet.
If you acidentaly typed wrong extension when creating C++ file then to make VS treat it as C++ file you should right click on the file item in Solution Explorer, open Properties dialog and change Item type on General tab from does not participate in build to C++ compiler (or to C++ header if it suppose to be a header file).
3 days ago I sent a letter in support, but the answer was never received. I have such a problem. There are several partial sass files that are imported into the main file. In 3 files, the option "Imported file" is in the options, and the main file is automatically compiled when changing in one of the imported files. In the options of a single file, I clicked the "Compile aniway" checkbox and the settings for the usual sass file were opened. But at the same time, the automatic compilation of the main file ceased to work when this partial file was modified. If I make changes, where the options are "Imported files", the autocompilation of the main file works successfully. I would like to clarify how I can return the "Imported file" option for the file that is not being tracked now by FileWatcher? Thank you.
I was having the same problem. I noticed that prepros is case sensitive to detect imported files, although it's case insensitive for compilation. So in main file, if a partial file is imported with incorrect case (in my case first letter was in capital instead of lower case), the file will compile, but partial file is not detected as imported.
For me, this happened when my import statements did not include the underscore. This would not trigger a recompile :
#import "./scss/variables";
should be :
#import "./scss/_variables";
Ok so some how 2 of my classes had ended up in a weird directory
projectname>projectname.xcodeproj>
In my infinite wisdom I tried to transfer these to the proper directory were the rest of my classes are (projectname directory)
However now I cant compile due to it not being able to find certain files
what file can I edit to check to see where it's looking for these files?
UPDATE 1
in response to the first answer I have tried readding the files. which has netted me some different errors. Specifically that Cameleon-Prefix.pch, no matter how many times I re add it always shows red.
A quick fix for this is to delete the files from Xcode, but in the confirmation dialog, choose to just release the references. Then add the files again (from the File menu Add Files… item).
If you want to see where Xcode expects to find the files, choose the file in the navigator pane on the left, and set up the right hand pane with this configuration.
And from there you can click on the detail disclosure buttons to see even more.
Edited to add
Make sure this is the same file pointed to in your build settings:
Do a similar search for pch to make sure the same thing goes with the pch file
Is anyone aware of a way to make visual studio completely ignore a file when compiling? I have a C# solution that has a foo.config file that isn't really a standard config file - it's just a text file. During compiling VS grabs a hold of the file and bombs.
I'd like for it to act as though it's just a text file. I do not have the option of changing the name of the file.
EDIT: Please note that BuildAction does not exclude files from the compiler checking them. It simply decides if the file is compiled into the assembly, whether it's content (like a jpg or something), or whether it is a resource file. For more info: see the MSDN page.
EDIT2: Apparently, if you have a text file that is named foo.config and you have it open while building, VS2005 will pop up an error thinking that the file should be xml. However, if you close the file, VS2005 will ignore it.
Solution: Visual Studio validation causes errors if you have a non-compliant file open during build time. For an example of how to turn this off (for HTML), see Scott Guthrie's post. As Allen mentioned, you should also have the Build Action turned to "None". Unfortunately, this will not stop build errors if you have the file open.
right click > properties
Build Action: set to "None"
Edit: If you're talking about app.config, you really cant mess with the format of that, you need to put it in a different .config file.
I just double checked, VS.net doesnt care as long as its not app.config or web.config and the config file build action is set to "None", it will "error" if you have the file open but it will not cause the build to fail or keep it from building the assemblies.
Close the file and the errors will go away, similar to the errors you get about HTML markup. The displaying of these "errors" is probably a configurable setting in vs.net
The action to take depends on the solution and and file type. For instance (in VS2005), in a C++ solution I can right click on the source file name in the solution explorer and view its properties. The first "General" option is "Excluded From Build", which will allow you to exclude the file from the build process without having it excluded from the project altogether.
I pulled up a .config file in a C# solution, and found a "Build Action" option under the Advanced section. That should probably be set to "None".
Just right click on the file and choose "Exclude from project".
If you still want to see it in your project, select the project and click the "Show all files" button at the top of the solution explorer. This will show all the files in the directory tree even if they aren't actually part of the project.
Are you sure that VS compiling .config file???
You should check it's Build Action in file options and may be set it to none.