TimeWindows:- Compilation Using MinGW

Background

Let us compile TimeWindows using MinGW.

 

Timeline

  1. TimeWindows:- Compilation Using Microsoft Visual Studio
    Link

Outline

  1. Identify Source Code Repository
  2. Download Code
  3. Uncompress Package
  4. Examine & Prepare Artifacts
  5. Build Application

Tasks

Identify Source Code Repository

  1. Source Code ( Source / Commits )
    Link
  2. Source Code ( Source )
    Link
  3. Repository ( svn )
    Link

Download Code

Download compressed file.

Its name is source-archive.zip.

Extract

Extract from the compressed package.

The important folder is time-windows\trunk.

Image

artifact.sourceCode.01.20200522.0500PM

Textual

  1. icon.png
  2. TimeMem.c
  3. TimeMem.sln
  4. TimeMem.vcxproj
  5. TimeMem.vcxproj.filters

Prepare Artifacts

icon

icon – icon.png

Outline

Using online tools or desktop applications, please convert the image files.

Resources

Used any of the following resources to convert the .png file to an .ico file

  1. icoconvert.com
  2. ConvertICO.com
Usage

Convert icon.png to icon.ico

 

resource file

resource file – TimeMem.rc

Source Code

id ICON Timemem.ico

Image

timemem.rc

Build

resource file

Outline

  1. Invoke windres ( resource compiler )
  2. output format
    • coff
  3. source file
    • Indicate resource file
      • In our case TimeMem.rc
  4. Output file
    • Indicate file output
      • In our case _stage\TimeMem.res

Code

Syntax
windres --output-format coff [file.rc] [file.res]

Sample
windres --output-format coff TimeMem.rc _stage\TimeMem.res

source files

Outline

  1. Invoke gcc (  compiler )
  2. Compiler Directives
    • -c
  3. source file
    • Indicate source file name
      • In our case TimeMem.c
  4. -o
    • Indicate file output
      • In our case _stage\TimeMem.o

Code


gcc -c TimeMem.c -o _stage\TimeMem.o

build

Outline

  1. Invoke cl (  compiler )
  2. Object files
    • List Object Files
      • stage\TimeMem.o
  3. Resource files
    • List Resource Files
      • stage\TimeMem.res
  4. -o
    • Indicate output file
      • In our case bin\TimeMem.exe
  5. Link Libraries
    • -l
      • psapi

Code


gcc _stage\TimeMem.o _stage\TimeMem.res  -o bin\TimeMem.exe -lpsapi

Source Code Control

GitHub

Repository => https://github.com/DanielAdeniji/timeWindows

  1. Repository
    Link
  2. Source Code
    Link
  3. Compiler
    • Compiler Folder
      Link
    •  Microsoft/VisualStudio

Dedicated

Same Dedication as last time!

Dedicated to all these men and women who put in the work!

Here Dude did not even put his or her name on the source code.

References

  1. caiorss.github.io
    • CPP / C++ – Embed Resources Into Executables
      Link
  2. Microsoft
    • Docs
      • Windows / Apps / Win32 / Desktop Technologies / Desktop App User Interface / Menus and Other Resources
        • ICON Resource
          Link
      • Windows Dev Center
        • Windows > Apps > Win32 > API > Process Status API (PSAPI) > Psapi.h > GetProcessMemoryInfo function
          Link
  3. Thought.co
    • Zarko Gajic
      • How to Embed Media Files into a Delphi Executable (RC/.RES)
        Link
  4. Stack Overflow
    • Undefined reference to getprocessmemoryinfo@12
      Link
  5. Aaron Stannard
    • Win32 Errors: How to Format GetLastError() Output into Readable Strings
      Link

 

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s