Compiler error on including a file that it is there - c++

I'm having an issue trying to make Assimp work in an engine I'm doing. I'm trying to add it as a submodule and build it with premake, and I managed to properly include it as a project in the solution, but I'm having an error that I cannot understand.
The error is that some files in assimp are giving me a "cannot include file" error, which is weird because the file it is there, the next image shows it:
I checked the working directory of the project and it is in 'vendor/Assimp' (check the image), so it should be able to include the file. I'm assuming it must be something on the include directories, but I can't manage to find specifically what it is... Does somebody have any clue? Thanks!
The specific errors I'm having in this case is the next:
Error (active) E1696 cannot open source file "contrib/zip/src/zip.h" Assimp C:\Users\lucho.suaya\Documents\GitHub\Kaimos\KaimosEngine\vendor\Assimp\code\3MF\D3MFExporter.cpp 61
Severity Code Description Project File Line Suppression State
Error C1083 Cannot open include file: 'contrib/zip/src/zip.h': No such file or directory Assimp C:\Users\lucho.suaya\Documents\GitHub\Kaimos\KaimosEngine\vendor\Assimp\code\3MF\D3MFExporter.cpp 61
And the include directories I'm adding in the premake file of the Assimp project are the next ones:
includedirs
{
"include",
"code",
"code/Common",
"code/PostProcessing",
"code/AssetLib",
"contrib/irrXML",
"contrib/rapidjson/include",
"contrib/unzip"
}
Then I have another premake file for the engine project in which i wrote the next (regarding assimp):
IncludeDir["Assimp"] = "%{wks.location}/KaimosEngine/vendor/Assimp/include"
include "KaimosEngine/vendor/Assimp" -- Includes Assimp Premake File
includedirs { "%{IncludeDir.Assimp}" }
links { "Assimp" }

The issue was solved by including in the project many files I didn't include

Related

pugixml include dir set to not found from pugixml config cmake files

I am trying to compile this project: https://github.com/computationalpathologygroup/ASAP.git from source.
Pugixml is a dependency
I have built pugixml from source and set PugiXML_DIR and PUGIXML_INCLUDE_DIR And it still gives me error: "CMake Error: The following variables are used in this project, but they are set to NOTFOUND."
Things I have tried:
I am doing this on windows, using cmake 3.14 and visual studio 2017.
I have successfully built pugixml from source and included the .lib file as well
I have tried including and excluding combinations of PUGIXML_INCLUDE_DIR, PUGIXML_LIBRARY, PugiXML_DIR.
This is the error I get:
CMake Error: The following variables are used in this project, but they are set to NOTFOUND.
Please set them or make sure they are set and tested correctly in the CMake files:
cpp/ASAP/annotation/PUGIXML_INCLUDE_DIR
used as include directory in directory
/cpp/ASAP/annotation
cpp/ASAP/multiresolutionimageinterface/PUGIXML_INCLUDE_DIR
used as include directory in directory cpp/ASAP/multiresolutionimageinterface
Other information: setting PugiXML_DIR is mandatory, and the cmake looks for a file named "pugixml-config.cmake" in that directory. And the config cmake file is supposed to point to compiled lib file. But when it wasn't able to find, I simply copied the lib file I compiled to the location pugixml-config.cmake was pointing.
In ASAP versions before 4.04.2019 they play dirty games with extracting include directory from the IMPORTED target. annotation/CMakeLists.txt:30:
get_target_property(PUGIXML_INCLUDE_DIR pugixml INTERFACE_INCLUDE_DIRECTORIES)
In some cases this results in setting PUGIXML_INCLUDE_DIR variable to "-NOTFOUND", thus you got corresponded error message from CMake.
In commit 36d8bd75 they add FindPugiXML.cmake script, which handle find_package(PugiXML) call instead of configuration script shipped with PugiXML. In that find script they obtain include directory with find_path, which looks more natually:
find_path(PugiXML_INCLUDE_DIR pugixml.hpp)
Because in newer ASAP versions the configuration script (pugixml-config.cmake), shipped with PugiXML, is no longer used, one cannot hint about PugiXML location with PugiXML_DIR or PugiXML_ROOT. In case PugiXML is installed into non-system-default location, one may simply set PugiXML_INCLUDE_DIR variable to the PugiXML include directory.

C++ CMake Linking error: LNK1181: Cannot open input file "x.lib"

