-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
lab1 #41
base: main
Are you sure you want to change the base?
lab1 #41
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
cmake_minimum_required(VERSION 3.15...3.30) | ||
|
||
project( | ||
lab1Example | ||
VERSION 1.0 | ||
LANGUAGES CXX) | ||
|
||
add_library(HelloWorldlib STATIC src/hello_world.cpp include/hello_world.h) | ||
|
||
target_include_directories(HelloWorldlib PUBLIC include) | ||
|
||
# target_compile_features(HelloWorldlib PUBLIC cxx_std_11) | ||
|
||
add_executable(main src/main.cpp) | ||
|
||
target_link_libraries(main PUBLIC HelloWorldlib) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#pragma once | ||
// #include <iostream> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see comment about includes |
||
|
||
class hello_world | ||
{ | ||
public: | ||
void static write_hello_world(); | ||
}; |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#include "/Users/sayandahiya/Desktop/Hytech/lab1_hard_project/include/hello_world.h" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please do not include header files like this, this is setup by cmake for you: https://cliutils.gitlab.io/modern-cmake/chapters/basics.html#targets-are-your-friend |
||
#include <iostream> | ||
|
||
void hello_world::write_hello_world() | ||
{ | ||
std::cout << "Hello World"; | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
|
||
#include </Users/sayandahiya/Desktop/Hytech/lab1_hard_project/include/hello_world.h> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. see previous comment about includes |
||
|
||
int main() | ||
{ | ||
hello_world::write_hello_world(); | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please dont include commented code