Preparing and running sample programs on Windows
Before you run the sample programs on Windows, you must first create a queue manager and also create the queues that you need. If you want to run COBOL samples, you might need to do some additional preparation.
About this task
The IBM® MQ for Windows sample files are in the directories
listed in Table 1, if the defaults were used at installation time. The
installation drive defaults to <c:>.
| Content | Directory |
|---|---|
| C source code | MQ_INSTALLATION_PATH\Tools\C\Samples |
| Source code for dead-letter handler sample | MQ_INSTALLATION_PATH\Tools\C\Samples\DLQ |
| COBOL source code | MQ_INSTALLATION_PATH\Tools\Cobol\Samples |
| C executable files 1 | MQ_INSTALLATION_PATH\ Tools\C\Samples\Bin (32-bit versions) MQ_INSTALLATION_PATH\ Tools\C\Samples\Bin64 (64-bit versions) |
| Sample MQSC files | MQ_INSTALLATION_PATH\Tools\MQSC\Samples |
| Visual Basic source code | MQ_INSTALLATION_PATH\Tools\VB\SampVB6 |
| .NET samples | MQ_INSTALLATION_PATH\Tools\dotnet\Samples |
MQ_INSTALLATION_PATH represents the high-level directory in which IBM MQ is installed.
Note: 64-bit versions are available of some C executable file samples.
The samples need a set of queues to work with. You can either use your own queues or run the sample MQSC file amqscos0.tst to create a set of queues. To run the samples, either use the executable versions supplied or compile the source versions as you would any other IBM MQ for Windows applications.
The
following sample programs have authentication capabilities:
- amqsbcg0.c
- amqsfhac.c
- amqsget0.c
- amqsghac.c
- amqsmhac.c
- amqsphac.c
- amqspuba.c
- amqsput0.c
- amqssslc.c
- amqssuba.c
- Compiling amqsput0.c without authentication
enabled:
CL amqsput0.c /link mqic.lib /OUT:Bin\amqsputc.exe - Compiling amqsput0.c with authentication
enabled:
CL /D SAMPLE_AUTH_ENABLED amqsauth.c amqsput0.c /link mqic.lib /OUT:Bin\amqsputc_auth.exe