aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar SharafatKarim <sharafat2004@gmail.com>2024-03-07 21:23:43 +0600
committerLibravatar SharafatKarim <sharafat2004@gmail.com>2024-03-07 21:23:43 +0600
commit992be6b87362b4c4ab2c8f97237372cd8ab45a3e (patch)
tree5617b068797f21c965044f7e5446ede394a0b00d
parent32974f14dbe89fe7467258097cea515b7bc9aa0e (diff)
downloadentropy-calc-992be6b87362b4c4ab2c8f97237372cd8ab45a3e.tar.gz
entropy-calc-992be6b87362b4c4ab2c8f97237372cd8ab45a3e.zip
Add build instructions for Visual Studio Code
-rw-r--r--README.md48
1 files changed, 47 insertions, 1 deletions
diff --git a/README.md b/README.md
index aa21190..baf6b11 100644
--- a/README.md
+++ b/README.md
@@ -12,13 +12,56 @@ This is a C++ project that calculates the entropy change of different elements i
## How to Build
+### Code::Blocks
+
1. Open the `entropy-calculator.cbp` file in Code::Blocks.
2. Click on the "Build" button or select "Build" from the "Build" menu.
-## How to Run
+#### How to Run
After building the project, you can run the program by clicking on the "Run" button or selecting "Run" from the "Build" menu in Code::Blocks.
+### Visual Studio Code
+
+1. Open the project in Visual Studio Code.
+2. Press `F5` to build the project.
+3. It will create a `task.json` file in the `.vscode` directory.
+4. Configure the `task.json` file to build the project like this one,
+
+```cpp
+{
+ "tasks": [
+ {
+ "type": "cppbuild",
+ "label": "C/C++: g++ build active file",
+ "command": "/usr/bin/g++",
+ "args": [
+ "-fdiagnostics-color=always",
+ "-g",
+ "${file}",
+ "./headers/allElements.cpp", // Add this line
+ "-o",
+ "${fileDirname}/${fileBasenameNoExtension}"
+ ],
+ "options": {
+ "cwd": "${fileDirname}"
+ },
+ "problemMatcher": [
+ "$gcc"
+ ],
+ "group": {
+ "kind": "build",
+ "isDefault": true
+ },
+ "detail": "Task generated by Debugger."
+ }
+ ],
+ "version": "2.0.0"
+}
+```
+
+5. Press `F5` again to build and run the project.
+
## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
@@ -28,6 +71,7 @@ Pull requests are welcome. For major changes, please open an issue first to disc
1. Create a new file in the `elements/` directory with the name of the element (e.g. `water.h` for water element)
2. Define the element in the file. Declare a class with the name of the element which inherits from the `baseElement` class.
3. Write constructor and set the values of the properties of the element.
+
```cpp
// Example: water.h
#ifndef WATER_HPP_INCLUDED
@@ -51,7 +95,9 @@ public:
};
#endif // WATER_HPP_INCLUDED
```
+
4. Include the header file in the `allElements.cpp` file located in the `headers/` directory.
+
```cpp
// include new element's header file
#include "../elements/water.h"