Thread: [Plib-users] joystick library
Brought to you by:
sjbaker
From: McCracken R. <inf...@ya...> - 2001-01-21 20:42:43
Attachments:
js_demo.cxx
|
Hey, I'm trying to break free of the classroom dependencies inflicted on me (college experiences). So, here goes my first question (hopefully not too naive - the subject matter in the archive is pretty intimidating): OK, running Windows '98 (try not to hate me too much for doing this). I installed Cygwin and it seems to work quite well. I downloaded the plib stuff (1.3.1). I did what the readme told me to: ./configure make make install OK, so now I have the example js_demo.cxx file in /usr/local/plib_examples-1.3.1/src/js In this directory there is also a file called 'js_demo.exe'. So I type './js_demo', and -Eureka!- it works for both of my controllers. But now I decide to try running some of my own stuff. There is a problem at the point at which the statement js[0]->notWorking () appears. This statement returns a value of 1 (not working). I attached the js_demo.cxx code for ease of viewing. I figured I might try running js_demo.cxx on my own to see if it was my code. So I type this: g++ js_demo.cxx The executable appears by default in a.exe. I run it and the controllers still don't work. So if the code that created js_demo.exe is js_demo.cxx, is there some sort of option that I'm missing to get an executable that works like the js_demo.exe? Or is the problem more serious/complicated? Any help would be GREATLY appreciated. Thanks, /R __________________________________________________ Do You Yahoo!? Yahoo! Auctions - Buy the things you want at great prices. http://auctions.yahoo.com/ |
From: Steve B. <sjb...@ai...> - 2001-01-21 21:58:35
|
McCracken Ryan wrote: > OK, running Windows '98 (try not to hate me too much > for doing this). I'm *trying*...but it's not going to be easy. > I installed Cygwin and it seems to > work quite well. You have Cygwin - well, that's improved your credibility *slightly*. :-) > I downloaded the plib stuff (1.3.1). > I did what the readme told me to: > > ./configure > make > make install Excellent. > OK, so now I have the example js_demo.cxx file in > /usr/local/plib_examples-1.3.1/src/js > > In this directory there is also a file called > 'js_demo.exe'. So I type './js_demo', and -Eureka!- it > works for both of my controllers. Woohoo! > But now I decide to try running some of my own stuff. > There is a problem at the point at which the statement > js[0]->notWorking () appears. This statement returns a > value of 1 (not working). Not good. > I attached the js_demo.cxx code for ease of viewing. > > I figured I might try running js_demo.cxx on my own to > see if it was my code. So I type this: > > g++ js_demo.cxx > > The executable appears by default in a.exe. I run it > and the controllers still don't work. So if the code > that created js_demo.exe is js_demo.cxx, is there some > sort of option that I'm missing to get an executable > that works like the js_demo.exe? Or is the problem > more serious/complicated? Hmmm - I'm a little suprised that something as simple as: g++ js_demo.cxx ...would compile correctly - but since the JS stuff is just a single header file - I suppose it could work. However, the PLIB distro doesn't come with binaries or executables of any kind - so js_demo.cxx *did* compile on your setup...but with a different compile line. I suggest you 'touch js_demo.cxx' - to change the date on it, then re-run the 'make' for the top level 'examples' directory. That should cause it to recompile js_demo.exe - and (importantly), you'll see what commands it used to compile it. I can't predict what those will need to be because the 'configure' script generates the Makefile's specifically to suit your machine's setup. I'm guessing that there should be something like "-DCYGWIN=1" on the compile command line. Without that, it's probably compiling the set of commands that would work under Linux rather than the ones for Windoze/Cygwin. However, I havn't used Windoze for over 10 years...so my advice may be worth nothing! Perhaps someone on this list who uses CygWin will be able to offer more help. -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net http://freeglut.sourceforge.net |
From: Norman V. <nh...@ca...> - 2001-01-21 22:23:20
|
Steve Baker writes: > >McCracken Ryan wrote: > >> I figured I might try running js_demo.cxx on my own to >> see if it was my code. So I type this: >> >> g++ js_demo.cxx >> >> The executable appears by default in a.exe. I run it >> and the controllers still don't work. So if the code >> that created js_demo.exe is js_demo.cxx, is there some >> sort of option that I'm missing to get an executable >> that works like the js_demo.exe? Or is the problem >> more serious/complicated? > >Hmmm - I'm a little suprised that something as simple >as: > >g++ js_demo.cxx > >...would compile correctly - but since the JS stuff is just >a single header file - I suppose it could work. This should make a my_js_dem0.exe c++ -o my_js_demo -DWIN32 js_demo.cxx -lwinmm -lplibul I do not like having to define WIN32 to make this work What do folks think of having the make install command create a <plib/config.h> that contains the -Defines used when plib was compiled <plib/config.h> would then be include by our other headers Norman Vine |
From: Steve B. <sjb...@ai...> - 2001-01-22 01:11:42
|
Norman Vine wrote: > This should make a my_js_dem0.exe > c++ -o my_js_demo -DWIN32 js_demo.cxx -lwinmm -lplibul > > I do not like having to define WIN32 to make this work I thought the Windoze compilers did that automatically. > What do folks think of having the make install command > create a <plib/config.h> that contains the -Defines used when plib was > compiled > <plib/config.h> would then be include by our other headers Sure - that's something that autoconf is able to do...I forget how exactly... -- Steve Baker HomeEmail: <sjb...@ai...> WorkEmail: <sj...@li...> HomePage : http://web2.airmail.net/sjbaker1 Projects : http://plib.sourceforge.net http://tuxaqfh.sourceforge.net http://tuxkart.sourceforge.net http://prettypoly.sourceforge.net http://freeglut.sourceforge.net |
From: Norman V. <nh...@ca...> - 2001-01-22 01:45:52
|
< changing the subject header for archival purposes > was 'RE: [Plib-users] joystick library' Steve Baker writes: > >Norman Vine wrote: > >> This should make a my_js_dem0.exe >> c++ -o my_js_demo -DWIN32 js_demo.cxx -lwinmm -lplibul >> >> I do not like having to define WIN32 to make this work > >I thought the Windoze compilers did that automatically. AFAIK all Windows compilers define _WIN32 < notice underbar > PLib using WIN32 is I believe a carryover from the FlightGear world. When they started using it I do not know < before I arrived though > We could go through the code and change all WIN32 to _WIN32 and see if that worked. We of course would still have the occasional #if defined(_WIN32) && !defined(__CYGWIN__) where we really want Unix behaviour when using Cygwin Any comments anyone on my just doing this ??? >> What do folks think of having the make install command >> create a <plib/config.h> that contains the -Defines used when plib was >> compiled >> <plib/config.h> would then be include by our other headers > >Sure - that's something that autoconf is able to do...I forget how >exactly... I think it is fairly easy todo but I have never done it. Have we got amy autoconfig gurus on the list ? Cheers Norman Vine |
From: Wolfram K. <w_...@rz...> - 2001-01-22 12:58:58
|
Norman wrote: >We could go through the code and change all WIN32 to _WIN32 >[...] >Any comments anyone on my just doing this ??? Sounds good. >>> What do folks think of having the make install command >>> create a <plib/config.h> that contains the -Defines used when plib = was >>> compiled >>> <plib/config.h> would then be include by our other headers >> >>Sure - that's something that autoconf is able to do...I forget how >>exactly... > >I think it is fairly easy todo but I have never done it. >Have we got amy autoconfig gurus on the list ? But I would guess that running make calls the compiler with include path and other options set. You can only have defines and not compiler options in the config.h. So, if I see things correctly, when someone does a new project under Cygwin or Linux, he would still have to think about doing autoconf stuff / a manual makefile or batch file containing the correct settings for his system.=20 >Cheers > >Norman Vine=20 Bye bye, Wolfram. |
From: Sam S. <sa...@sp...> - 2001-01-22 14:40:07
|
----- Original Message ----- From: "Norman Vine" <nh...@ca...> To: <pli...@li...> Sent: Sunday, January 21, 2001 5:43 PM Subject: [Plib-users] config.h > < changing the subject header for archival purposes > > was 'RE: [Plib-users] joystick library' > > Steve Baker writes: > > > >Norman Vine wrote: > > > >> This should make a my_js_dem0.exe > >> c++ -o my_js_demo -DWIN32 js_demo.cxx -lwinmm -lplibul > >> > >> I do not like having to define WIN32 to make this work > > > >I thought the Windoze compilers did that automatically. > > AFAIK all Windows compilers define _WIN32 < notice underbar > > > PLib using WIN32 is I believe a carryover from the FlightGear world. > When they started using it I do not know < before I arrived though > Well I just checked MSVC++ and it makes these preprocessor definations WIN32,_DEBUG,_CONSOLE,_MBCS Notice that the WIN32 has no underscore? What a pain... Guess the config.h file would have to have something like: #if defined(_WIN32) && !defined(WIN32) #define WIN32 #endif ? Sam |
From: Norman V. <nh...@ca...> - 2001-01-22 17:40:03
|
Sam Stickland writes: >Norman Vine wrote:" >> > >> >I thought the Windoze compilers did that automatically. >> >> AFAIK all Windows compilers define _WIN32 < notice underbar > >> > >Well I just checked MSVC++ and it makes these preprocessor definations > >WIN32,_DEBUG,_CONSOLE,_MBCS > >Notice that the WIN32 has no underscore? What a pain... Sam could you please try this simple test program ------------- #include <stdio.h> int main( int argc, char **argv ) { #ifdef _WIN32 printf("_WIN32 found\n"); #endif #ifdef WIN32 printf("WIN32 found\n"); #endif #if !defined( _WIN32 ) && !defined( WIN32 ) printf("Neither _WIN32 or WIN32 found\n"); #endif return 0; } |
From: Sam S. <sa...@sp...> - 2001-01-22 17:54:48
|
----- Original Message ----- From: "Norman Vine" <nh...@ca...> To: <pli...@li...> Sent: Monday, January 22, 2001 5:37 PM Subject: RE: [Plib-users] config.h > Sam Stickland writes: > > >Norman Vine wrote:" > >> > > >> >I thought the Windoze compilers did that automatically. > >> > >> AFAIK all Windows compilers define _WIN32 < notice underbar > > >> > > > >Well I just checked MSVC++ and it makes these preprocessor definations > > > >WIN32,_DEBUG,_CONSOLE,_MBCS > > > >Notice that the WIN32 has no underscore? What a pain... > > Sam could you please try this simple test program Well that will teach me to post without checking first :) _WIN32 found WIN32 found Opps. Sam |
From: Sam S. <sa...@sp...> - 2001-01-22 14:40:07
|
----- Original Message ----- From: "Norman Vine" <nh...@ca...> To: <pli...@li...> Sent: Sunday, January 21, 2001 5:43 PM Subject: [Plib-users] config.h > < changing the subject header for archival purposes > > was 'RE: [Plib-users] joystick library' > > Steve Baker writes: > > > >Norman Vine wrote: > > > >> This should make a my_js_dem0.exe > >> c++ -o my_js_demo -DWIN32 js_demo.cxx -lwinmm -lplibul > >> > >> I do not like having to define WIN32 to make this work > > > >I thought the Windoze compilers did that automatically. > > AFAIK all Windows compilers define _WIN32 < notice underbar > > > PLib using WIN32 is I believe a carryover from the FlightGear world. > When they started using it I do not know < before I arrived though > Well I just checked MSVC++ and it makes these preprocessor definations WIN32,_DEBUG,_CONSOLE,_MBCS Notice that the WIN32 has no underscore? What a pain... Guess the config.h file would have to have something like: #if defined(_WIN32) && !defined(WIN32) #define WIN32 #endif ? Sam |