include

Combining C++ header files

℡╲_俬逩灬. 提交于 2020-08-06 08:12:27
问题 Is there an automated way to take a large amount of C++ header files and combine them in a single one? This operation must, of course, concatenate the files in the right order so that no types, etc. are defined before they are used in upcoming classes and functions. Basically, I'm looking for something that allows me to distribute my library in two files ( libfoo.h, libfoo.a ), instead of the current bunch of include files + the binary library. 回答1: As your comment says: .. I want to make it

Trouble installing CudaSift

流过昼夜 提交于 2020-08-06 04:46:06
问题 I just moved to C++ from Python. I'm using VSCode and I'd like to use the following library: https://github.com/Celebrandil/CudaSift . So I clone the repo, make a build folder inside, cd to the build folder, use: cmake .. then sudo make and finally sudo make install I get the following output in console: After completing these steps, I get a shared library file called 'cudasift'. From what I understand, I must then compile my code, which is the following: #include <iostream> #include <opencv4

compile protobuf client code on ubuntu, but include file is not found

浪子不回头ぞ 提交于 2020-07-21 11:39:33
问题 I just installed google protocol buffer on my ubuntu1604: sudo apt install protobuf-compiler And tried a quick test, 1 proto file, 1 cpp file to use it, try to see the encode/decode results: $ cat 1.proto package x; message my{ required string name=1; required int32 id=2; optional string email=3; } $ cat 1.cpp #include"1.pb.cc" #include<string> #include<iostream> using namespace std; using namespace x; int main() { my p; p.set_name("tom"); p.set_id(18); p.set_email("aa@bb.com"); string s; my

compile protobuf client code on ubuntu, but include file is not found

痴心易碎 提交于 2020-07-21 11:30:26
问题 I just installed google protocol buffer on my ubuntu1604: sudo apt install protobuf-compiler And tried a quick test, 1 proto file, 1 cpp file to use it, try to see the encode/decode results: $ cat 1.proto package x; message my{ required string name=1; required int32 id=2; optional string email=3; } $ cat 1.cpp #include"1.pb.cc" #include<string> #include<iostream> using namespace std; using namespace x; int main() { my p; p.set_name("tom"); p.set_id(18); p.set_email("aa@bb.com"); string s; my

PHP will include a file relative to a calling script, but not if the include path contains “../”

徘徊边缘 提交于 2020-06-17 09:40:52
问题 From what I gather from PHP's documentation and from other posts here, PHP's include (and include_once) do the following: Files are included based on the file path given or, if none is given, the include_path specified. If the file isn't found in the include_path, include will finally check in the calling script's own directory and the current working directory before failing I have the following structure in a given directory: index.php /dirA (contains a.php and b.php) /dirB (contains c.php)

Lua: Include file in the same directory

瘦欲@ 提交于 2020-06-14 07:50:27
问题 I'm using IMAPFilter, and I'd like to keep my global configuration in a public repository, while keeping the local (and secret) configuration in a separate file. So I'm running imapfilter from some directory, it includes ~/.imapfilter/config.lua, and that should include ./config_local.lua, where "." is the directory of config.lua , not the shell $PWD or the location of imapfilter . Here's what I've tried so far: require "config_local" require "./config_local" Edit: An absolute path works:

PC-Lint needs a list of all include paths for the files to be scanned. How to get a list of all include paths recursively needed by a target in CMake?

爱⌒轻易说出口 提交于 2020-06-13 06:24:31
问题 I'm in a project where CMake is used for managing the build process. In the project there are several executables which depends on components and these components are built as static libraries. There are also dependencies between these components. For each executable or component, only their own local includes are specified and includes from dependencies are resolved by using target_link_libraries(<target> <dependencies>) . So far so good. The problem is when PC-Lint shall be integrated into

How is it possible to use pow without including cmath library

血红的双手。 提交于 2020-05-30 13:03:30
问题 I'm trying to learn C++ and I'm using MS Visual Studio 2019. I have the code below: #include <iostream> int main() { std::cout << pow(10, 2); } How is it possible to compile and run without error without including cmath ? Inside the solution there is only one file with the above code. 回答1: How is possible in C++ to use pow without include cmath library By including another header that includes the <math.h> header. There is no guarantee that standard library headers won't include other headers