adding in working
This commit is contained in:
@@ -2,11 +2,6 @@ cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
project(HelloWorld)
|
||||
|
||||
# gstreamer-1.0
|
||||
find_package(PkgConfig REQUIRED)
|
||||
pkg_check_modules(GST REQUIRED gstreamer-1.0)
|
||||
include_directories(${GST_INCLUDE_DIRS})
|
||||
|
||||
set(CMAKE_CXX_STANDARD 14)
|
||||
|
||||
set (source_dir "./src")
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
this is a test baby
|
||||
+31
-5
@@ -1,11 +1,37 @@
|
||||
#include<iostream>
|
||||
#include <iostream>
|
||||
|
||||
#include <gst/gst.h>
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
|
||||
int main()
|
||||
{
|
||||
std::string read_line(std::string file_path) {
|
||||
// Create an ifstream object and associate it with the file "example.txt".
|
||||
std::ifstream infile(file_path);
|
||||
|
||||
// If the file could not be opened, print an error message and exit the
|
||||
// program.
|
||||
if (!infile.is_open()) {
|
||||
std::cerr << "Error: Could not open file " << file_path << std::endl;
|
||||
return "";
|
||||
}
|
||||
|
||||
// Read a line of text from the file.
|
||||
std::string line;
|
||||
std::getline(infile, line);
|
||||
|
||||
// Print the line of text to the console.
|
||||
std::cout << "The first line of the file is:\n";
|
||||
std::cout << line << std::endl;
|
||||
|
||||
// Close the file.
|
||||
infile.close();
|
||||
|
||||
return line;
|
||||
}
|
||||
|
||||
int main() {
|
||||
std::cout << "Hello World!" << std::endl;
|
||||
|
||||
std::cin.get();
|
||||
std::string line = read_line("../example.txt");
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user