Skip to main content

Posts

Showing posts from September, 2019

[OpenCV] Simple example C++ and ubuntu

Prerequisite: Opencv is already installed. Source code: //include high gui headers #include "opencv2/highgui/highgui.hpp" //we are using standard and OpenCV namespaces using namespace cv; using namespace std; int main( int argc, const char** argv ){ //create a window named theWindow namedWindow("theWindow", CV_WINDOW_AUTOSIZE); //wait user hit some key waitKey(0); //destroy window named theWindow destroyWindow("theWindow"); return 0; } Build command: g++ -o firstcv $(pkg-config --libs --cflags opencv) main.cpp if error happened. /tmp/cceyijPd.o: In function `main': main.cpp:(.text+0x3d): undefined reference to `cv::namedWindow(cv::String const&, int)' main.cpp:(.text+0x53): undefined reference to `cv::waitKey(int)' main.cpp:(.text+0x70): undefined reference to `cv::destroyWindow(cv::String const&)' /tmp/cceyijPd.o: In function `cv::String::String(char const*

[Rust] How to install Rust on ubuntu

This is fast food, No more detailed explanation. Open your terminal. Just type and type a dozen of commands as below: //download curl software sudo apt-get install curl //using curl to download rust curl https://sh.rustup.rs -sSf | sh //type 1 to install Rust by default //after install completely, set PATH environment source ~/.profile source ~/.cargo/env //Check version rustc --version //Write the first program //Create directory mkdir  rs_dir cd rs_dir //Open vi editor to write source code vi first_proc.rs //Copy and paste below code in vi editor fn main()  {      println!("Hello World again!");  } //Save source code by vi manipulators with a keyboard. press "i" press "shift+insert" press ":" type wq enter //compile source code rustc first_proc.rs //run first program ./first_proc.rs More detail, please check out below references: https://www.rust-lang.org/tools/install https://www.tecmint.com/install-r