How to get configuration.h from configuration.h.in in OpenSSL? - c++

I am working with the OpenSSL library for C++. I used this library in another project and it worked great. I carried it over to another project today and I'm having issues.
Two of the header files are .h.in files: opensslv.h.in and configuration.h.in.
In the first project, this was not an issue. But in my new project it gives me an error on this line
#include <openssl/configuration.h>
because configuration.h cannot be found:
...\include\openssl\opensslconf.h(14): fatal error C1083: Cannot open include file: 'openssl/configuration.h': No such file or directory
I understand there is no literal configuration.h file but from what I understand that configuration.h.in file should generate a configuration.h file right?
Does anybody have any idea why that might be happening? Maybe I changed something in the project properties?

.h.in is a template for a header file.
.in suffix looks similar to autotools template files, but according to their FAQ, OpenSSL uses their own build system based on Perl.
Anyway, you should call one of the Configure scripts, and build after that. Docs.

I'm unable to comment, but you need to provide more information about your directory structure. What do you mean by "carried it over"? This most likely sounds like it's happening due to something pointing to the wrong directory. What environment are you working in?
First thing I would do is double check that your project environment is looking in the correct directory for include files.
I also just found this answer that may be helpful to you as well: https://stackoverflow.com/a/31322172/2494727

Related

Adding libtomcrypt and libtommath to my c++ project

I am a C# developer, and spoiled rotten when it comes to references and dependencies. I am working on a small project now in Visual C++ (Visuial Studio 2017), where I want to use the libtomcrypt and libtommath libraries. I've created a small project and added the 2 projects to my solution:
I have also added my includes:
And I added the dependencies:
However, I still can't build:
Error C1083 Cannot open include file: 'tomcrypt.h': No such file or directory
I am not sure what else I need to do to get the references working and the code to compile. Any pointers is appreciated!
The error message indicates that the compiler can't find the file tomcrypt.h while compiling one of your source files. From the message I would guess that you have a line like the following in your source file:
#include <tomcrypt.h>
(...or perhaps with quotes instead of brackets.) From your screenshot I can see that you've added "...\repos\libtomcrypt-develop\src\headers" to your include path. Is the file tomcrypt.h found directly in that folder, or is it perhaps in a subfolder instead?
Your #include directive will basically append whatever path you give it to each entry in your include path when looking for the file, so if there are subfolders in between, you'll have to expand your #include directive to include those folders.
If this doesn't solve your problem, perhaps try posting the actual full path of where this header file exists on your filesystem, as well as your complete include path value! (The full compiler command from the build log would be useful, as well as the complete error message(s) related to this source file.)
Edit:
The original poster posted a separate answer indicating that the actual problem was that the Visual Studio Project Properties were set correctly, but that he was accidentally trying to build a different Configuration. :(
I was building the project under x86. Once I changed it to x64, it built just fine.

vtkRenderingSceneGraphModule.h missing

I am getting the following error when trying to use
#include <vtkViewNode.h>
in my code. I didn't do anything else besides this. I am getting the following error message:
.../VTK-8.0.1/Rendering/SceneGraph/vtkViewNode.h:29:62: fatal error:vtkRenderingSceneGraphModule.h: No such file or directory
compilation terminated.
Everything else i tried so far is working like cylinders or parametric splines. I might be mistaken but if i try searching for "RenderingSceneGraph" on fossies.org there's no match. So to me it seems like it's not part of the VTK 8.0.1 in the first place.
It's needed for several classes according to their documentation. It's strange though since you can't access any information about it.
Any ideas?
Somebody had basically the same problem just the other day: Error C1083 Cannot open include file: 'vtkGUISupportQtOpenGLModule.h': No such file or directory
vtk****Module.h are files generated by CMake when you are configuring the project, that's why you can't find them in a file search of the source code. You have to enable them explicitly, they are among the "advanced" items in the CMake configuration list, then they will be created as you do CMake -> Generate.
It's not clear to me from your comments above whether you are building VTK on your own or if you are using some kind of precompiled package, but in the latter case, I am affraid your package might not be compiled with the vtkRenderingSceneGraph Module and you will have to compile it on your own. Luckily it's not a big problem, you can get some pointers here https://www.vtk.org/Wiki/VTK/Configure_and_Build but in general it's pretty smooth when you use CMake.

I am trying to compile in xcode an open source game called supertux but I keep getting file not found errors

The src file is broken down into different libraries and inside each one is the xxx.c and its xxx.h counterpart. In almost all of my classes I get file not found errors on the first import statement for the .h file. I deleted the "library/" and it removes the error. I was wondering if there is an easier way to to this other than going through each of the 1000 classes and doing this for each of the import statements. I have already included sdl framework in the "Link binaries with Libraries". Please help im lost.
Try using the USER_HEADER_SEARCH_PATHS for paths you want searched for #include "..." You can find this option in Build Settings of Target.
You can specify path like this: $(SRCROOT)/Subfolder/subfolder

Xcode - header files issue with .cpp file

I have imported my project from windows to mac and Is using xcode to compile the project.
I have managed to fix most error and bugs from the porting process but there is one bug/error I am unable to determine why its not working as it should. This probably due to my lack of knowledge of xcode but was wondering if anyone is able to help me with this problem.
The problem is this;
I have a two sub folders in my project, once called include and another called source. Of course include contains all the header files and source contains all the cpp files and such.
Example:
Root/
Include/
Header.h
Source/
test.cpp
Now in the build settings in the xcode project, I have added $(SRCROOT)/Include/ in the Header Serach Paths. So therefore I presume that xcode will include any header files in the Include folder.
So in the test.cpp class I add #include "Header.h". When I click build I get an error saying "'Header.h' file not found".
Im not entirely sure what I am doing wrong, of course I can do this for example - #include "../Include/Header.h" but that's going to be a pain going through all the cpp files in my project (which is a lot).
I was just wondering if anyone else came across this problem?
Thanks for reading.
In general you need to add the headers to the User Header Search Paths, which if you search the help in XCode will give you the format you need to pass the directory as.

How to link and use OpenCV headers?

Right, I know this is a very stupid question, but I have no luck with w/e i'm trying to do.
I'm trying to use the objdetect.hpp header file, so I've included the folder C:\OpenCV2.1\include\opencv2\ aswell as C:\OpenCV2.1\include\opencv and a whole bunch of other libraries and dlls when I was following the instructions on http://opencv.willowgarage.com/wiki/VisualC%2B%2B_VS2010
But the openCV version in that tutorial were outdated and doesn't even have the objdetect.hpp file. So I went to download the latest one (OpenCV 2.4.0), but now when I complie it, it gives me an error C1083: Cannot open include file: "opencv2/core/core.hpp" No such file directory.
Am I suppost to put all the OpenCV folders/files in the same directory as my C++ project? Or how do I fix it? I've tried putting it in the same place as my C++ project, but when I do a #include "../" the folder doesn't appear.
Again, I know this is a stupid question, but please help.
Let me know if anyone require more info coz I'm not too sure whatelse to put.
Thanks
The best way to manage changing directories for include files is with the compiler options. Im better at linux and g++, where you would just specify different include path locations with -I attributes.
Its generally considered bad practice to use relative and absolute paths in the #include statements. Module paths are ok #include <sys/time.h>, where sys could be considered the module. Include the file with just its name and possibly the module, then handle the location with the compiler options.