c++代写-ELEC1601
时间:2021-10-29
2021/10/18 上午10:48cpol3526/ELEC1601-project-template: A template for the ELEC160…abs that allows anyone to easily code on any OS, from any IDE.
⻚码:1/8https://github.sydney.edu.au/cpol3526/ELEC1601-project-template
cpol3526 / ELEC1601-project-template Template
Code Issues Pull requests Projects Wiki Insights
1
branch 0tags
About
A template for the
ELEC1601 group
project in labs that
allows anyone to
easily code on any
OS, from any IDE.
Readme
Releases
No releases published
Languages
C 78.9%
Shell 10.8%
Learn Git and GitHub without any code!
Using the Hello World guide, you’ll start a branch, write comments, and open a pull
request.
Read the guide
main Go to file Add file Code Use this template
cpol3526 fixed weird… 406f3a1 3 days ago 26 commits
.vscode settings to make VSCode use… 4 days ago
include fixed SDL2_gfx include path 4 days ago
os/windows deleted extra folder 4 days ago
src fixed SDL2_gfx include path 4 days ago
.gitignore added .gitignore to ignore bi… 3 days ago
Makefile cleaned up unnecessary incl… 4 days ago
README.md fixed weird heading 3 days ago
build_run_cl… easy Batch script to build, ru… 4 days ago
build_run_cl… easy Bash script to build, run… 4 days ago
2021/10/18 上午10:48cpol3526/ELEC1601-project-template: A template for the ELEC160…abs that allows anyone to easily code on any OS, from any IDE.
⻚码:2/8https://github.sydney.edu.au/cpol3526/ELEC1601-project-template
README.md
ELEC1601 Project Template
An easy to use template repository that allows you to
work on code for your project on any OS and any IDE.
To get started, just click "Use this template" button!
Table of Contents
Note for Windows users
Structure of repo
Dependencies
Windows
macOS
Linux
Running the program
Windows
macOS/Linux
Compiling without running
Windows
macOS/Linux
Note for Windows users
If you are developing on Windows, it is important in
PowerShell/Command Prompt to run
git config --global core.autocrlf false
to avoid any strange conflicts that might come in commit
diffs based on how Windows handle end-of-line
characters.
HTML 5.0%
M4 1.9%
C++ 1.2%
Makefile 0.9%
Other 1.3%
2021/10/18 上午10:48cpol3526/ELEC1601-project-template: A template for the ELEC160…abs that allows anyone to easily code on any OS, from any IDE.
⻚码:3/8https://github.sydney.edu.au/cpol3526/ELEC1601-project-template
As well as this, also ensure you set your end-of-line
sequence in your IDE to "LF" rather than "CRLF". For this
repo, this should be configured for Visual Studio Code
within .vscode/settings.json , however, it's probably
better to disable this as a global setting on your IDE.
Structure of repo
.vscode/ - various adjustments for Visual Studio
Code users for easier coding, such as updating
includePath property so that VS Code can
recognise our header files. Configurations available
for Windows, macOS and Linux.
include/ - folder containing header files (files that
have the .h extension) - these usually contain code
we want to import in other files.
os/ - folder which contains OS-specific files for
compilation - for our case, this contains the SDL2
and SDL2_gfx files required just for Windows users.
src/ - folder containing source code files (files that
have the .c extension) - these control how various
components of our program work.
.gitignore - file which will allow Git tracking to
ignore specfied files/folders - in this case the bin/
folder generated after compiling.
Makefile - automatically compiles program and
allows for easy checking of source code changes by
using the Make build automation program.
build_run_clean.sh - Bash shell script to to easily
build, run, and clean up files after building program in
one step for macOS and Linux - a really handy
shortcut!
build_run_clean.sh - a Batch script for Windows
that does the same things as build_run_clean.sh ,
just, well, for Windows.
Dependencies
2021/10/18 上午10:48cpol3526/ELEC1601-project-template: A template for the ELEC160…abs that allows anyone to easily code on any OS, from any IDE.
⻚码:4/8https://github.sydney.edu.au/cpol3526/ELEC1601-project-template
GCC compiler for code
On Windows, you will have to install a toolkit
which supports this. The most common one is
Mingw-w64 - instructions for installing are
below.
On macOS, if you have Command Line Tools for
Xcode installed, gcc points to Clang to compile
C programs, which effecitvely produces the
same output.
On Linux, gcc should be available from most
distro's repositories.
SDL2 (included in repository for Windows)
SDL2_gfx (included in repository for Windows)
Make program for interpreting makefiles
On Windows, we will use mingw32-make from
Mingw-w64
On macOS, this is usually preinstalled as make
On Linux, this is available in most distro
repositories as make
Installation instructions are below:
Windows
To be able to compile the code in this repository, you will
need to obtain a GCC compiler for Windows. The most
popular one is included in the Mingw-w64 toolkit.
To install the latest version of GCC available for Windows
with Mingw-w64, you can install the MSYS2 platform,
which provides a variety of Unix tools for Windows, as
well as a Unix-like shell for managing and updating them.
The installation for MSYS2, as well as Mingw-w64, are
available from their website: https://www.msys2.org/.
Alternatively, you can also install Mingw-w64 as a
standalone software:
https://sourceforge.net/projects/mingw-w64/.
2021/10/18 上午10:48cpol3526/ELEC1601-project-template: A template for the ELEC160…abs that allows anyone to easily code on any OS, from any IDE.
⻚码:5/8https://github.sydney.edu.au/cpol3526/ELEC1601-project-template
Once Mingw-w64 is installed, you will need to add the
location of its executible files to the Windows PATH
environment variable to allow for us to be able to access
them by name from the command line. There is a good
guide by Microsoft on their VS Code website on how you
can do this:
https://code.visualstudio.com/docs/cpp/config-mingw -
simply scroll to "Step 4" under "Prerequisites". If you
installed Mingw-w64 as standalone software, the
instructions will be the same - just ensure you are
referring to the bin\ folder from the Mingw-w64
installation folder, rather than under the MSYS2 folder as
in the guide.
SDL2 and SDL2_gfx files are included within this
repository and are used when compiling on Windows, so
after this, you are ready to compile and run!
macOS
If you don't already have Command Line tools for Xcode
installed, install them by typing this into your terminal:
xcode-select --install
After installing them, you will need to agree to the license
in order to be able to use them - you can do so by running
sudo xcode-build -license
and scrolling to the bottom and agreeing to the terms.
After this, if you don't have Homebrew or an equivalent
package manager for macOS installed, install Homebrew
by following their website: https://brew.sh/.
Using Homebrew, run:
brew install sdl2 sdl2-gfx
2021/10/18 上午10:48cpol3526/ELEC1601-project-template: A template for the ELEC160…abs that allows anyone to easily code on any OS, from any IDE.
⻚码:6/8https://github.sydney.edu.au/cpol3526/ELEC1601-project-template
To compile the project, you will need configure the
compiler to recognise the SDL2 libraries you installed
from Homebrew.
To do this, you'll need to adjust the environment variables
CPATH and LIBRARY_PATH in your shell profile (usually
~/.zshrc ).
If you have an M1 Mac, add the following to your profile:
export CPATH=/opt/homebrew/include
export LIBRARY_PATH=/opt/homebrew/lib
If you have an Intel Mac, add the following to your profile:
export CPATH=/usr/local/include
export LIBRARY_PATH=/usr/local/lib
After that you should be all set.
Linux
Ensure you have both gcc and make installed on your
system. Once done, install SDL2 and SDL2_gfx from your
distro's package manager.
Ubuntu/Debian
Installing gcc and make with the build-essential
metapackage:
sudo apt install build-essential
Installing SDL2 and SDL2_gfx:
Fedora
sudo apt install libsdl2-2.0-0 libsdl2-dev libsdl2-gfx-1.0-0 libsdl2-gfx-dev
2021/10/18 上午10:48cpol3526/ELEC1601-project-template: A template for the ELEC160…abs that allows anyone to easily code on any OS, from any IDE.
⻚码:7/8https://github.sydney.edu.au/cpol3526/ELEC1601-project-template
Installing gcc and make :
sudo dnf install gcc make
Installing SDL2 and SDL2_gfx:
Arch Linux
Installing gcc and make with the base-devel
metapackage:
sudo pacman -S base-devel
Installing SDL2 and SDL2_gfx:
sudo pacman -S sdl2 sdl2_gfx
Running the program
Windows
Double click the build_run_clean.bat script, or,
alternatively, within PowerShell or Command Prompt, run
.\build_run_clean.bat
macOS/Linux
To compile, run and clean up the compiled files in one
step, simply run the following in your terminal from the
project directory:
./build_run_clean.sh
sudo dnf install SDL2 SDL2-devel SDL2_gfx SDL2_gfx-devel
2021/10/18 上午10:48cpol3526/ELEC1601-project-template: A template for the ELEC160…abs that allows anyone to easily code on any OS, from any IDE.
⻚码:8/8https://github.sydney.edu.au/cpol3526/ELEC1601-project-template
Compiling without running
To compile the program without running, in your terminal,
simply run mingw32-make on Windows, or make on
macOS/Linux, in the project directory.
The compiled file will be saved to the bin folder as
main on macOS and Linux, and main.exe on Windows.
To run the compiled program from your terminal:
Windows (PowerShell/Command Prompt)
.\bin\main.exe
macOS/Linux
./bin/main
You can also remove the compiled files from your terminal
by running mingw32-make clean on Windows, or make
clean on macOS/Linux.

学霸联盟








































































































































































































































学霸联盟


essay、essay代写