Why VTK invoke cmake/vtkobjectfactory.h.ini - vtk

I am using VS2017 to compile VTK 8 Example, Cone.cxx, screen as attached. But I do not know how the error show vtkobjectfactory.h.in been invoked?enter image description here
I trace the program and find it initiated by Common/DataModel/vtkPolyData.h
But I can not understand how it worked. Can anyone help on this?

It can't find some include files. Judging by how your #includes are written, you haven't set path to the vtk include files - you have set correct paths for the few files you are including, but those files are including additional files and they are using relative path - for example, if you open your vtkCamera.h, which you are including, you will find it starts with lines like #include "vtkRenderingCoreModule.h", while in your environment, the "vtkRenderingCoreModule.h" is probably somewhere like "Rendering/Core/vtkRenderingCoreModule.h", so it can't find it. If you wanted to do it this way, you would have to change the paths also in all the files that are being included and that is just not reasonable.
A simple solution is to go to your project properties (right click in the solution explorer on your project name -> properties) -> C/C++ ->General: The first line should be "Additional Include Directories". There, you add a new line with path to the include folder of your vtk installation, probably something like "C:\program files\VTK 8.0\include\vtk-8.0\" - if you look in that folder you should find all the vtk's .h files in one place.
Then you can change your code by removing all the folder specifications from the #include paths and simply write #include vtkConeSource.h etc. and all files should be found without issues.

Related

Including files in VS 2012

I want to include a library - I've downloaded it and found exactly four files inside:
.h
.lib
.dll
.def
I've put the header file inside of my project. That's the only thing I did - and the visual throws an error that it cannot open the .lib file.
So I immediately wanted to beg for help on stackoverflow, but I've decided to do a little research first. I've found out that the .dll file should be placed inside of the windows/SYSWOW64 location (for my 64-bit windows 7), I placed it there but VS still displays the same error.
How should I deal with that? Did I missed some step during the "installation"? If so, which ones?
You have to specify the path to the library (*.lib) in your project settings.
(You can put it also into your directory with sources)
The presence of DLL file during build is not required.

How do you specify include directory path in F#?

I am using F# in Visual Studio 2012 and this may seem like a dumb question but I cannot figure out how to specify include directories, specifically for binaries. I see how to do it for F# interactive using the #I directive and it works there, but the #I option is not available in the non-interactive form. The compiler error message says to use the -I compiler option. I have looked under Project Properties, where the only subsections visible are Application, Build, Build Events, Debug, and Reference Paths none of which provides any obivous way to specify an include directory path. The help system isnt much help as it seems to reference sections that are unavailable.
Well i still have the problem with VS12 but at least i have a workaround, by calling the compiler from the command line. You have to use the -r option to specify the location of the dll:
fsc -r:<complete path to dll> <fname>
However when i try the corresponding step in VS (by trying to set one of the Reference Paths) it says there are no items found in the DLL folder. So perhaps someone familiar with CS can help out

Adding CORE PLOT HEADER to the XCODE PROJECT

