Lost, trying to compile someone else's code

I’m trying to modify existing code for a school project, but I can’t figure how to compile the original code - and, obviously, I need to do that before I can do any modifications.
The code I’m trying to compile is all here: http://code.google.com/p/wiimote-api/
According to the readme, it compiles with MinGW or the DDK, but for some reason the hidsdi.h provided by MinGW is missing the HidD_SetOutputReport function - which is necessary for initializing the wiimote. I have no experience what-so-ever with the DDK, though I have downloaded and installed the version from microsoft’s website. I tried just using the WinXP Free Build environment, as suggested by the readme, and tried “build wiimote-api.c” and then, in src/ddk_build, “build makefile” but I’m getting errors I don’t know how to interpret (with the makefile, at least) and I don’t know what the output is supposed to be (I don’t even know if I’m getting errors just building from the source).
Is it possible to use the DDK libraries in another compiler? Should I even be using the ddk compiler for this?

I’m a student programmer, and my only experience is with working in IDEs like Eclipse or Bloodshed Dev-C++, but I understand the internal logic of the API pretty well, and I’m confident that if I can just compile it, I can modify it incrementally to get the effect I want. I’ve tried the precompiled GUI+API and it works just fine on my Vista machine.

I know this list is for kernel-mode development, and I don’t THINK that’s how this API runs (not even really sure of that), but OSR Online kept coming up when I was googling for help, and this seems to be the most knowledgeable community I could find for this sort of thing.

Open a winxp free build command shell window. Cd to the directory containing
the project (it must have a file named SOURCES in it.) From that directory
execute “build -cZ”. That should produce some output in the command window
and some log files if there are errors. Examine the log files and get back
to us.

On Mon, Mar 24, 2008 at 12:58 PM, wrote:

> I’m trying to modify existing code for a school project, but I can’t
> figure how to compile the original code - and, obviously, I need to do that
> before I can do any modifications.
> The code I’m trying to compile is all here:
> http://code.google.com/p/wiimote-api/
> According to the readme, it compiles with MinGW or the DDK, but for some
> reason the hidsdi.h provided by MinGW is missing the HidD_SetOutputReport
> function - which is necessary for initializing the wiimote. I have no
> experience what-so-ever with the DDK, though I have downloaded and installed
> the version from microsoft’s website. I tried just using the WinXP Free
> Build environment, as suggested by the readme, and tried “build
> wiimote-api.c” and then, in src/ddk_build, “build makefile” but I’m
> getting errors I don’t know how to interpret (with the makefile, at least)
> and I don’t know what the output is supposed to be (I don’t even know if I’m
> getting errors just building from the source).
> Is it possible to use the DDK libraries in another compiler? Should I even
> be using the ddk compiler for this?
>
> I’m a student programmer, and my only experience is with working in IDEs
> like Eclipse or Bloodshed Dev-C++, but I understand the internal logic of
> the API pretty well, and I’m confident that if I can just compile it, I can
> modify it incrementally to get the effect I want. I’ve tried the precompiled
> GUI+API and it works just fine on my Vista machine.
>
> I know this list is for kernel-mode development, and I don’t THINK that’s
> how this API runs (not even really sure of that), but OSR Online kept coming
> up when I was googling for help, and this seems to be the most knowledgeable
> community I could find for this sort of thing.
>
> —
> NTDEV is sponsored by OSR
>
> For our schedule of WDF, WDM, debugging and other seminars visit:
> http://www.osr.com/seminars
>
> To unsubscribe, visit the List Server section of OSR Online at
> http://www.osronline.com/page.cfm?name=ListServer
>


Mark Roddy

Basically, you need to write “Sources” file that list all your input .c and .asm files, libraries you link to, build options, etc, and to put it, along with MSFT-provided Makefile (you should not modify this one), into the directory with your target files. At this point you can already run WDK ‘Build’ utility on the command line. In general, you should read WDK documentation - it explains all that. Don’t forget to look at WDK samples - you will see that any of them has its ‘Sources’ file, so that you will get an idea how this file should be written…

Anton Bassov

Go to the ddk_build directory (in a DDK build environment) and type
“build”, or “build -cefv”.

With the MS build tool, “makefile” is always exactly the same and the
file you change is “sources.”. Both are apparently hardcoded into
build, so you don’t specify them.

ScottR

-----Original Message-----
From: xxxxx@lists.osr.com
[mailto:xxxxx@lists.osr.com] On Behalf Of
xxxxx@yahoo.com
Sent: Monday, March 24, 2008 12:58 PM
To: Windows System Software Devs Interest List
Subject: [ntdev] Lost, trying to compile someone else’s code

I’m trying to modify existing code for a school project, but
I can’t figure how to compile the original code - and,
obviously, I need to do that before I can do any
modifications. The code I’m trying to compile is all here:
http://code.google.com/p/wiimote-api/
According to the
readme, it compiles with MinGW or the DDK, but for some
reason the hidsdi.h provided by MinGW is missing the
HidD_SetOutputReport function - which is necessary for
initializing the wiimote. I have no experience what-so-ever
with the DDK, though I have downloaded and installed the
version from microsoft’s website. I tried just using the
WinXP Free Build environment, as suggested by the readme, and
tried “build wiimote-api.c” and then, in src/ddk_build,
“build makefile” but I’m getting errors I don’t know how to
interpret (with the makefile, at least) and I don’t know what
the output is supposed to be (I don’t even know if I’m
getting errors just building from the source). Is it possible
to use the DDK libraries in another compiler? Should I even
be using the ddk compiler for this?

I’m a student programmer, and my only experience is with
working in IDEs like Eclipse or Bloodshed Dev-C++, but I
understand the internal logic of the API pretty well, and I’m
confident that if I can just compile it, I can modify it
incrementally to get the effect I want. I’ve tried the
precompiled GUI+API and it works just fine on my Vista machine.

