I try to compile Qt project using dlib
#include <dlib/image_processing/frontal_face_detector.h>
#include <dlib/dnn.h>
#include <dlib/gui_widgets.h>
#include <dlib/clustering.h>
#include <dlib/string.h>
#include <dlib/image_io.h>
#include <iostream>
using namespace cv;
using namespace dlib;
using namespace std;
int main(int argc, char *argv[])
{
frontal_face_detector detector = get_frontal_face_detector();
matrix <rgb_pixel> image;
load_image(image, "/Users/ivanlebedev/Desktop/Projects/ManSearch/cars/2.jpg");
image_window win(image);
}
but i have this ERROR:
/usr/local/Cellar/dlib/19.15/include/dlib/gui_core/gui_core_kernel_2.h:12: ошибка: "Also make sure you have libx11-dev installed on your system"
#error "Also make sure you have libx11-dev installed on your system"
^
How i can make my program work?
You don't need nor want x11-anything. You need to compile dlib without x11 support, and then it'll work fine.
Related
I'm trying to use boost on CodeBlocks. I have codeblocks configured with MinGW-w64. I alredy have included the following libraries in the linker settings
libboost_system-mgw73-mt-d-x32-1_66.a
libboost_system-mgw73-mt-x64-1_66.a
libboost_filesystem-mgw73-mt-x64-1_66.dll.a
I also try changing the order...
This is the source code
#include <iostream>
#include <boost/filesystem.hpp>
using namespace std;
namespace fs = boost::filesystem;
int main(int argc, char* argv[])
{
if( fs::is_directory("."))
cout << "Works!" << endl;
return 0;
}
i have read many "solutions" but they didn't work.
i tried:
changing the #include for this
#define BOOST_NO_CXX11_SCOPED_ENUMS
#include <boost/filesystem.hpp>
#undef BOOST_NO_CXX11_SCOPED_ENUMS
creating a new compiler flag with boths values
-lboost_filesystem-mt
and also
-lboost_filesystem
but i always get the same error
...\boost_1_66_0\boost\filesystem\path.hpp|981|undefined reference to `boost::filesystem::path::codecvt()'|
Trying to make a hello-world style opencv program, but fails to compile if I don't include highgui.hpp, yet fails to link if I do include it.
For example, when I include that header, the linker complains:
undefined reference to `cv::_OutputArray::_OutputArray(cv::Mat&
#include <opencv2/core.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
#include <opencv2/objdetect/objdetect.hpp>
#include <iostream>
using namespace std;
using namespace cv;
int main(int argc, char *args[])
{
Mat &frame;
Mat grayscale;
CascadeClassifier &face_cascade;
vector<cv::Rect> &faces;
VideoCapture *capture;
...
If I don't include highgui.hpp, then it doesn't compile due to errors like:
'VideoCapture’ was not declared in this scope
I'm using pyimagesearch's vagrant based ubuntu virtual machine that comes with cv2 installed. The cv2 Python scripts work fine, but just not the c++
I have built the LLVM using CMake using VS 2012 in keeping with documentation. I am trying to build a toy compiler with flex, bison and LLVM. The final stage of my compiler my main class looks like this:
#include <iostream>
#include "codegen.h"
#include "node.h"
#include "llvm/Target/Targetmachine.h"
using namespace std;
extern int yyparse();
extern NBlock* programBlock;
void createCoreFunctions(CodeGenContext& context);
int main(int argc, char **argv)
{
yyparse();
std::cout << programBlock << endl;
InitializeNativeTarget();
CodeGenContext context;
createCoreFunctions(context);
context.generateCode(*programBlock);
context.runCode();
return 0;
}
As stated in my previous post LLVM 3.4 linker errors in VS 2012. To workaround the solution I manually added the x86 files I was missing (taking clue from the errors). I ended up adding the following to the main:
#include "llvm-3.4/lib/Target/X86/MCTargetDesc/X86MCTargetDesc.h"
#include "llvm-3.4/lib/Target/X86/InstPrinter/X86ATTInstPrinter.h"
#include "llvm-3.4/lib/Target/X86/InstPrinter/X86IntelInstPrinter.h"
#include "X86MCAsmInfo.h"
#include "llvm/ADT/Triple.h"
#include "llvm/MC/MCCodeGenInfo.h"
#include "llvm/MC/MCInstrAnalysis.h"
#include "llvm/MC/MCInstrInfo.h"
#include "llvm/MC/MCRegisterInfo.h"
#include "llvm/MC/MCStreamer.h"
#include "llvm/MC/MCSubtargetInfo.h"
#include "llvm/MC/MachineLocation.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/Host.h"
#include "llvm/Support/TargetRegistry.h"
#include "X86GenRegisterInfo.inc"
#include "X86GenInstrInfo.inc"
#include "X86GenSubtargetInfo.inc"
But I noticed that the following are missing from my system:
"X86MCAsmInfo.h"
"X86GenRegisterInfo.inc"
"X86GenInstrInfo.inc"
"X86GenSubtargetInfo.inc"
I looked through the online documentation but I am a beginner on the topic, most of it did not make too much sense to me. I would appreciate if someone could guide me or point me to the right tutorial which gives me a better understanding of what I am doing wrong here.
I installed Netbeans and as C++ compiler I installed cygwin. I made a simple project to test out my installation, this is the code:
#include <cstdlib>
#include <iostream>
using namespace std;
int main(int argc, char** argv) {
cout << "test";
return 0;
}
This is the error message that it gives: http://pastebin.com/jRRh7MPi
I hope you guys can help me out.
You need to either explicitly link to C++ standard library, or compile using g++ instead of gcc.
I'm completely new to C++, but I have created a minor program, looking to port the program to other computers, but when I "install" the program I get this error...-static-libgcc -static-libstdc++ missing, is there a file I should be including in the program itself, or is this a library I have to install on each computer? The computers that I expect to run the program will be windows xp. Source code of the file is as follows:
#include <stdlib.h>
#include <windows.h>
#include <direct.h>
#include <string.h>
#include <string>
#include <iostream>
using namespace std;
int main(int argc, const char *argv[])
{
_chdir("C:\\Program Files\\NCHSoftware\\Talk\\");
string number = "start talk.exe -dial " + std::string(argv[1]+4);
system(number.c_str());
exit;
return 0;
}
They are shared lib's that would need to be on the host computer.
To learn how to compile a static version;
See here: http://gcc.gnu.org/onlinedocs/gcc/Link-Options.html
Read the "-static-libgcc" & "-static-libstdc++" sections.