I can't seem to make Xcode find the Core Plot header. I've done the following:
Clone the hg repo;
Drag the CorePlot-CocoaTouch.xcodeproj file into my project;
Opened the CP project and compiled it successfully;
Dragged the lib file into the target's static link list;
Added CorePlot-CocoaTouch as a direct dependency for the target.
But I'm still getting the "CorePlot-CocoaTouch.h: No such file or directory" error on compile. I've been googling around trying to find an answer, but only seem to find a few people having the same problem but no clear solution. What have I missed?
Please help me getting out of it.....
Thanks
Make sure your header search paths contain a reference to the core-plot source directory.
In your targets Build Settings set Header Search Paths to the core-plot/framework directory. For example when your core-plot directory is placed next to your project directoy the search path would contain a value of ../core-plot/framework/** (I'm using a recursive reference here, thus the ** at the end).
Do not miss :-
1-Do not forget to add the library to Target dependance under the "Targets" source list that appears. Click on the "Build Phases" tab and expand the "Target Dependencies" group. Click on the plus button, select the CorePlot-CocoaTouch library, and click Add. This should ensure that the Core Plot library will be built with your application.
2- Core Plot is built as a static library for iPhone, so you'll need to drag the libCorePlot-CocoaTouch.a static library from under the CorePlot-CocoaTouch.xcodeproj group to the "Link Binaries With Libraries" group within the application target's "Build Phases" group you were just in.
3 Under your Build settings, set the Header Search Paths to the relative path from your application to the framework/ subdirectory within the Core Plot source tree. Make sure to make this header search path recursive. You need to add -ObjC to Other Linker Flags as well (as of Xcode 4.2, -all_load does not seem to be needed, but it may be required for older Xcode versions). -Header Search Paths : you must put the relative path for libCorePlot-CocoaTouch.a and it is too much important to check the recursive check-box.
Finally the following link may can help you...
http://code.google.com/p/core-plot/wiki/UsingCorePlotInApplications
maybe this blog might help more than the google source page of CorePlot.
For newbies it might be helpful to use the mac shell to get the relative path of the libCorePlot-CocoaTouch.a. Just open the Terminal and insert following line:
mdfind -name libCorePlot-CocoaTouch.a
you will get listed all paths that contain the file named "libCorePlot-CocoaTouch.a"

Visual C++ Include File not found

I have a project, and I added all the source files to it. I then clicked build, and it said:
fatal error C1083: Cannot open include file: 'common.h': No such file or directory
1> crc64_tablegen.c
This is rather annoying, because common.h is in my project! It's right there! I think it might be in a different directory though. Is the the reason? Should I move everything to a root directory, then add that instead? Thanx!
Where files are in the project structure makes no difference to the compiler when it is attempting to open include files. If they are in a different directory, you will need to path them appropriately.
That is, if you have this directory structure:
project/include/common.h
project/src/main.cpp
And you have this in your project:
Project
|-> common.h
|-> main.cpp
Your main file will need to do this:
#include "../include/common.h"
And not this:
#include "common.h"
You may, alternatively, define project/include as an Additional Include Directory in your project settings. This will allow you do use the second include form shown above.
Compiler doesn't know anything about project and files included in it. If .h file is in another directory, you need to add this directory to the list. For example, open Project - Properties - C++ - General - Additional Include Directories, and add $(ProjectDir)Include or something like this.
In VC++, the location of files within the project is virtual and has no link whatsoever to the actual filepaths. You may have to be more specific with #include and/or move the source files into the project directory to be found.
Try and add the path in the project settings under Additional Include Directories.
Here are the full set of steps:
Drop down the Tools menu, and select Options
In the box on the left is a list of option categories. Select "Projects and Solutions" and then the sub-category "VC++ Directories"
In the upper right hand corner is a drop-down box that selects a particular set of default directories, including "Executable files", "Include files", "Reference files", "Library files", and "Source files". Generally, you only want to add to the "Include files" or "Library files" lists. Select "Include files"
In the middle of the right hand side of the window is a list of directories. Add the include path by pressing the "New Line" button above the window, or by pressing "Ctrl-Insert". A blank entry appears for you to either type the path or navigate by clicking the "..." button. Generally the final path you want will end with a folder called "include". Enter the path now.
You're done, click OK
If you have added a .h file to an existing project and are getting the error message C1083: cannot open include file. Make sure you have it added properly to the program.
If you have #include it might not work.
Try entering #include "course.h" instead.
I have been working this problem with my project for several hours and have just now realized this error. You can also add the directory in the project properties to have it work, but when you send it to someone else to view it, they might receive the same error.
I just had the same problem in Visual Studio 2017, and found what was causing it. There is a difference between the following two includes:
#include "common.h" // Quoted form
#include <common.h> // Angle-bracket form
First include can uses the file that contains the #include to find the included header file.
Second include ignores the file that contains the #include, so if you don't have the directory of header file in Additional Include Directories it will not be found, ALTHOUGH the IntelliSense will happily jump to the header file (Ctrl+Shift+G) as if it was included like in the first case.
So, either change the #include or add the directory to Additional Include Directories.
More info at Microsoft Docs.

fatal error C1083: Cannot open include file

I looked at previous post based on this but they do not relate. I am receiving the following error.
1>c:\users\numerical25\desktop\intro todirectx\introtodirectx\chapter 4\init direct3d\init direct3d.cpp(9) : fatal error C1083: Cannot open include file: 'd3dApp.h': No such file or directory
But clearly from the image shown below, its there
In oppose to other people who are having issues finding the header on the physical drive. the compiler can not find my header from within the solution explorer.
What you see in the left pane of the IDE has absolutely nothing to do with whether the file is there or not there. "Solution Explorer" does not explore the actual files present in the file system, it simply shows you which files are registered as parts of this solution.
In order for the code to compile, the file must be present in the file system of your computer in one of the paths that the specified as search paths for header files of this solution. It is not present, hence the error.
Make sure the directory the header is in is included in the project's settings (C/C++ → General → Additional Include Directories).
Solution view and file view sometimes have no relationship; each file you add to the solution view is an entry in an xml file. The #include directive usually looks at the physical drive location, after looking through include paths.
My suggestion is to add the direct3d.h include path to the project's settings. That's the recommend way as it makes upgrading to newer versions of the SDK painless (and it's a good practise for any external libraries).

Resources