Despite to the fact that I am quite new to C++ I got this project to expose one old C++ library to Python for which I am using Pybind11 and CMake. The C++ library links against a file here called "problematic_old_library.lib". This .lib is living on a server drive. When binding the C++ code to Python a CMakeList.txt - file is needed including includes and links to required files. Since I have no experience of CMake I am quite sure that I am doing something wrong here.
Here is my CMakeList.txt file for reference (names of the files are changed):
cmake_minimum_required(VERSION 2.8.12)
project(some_project)
add_subdirectory(pybind11)
pybind11_add_module(some_project
src/main.cpp
src/mapping.cpp
)
link_directories(Z:/folder/subfolder/lib)
TARGET_LINK_LIBRARIES(some_project PUBLIC problematic_old_library)
Now, this CMakeList.txt is included in a folder named "some_project". Inside folder "some_project" are "CMakeList.txt" and folder named "src"( with the two files listed above).The file "mapping.cpp" uses the 3rd party library named "problematic_old_library. However, This produces 1 fatal error.
LINK: fatal error LNK1181: cannot open input file 'problematic_old_library.lib'
What is causing this?
I tried to search for help from the documentation. However, I find it very confusing to understand the ${something} notation when using CMake. What I would like to have is "hard coded" example of how to link against an old library preferably without the ${something} notation if possible.
///////////////
For further reference below is a appended version of my CMakeList.txt file that includes all the combinations for paths leading to this problematic "x.lib" file:
make_minimum_required(VERSION 2.8.12)
project(blpbind)
add_subdirectory(pybind11)
pybind11_add_module(blpbind src/main.cpp
src/mapping.cpp
)
# Cannot open
#link_directories("Z:\\blpapi_cpp\\lib")
# Cannot open
#link_directories("Z://blpapi_cpp//lib")
# Cannot open
#link_directories(Z:\\blpapi_cpp\\lib)
# Cannot open
#link_directories(Z://blpapi_cpp//lib)
# Cannot open
#link_directories(Z:/blpapi_cpp/lib)
# Cannot open
#link_directories(Z:/ILMAPI/lib/PROD/LATEST/src/alphalib/blpbind/src/lib)
# Cannot open
#link_directories("Z:/ILMAPI/lib/PROD/LATEST/src/alphalib/blpbind/src/lib")
# Cannot open
link_directories(Z://ILMAPI//lib//PROD//LATEST//src//alphalib//blpbind//src//lib)
# Cannot open
link_directories("Z://ILMAPI//lib//PROD//LATEST//src//alphalib//blpbind//src//lib")
TARGET_LINK_LIBRARIES(blpbind PUBLIC blpapi3_32)
I tried all the following and I confirm that I still receive exactly the same error in each case.
Br and thanks
It seems that the LNK1181 error appears when the file can't be found (https://msdn.microsoft.com/en-us/library/y6b12xkc.aspx)
Maybe your path contains spaces in it. When you use spaces, you have to escape them like with \
The path Z:/folder with space name/subfolder/lib
Should be like this:
Z:/folder\ with\ space\ name/subfolder/lib
In other side, it seems that you can use double \ to the folder like this:
"Z:\\folder with space name\\subfolder\\lib"
Try both to see results

V8 compiler errors

I recently managed to generate the visual studio project file for V8, but it doesn't compile
When I compile the All solution it spends maybe ~10 minutes compiling and then presents me with a bunch of error (at least in Release mode, 35 to be exact).
Example:
MSB6006 "cmd.exe" exited with code 1. js2c
C1083 Cannot open source file: '..\..\build\Release\obj\global_intermediate\experimental-libraries.cc': No such file or directory v8_nosnapshot
C1083 Cannot open source file: '..\..\build\Release\obj\global_intermediate\extras-libraries.cc': No such file or directory v8_nosnapshot
C1083 Cannot open source file: '..\..\build\Release\obj\global_intermediate\libraries.cc': No such file or directory v8_nosnapshot
C1083 Cannot open source file: '..\..\build\Release\obj\global_intermediate\experimental-extras-libraries.cc': No such file or directory v8_nosnapshot
Why isn't it compiling correctly?
The compiler can't find the directory v8_nosnapshot
What are your project settings? If you have access to this you might want to check that paths to your source and header files resolve correctly.
Else place the v8_nosnapshot directory and other source files needed for a successful compile where the compiler can find it
Right Click on the js2c project -> Properties, Under VC++ Directories -> Executable Directories, Check if the python and cygwin directories are set properly.
The python directory should exists under v8\third_party as shown below. If not, you can copy the python folder under depot_tools to v8\thrid_party\python_** and compile. You can also expand the macro and see what is the value for MSBuildProjectDirectory:
$(MSBuildProjectDirectory)\..\..\thrid_party\python_26

Incorporating a project with CMakeLists.txt into my main project

I have been given a C++ project, which has the following structure:
/main.cpp
/CMakeLists.cpp
/engine/engine.cpp
/engine/CMakeLists.txt
/utils/utils.cpp
/utils/CMakeLists.txt
In /utils/utils.cpp, there is the line #include <cuda_runtime.h>. Now, on my machine, this header file is located at /usr/local/cuda-7.0/targets/x86_64-linux/include. But if I print out cmake's include directories in all three of the above CMakeLists.txt, using:
get_property(dirs DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR} PROPERTY INCLUDE_DIRECTORIES)
foreach(dir ${dirs})
message(STATUS "include dir = '${dir}'")
endforeach()
then it just prints out the following: /usr/include, /usr/local/include, and /usr/local/cuda-7.0/include.
Despite this -- the code compiles. Why is this? How is cmake able to find this header file when it is not in the search directory for include files?
Now, I will explain the real reason I am asking this question. I want to use this code in another project of mine. So, I created a directory foo in my project, and added the contents from above. Then I added add_subdirectory(foo) to my main CMakeLists.txt file. I printed out the include directories, and got the same outputs as before. However, this time, it did not compile. It gave me the error message:
fatal error: cuda_runtime.h: No such file or directory
Can anybody explain to me why it might be that it is compiling in the original form, but not compiling when incorporate into my project?

Error while compiling in release mode

I'm building an IE extension (ATL) with VS2008 and somehow when I switch to release mode it gives me some linking error:
Error 2 fatal error C1083: Cannot open include file: 'ImplAddon.h': No such file or directory *************** 19 Engine
Error 3 fatal error LNK1181: cannot open input file '..\release addon\engine.lib' Addon Addon
I've tried to add to each of the projects in the "Additional include directories" in the project's properties the relevant path to 'ImplAddon.h' but nothing helps.
Any idea what to do??
Thanks a lot fellas :)
Right click each project and go to properties then top,left there is a drop-down to select the environmental. select all configurations there. then go to C++-> General -> Additional directories then add the paths of your header fails located at.