I know this list is for kernel-mode development, and I don’t
THINK that’s how this API runs (not even really sure of
that), but OSR Online kept coming up when I was googling for
help, and this seems to be the most knowledgeable community I
could find for this sort of thing.


NTDEV is sponsored by OSR

For our schedule of WDF, WDM, debugging and other seminars visit:
http://www.osr.com/seminars

To unsubscribe, visit the List Server section of OSR Online
at http://www.osronline.com/page.cfm?name=ListServer

Using a DDK command prompt go in to the DDK_BUILD directory of that
code and just type “Build”

That’s the directory with the “sources” file in it. It builds
fine. Then you’ll just need to go down the object directory
structure created to find the binary you just produced.

Mark.

At 16:58 24/03/2008, xxxxx@yahoo.com wrote:

I’m trying to modify existing code for a school project, but I can’t
figure how to compile the original code - and, obviously, I need to
do that before I can do any modifications.
The code I’m trying to compile is all here:
http://code.google.com/p/wiimote-api/
According to the readme, it compiles with MinGW or the DDK, but for
some reason the hidsdi.h provided by MinGW is missing the
HidD_SetOutputReport function - which is necessary for initializing
the wiimote. I have no experience what-so-ever with the DDK, though
I have downloaded and installed the version from microsoft’s
website. I tried just using the WinXP Free Build environment, as
suggested by the readme, and tried “build wiimote-api.c” and then,
in src/ddk_build, “build makefile” but I’m getting errors I don’t
know how to interpret (with the makefile, at least) and I don’t know
what the output is supposed to be (I don’t even know if I’m getting
errors just building from the source).
Is it possible to use the DDK libraries in another compiler? Should
I even be using the ddk compiler for this?

I’m a student programmer, and my only experience is with working in
IDEs like Eclipse or Bloodshed Dev-C++, but I understand the
internal logic of the API pretty well, and I’m confident that if I
can just compile it, I can modify it incrementally to get the effect
I want. I’ve tried the precompiled GUI+API and it works just fine on
my Vista machine.

I know this list is for kernel-mode development, and I don’t THINK
that’s how this API runs (not even really sure of that), but OSR
Online kept coming up when I was googling for help, and this seems
to be the most knowledgeable community I could find for this sort of thing.

> Open a winxp free build command shell window. Cd to the directory containing the project (it must have a > file named SOURCES in it.) From that directory execute “build -cZ”.

Or, even better, just click on “WDK Help”, and start reading right from “Getting started with WDK” - if this part gets done properly, the OP will be able to at least build the project without any external help. Judging from the lines “build wiimote-api.c” and “build makefile”, the OP did not even bother himself with reading WDK help - instead, he want straight to the NG. I imagine the questions he starts asking when he actually tries to modify the code…

Anton Bassov

Look at any sample’s SOURCES file and write your own similar.


Maxim Shatskih, Windows DDK MVP
StorageCraft Corporation
xxxxx@storagecraft.com
http://www.storagecraft.com

wrote in message news:xxxxx@ntdev…
> I’m trying to modify existing code for a school project, but I can’t figure
how to compile the original code - and, obviously, I need to do that before I
can do any modifications.
> The code I’m trying to compile is all here:
http://code.google.com/p/wiimote-api/
> According to the readme, it compiles with MinGW or the DDK, but for some
reason the hidsdi.h provided by MinGW is missing the HidD_SetOutputReport
function - which is necessary for initializing the wiimote. I have no
experience what-so-ever with the DDK, though I have downloaded and installed
the version from microsoft’s website. I tried just using the WinXP Free Build
environment, as suggested by the readme, and tried “build wiimote-api.c” and
then, in src/ddk_build, “build makefile” but I’m getting errors I don’t know
how to interpret (with the makefile, at least) and I don’t know what the output
is supposed to be (I don’t even know if I’m getting errors just building from
the source).
> Is it possible to use the DDK libraries in another compiler? Should I even be
using the ddk compiler for this?
>
> I’m a student programmer, and my only experience is with working in IDEs like
Eclipse or Bloodshed Dev-C++, but I understand the internal logic of the API
pretty well, and I’m confident that if I can just compile it, I can modify it
incrementally to get the effect I want. I’ve tried the precompiled GUI+API and
it works just fine on my Vista machine.
>
> I know this list is for kernel-mode development, and I don’t THINK that’s how
this API runs (not even really sure of that), but OSR Online kept coming up
when I was googling for help, and this seems to be the most knowledgeable
community I could find for this sort of thing.
>

We need to see the errors to have a shot at helping you.

Reread the ‘README.TXT’ file. It gives you some idea. It says to add
the following line to the ‘SOURCES’ file:

TARGETLIBS=$(TARGETLIBS) $(SDK_LIB_PATH)\hid.lib

N. B. - don’t create this project in a directory with a space anywhere
in the path.

To build it, change the directory to the directory that contains the
‘SOURCES’ file, and type ‘build -ceZ’ and see what happens.

This may or may not work. If it doesn’t, try replacing ‘SDK_LIB_PATH’
with ‘SDK_LIB_DEST,’ and if all else fails, hard code the path in your
SOURCES file.

As far as MinGW/using MS libraries with other compilers, don’t mix and
match - either use build/ms or MinGW/???.

I just downloaded this and tried it, and it builds fine. If yours
doesn’t, I don’t mean to be a downer, there’s no way to proceed any
further other than to read about ‘BUILD’ in the WDK, as others have
suggested.

Good luck,

mm

Maxim S. Shatskih wrote:

Look at any sample’s SOURCES file and write your own similar.