Skip to content

Commit

Permalink
Prepare for version 1.1.
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinPayne committed Aug 26, 2013
1 parent 635b8e6 commit 7723aaa
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 36 deletions.
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# This Makefile will build a DLL and an application using the DLL.

all : AddLib.dll AddTest.exe
all: AddLib.dll AddTest.exe

AddLib.dll : include/add.h
AddLib.dll: include/add.h
gcc -O3 -std=c99 -D ADD_EXPORTS -Wall -I.\include -c src/add.c -o obj/add.o
windres -i res/resource.rc -o obj/resource.o
gcc -o AddLib.dll obj/add.o obj/resource.o -shared -s -Wl,--subsystem,windows,--out-implib,libaddlib.a

AddTest.exe : include/add.h AddLib.dll
AddTest.exe: include/add.h AddLib.dll
gcc -O3 -std=c99 -Wall -I.\include -c src/addtest.c -o obj/addtest.o
gcc -o AddTest.exe obj/addtest.o -s -L. -lAddLib

clean :
clean:
del obj\*.o *.exe *.dll *.a
23 changes: 19 additions & 4 deletions Readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -18,29 +18,44 @@ compiler are named
your version of the make utility may be named differently�please check the
documentation which came with your MinGW packages.


Disclaimer

This program is distributed in the hope that it will be useful, but WITHOUT ANY
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.


Terms of Use

There is no specific license attached to the use this application. You are free
to use it however you see fit, whether for commercial or non-commercial
purposes. The intention is that you use it as a starting point for building
Windows applications, so that you don�t have to write all of your applications
from scratch. You are encouraged to modify it to suit your needs as a Windows
application template, and how you license any applictions built with it is
Windows DLLs, so that you don�t have to write all of your DLL projects from
scratch. You are encouraged to modify it to suit your needs as a Windows
DLL project template, and how you license any applictions built with it is
entirely up to you. Of course, you must still comply with the licensing
conditions of the tools you are using to build the application.


Problems?

If you have any problems or questions, please get in contact via
http://www.transmissionzero.co.uk/contact/. Please ensure that you read the
article at http://www.transmissionzero.co.uk/computing/building-dlls-with-mingw/
before sending any questions.


Changelog

2013�08�26: Version 1.1

� Minor tweaks to the VERSIONINFO resource so that it uses constants rather
than magic numbers.

2011�04�16: Version 1.0

� First release.

Martin Payne
2011�04�16
2013�08�26
54 changes: 28 additions & 26 deletions res/resource.rc
Original file line number Diff line number Diff line change
@@ -1,33 +1,35 @@
1 VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK 0x17L
#include <windows.h>

// DLL version information.
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,0
PRODUCTVERSION 1,0,0,0
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
#ifdef _DEBUG
FILEFLAGS 0x1L
FILEFLAGS VS_FF_DEBUG | VS_FF_PRERELEASE
#else
FILEFLAGS 0x0L
FILEFLAGS 0
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_DLL
FILESUBTYPE VFT2_UNKNOWN
BEGIN
BLOCK "StringFileInfo"
BLOCK "StringFileInfo"
BEGIN
BLOCK "080904b0"
BEGIN
BLOCK "080904b0"
BEGIN
VALUE "Comments", "Addition Library"
VALUE "CompanyName", "Transmission Zero"
VALUE "FileDescription", "A library to perform addition."
VALUE "FileVersion", "1, 0, 0, 0"
VALUE "InternalName", "AddLib"
VALUE "LegalCopyright", "�2011 Martin Payne"
VALUE "OriginalFilename", "AddLib.dll"
VALUE "ProductName", "Addition Library"
VALUE "ProductVersion", "1, 0, 0, 0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x809, 1200
VALUE "CompanyName", "Transmission Zero"
VALUE "FileDescription", "A library to perform addition."
VALUE "FileVersion", "1.0.0.0"
VALUE "InternalName", "AddLib"
VALUE "LegalCopyright", "�2013 Transmission Zero"
VALUE "OriginalFilename", "AddLib.dll"
VALUE "ProductName", "Addition Library"
VALUE "ProductVersion", "1.0.0.0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x809, 1200
END
END
2 changes: 1 addition & 1 deletion src/add.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ int ADDCALL Add(int a, int b)
return (a + b);
}

/* Assign value to exported variables. */
/* Assign values to exported variables. */
int foo = 7;
int bar = 41;
2 changes: 1 addition & 1 deletion src/addtest.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

int main(int argc, char** argv)
{
/* foo + bar = Add(foo, bar) */
/* Add foo and bar variables exported from the DLL */
printf("%d + %d = %d\n", foo, bar, Add(foo, bar));

return EXIT_SUCCESS;
Expand Down

0 comments on commit 7723aaa

Please sign in to comment.