I have a big problem with building a simple program. I am using many tutorials, instructions and I can't solve it. I edit the variable's path as follows:
C/C++->General->Additionals Include
Directories->MyOpenCv\build\include Linker->General->Additionals
Library Directories->MyOpenCv\build\x86\vc11\lib
Linker->Input->Additional Dependencies->*I added .libs
The same in Debug and Release.Windows 8 x64, VS2012 x32, OpenCV 2.4.5
Go to C/C++ -> Output Files and check Object File Name. Chances are it contains a bogus macro reference.
For C/C++, I have found for Visual Studio the location listed below is NOT the correct way to reference library files during linking the compiler-linking stage (at least in Community Version 2017). I had a project folder called 'lib' which contained all my .lib files. Originally I had specified a value like
Linker --> General --> Additional Library Directories: $(ProjectDir)lib;%(AdditionalDependencies)
I was getting error messages like:
error LNK1104: cannot open file 'lib.obj'
I figured out this was the correct way to specify the library directories:
VC++ Directories --> Library Directories
In my case, my value was:
VC++ Directories --> Library Directories: $(ProjectDir)lib;$(LibraryPath)
Related
I'm developing F# projects (fsproj) in Visual Studio 2022.
I intermittently get a compile error
>------ Build started: Project: MyProject, Configuration: Debug Any CPU ------
>C:\Program Files\dotnet\sdk\6.0.302\Sdks\Microsoft.NET.Sdk.Razor\targets\Microsoft.NET.Sdk.Razor.MvcApplicationPartsDiscovery.targets(54,5): warning RAZORSDK1007: Reference assembly C:\Users\Diana\repository\library\bin\Debug\net6.0\library.dll could not be found. This is typically caused by build errors in referenced projects.
5>FSC : error FS0078: Unable to find the file 'C:\Users\Diana\repository\library\bin\Debug\net6.0\library.dll' in any of C:\Program Files\dotnet\packs\Microsoft.NETCore.App.Ref\6.0.7\ref\net6.0 C:\Users\repository\project\src\MyProject\MyProject C:\Program Files\dotnet\sdk\6.0.302\FSharp\
The library is indeed not present in any of the searched locations. This suggests that I have something in my fsproj files misconfigured.
How do I ensure that library.dll is copied to the bin directory of MyProject?
Note for completeness: library.dll is not a NuGet package, it is a dll that is built from a local .csproj file that is part of the Solution (.sln)
Edit: CopyLocal is set to true for all Project References
I am using Vim's YouCompleteMe C semantic completer installed with the --clang-completer flag. It complains that it can not find the 'omp.h' file used in the Eigen/Core library file. Error message is as follows:
In included file: 'omp.h' file not found /usr/include/eigen3/Eigen/Core:247:10: note: error occurred here [pp_file_not_found]
The code compiles and runs perfect, so that's why I know it is not a real issue and something wrong with YouCompleteMe. I have tried using both clang and clangd, it does not matter, same issue.
If I simply remove the -fopenmp from the compile_command.json file, it fixes the issue.
Thanks in advance.
The pre-built clangs from llvm.org don't include openmp. YCM includes a copy of the clang resource dir from the pre-built llvm.org packages, therefore 'omp.h' (which is part of the resource dir) is not found.
If you need to use openmp, then i suggest you set g:ycm_clangd_binary_path to point to a clangd that is installed alongside your llvm toolchain containing openmp.
I am creating a QNX port for a Linux application. As a test, i copied all source code and header files into /src/ directrory and built the code. the binary was created, and I was able to execute on target VM. but now I have to create the momentics project inside the project folder, without altering or creating duplicate copies of existing source files.
I found that I can use linked resources. So I followed steps provided here and could add the file to project.
but when I compile the project, it is not taking the linked files.
As one can clearly see the process is directly going to linking stage.
but if I add a new cpp file without linking, only that particular file is getting compiled, not the linked file.
only the new main.cpp is getting compiled.
Can anyone help me to get this project built, only using linked resources?
I was able to use IDE for compiling my writing a Makefile and importing it to IDE.
I'm struggling to find the include files that should be in a directory names "opencv2"! I've downloaded OpenCV-2.4.0.tar.bz2 from here and extracted the files and ran cmake, which seemed to build the library successfully.
The problem is that under the "include" directory for "opencv2" there seem to be tons of header files missing. The only header file there at the moment is "opencv.hpp", which includes a whole set of other files which aren't there. Does anyone have any idea where I can get these files from?
Thanks!
The header files of the modules are in their own directories. E.g., you can find calib3d.hpp in /modules/calib3d/include/opencv2/calib3d. The Makefile created by CMake knows these addresses, hence when you make install the header files are all copied into /usr/local/include/opencv2.
In case you were using cmake-gui and visual studio on Windows to make opencv (I had 3.4.0), don't forget to build this project:
This will generate all required files in a single folder, so you can easily connect header files:
I am using OpenCV 2.3.1 with C++ on NetBeans 7.1 on Ubuntu 11.04 (Gnome). When I add the call
cvCreateSubdivDelaunay2D
and try to run the program in Debug mode I get the error message
/home/peter/NetBeansProjects/ArtifactImgFromCellFile/dist/Debug/GNU-Linux-x86/artifactimgfromcellfile: error while loading shared libraries: libopencv_calib3d.so.2.3: cannot open shared object file: No such file or directory
This despite the fact that I have libopencv_calib3d.so.2.3 in
/home/peter/OpenCV-2.3.1/lib
On NetBeans I went to
Properties:Linker:Run Time Search Directories
and added
/home/peter/OpenCV-2.3.1/lib
but that did not fix the problem.
Any assistance would be greatly appreciated,
Peter
In Netbeans you explicitly also need to link the library as follows.
Right click the project and open properties.
Go to Build -> Linker
Go to Libraries -> Add library file.
Browse to where your library is, i.e. the .so file. In your case it should be at /home/peter/OpenCV-2.3.1/lib/libopencv_calib3d.so