Code:hi can anybody tell me what winmm.lib is?? is it supposed to be on my computer already or do i have to download it? if so where?? is there a way to check if it's already there?? any help would be appreciated thanks :)
Code:hi can anybody tell me what winmm.lib is?? is it supposed to be on my computer already or do i have to download it? if so where?? is there a way to check if it's already there?? any help would be appreciated thanks :)
Not everything that can be counted counts, and not everything that counts can be counted
- Albert Einstein.
No programming language is perfect. There is not even a single best language; there are only languages well suited or perhaps poorly suited for particular purposes.
- Herbert Mayer
nice feature but already tried that
winmm.lib appears to be a MSVC library. If you're trying to link with it, I believe the option is somewhere in Project->Project Options.
There should be a list of libraries to link with in there. Add winmm to the list.
Do as I say, not as I do . . .
Experimentation is the essence of programming. Just remember to make a backup first.
"I'm a firm believer that <SomeGod> gave us two ears and one mouth for a reason - we are supposed to listen, twice as much as we talk." - LEAF
Questions posted by these guidelines are more likely to be answered.
Debian GNU/Linux user, with the awesome window manager, the git version control system, and the cmake buildsystem generator.
Not everything that can be counted counts, and not everything that counts can be counted
- Albert Einstein.
No programming language is perfect. There is not even a single best language; there are only languages well suited or perhaps poorly suited for particular purposes.
- Herbert Mayer
This file should be part of the platform SDK. Look under your MSVS installation in directory VC\PlatformSDK\lib.
If you don't find it there, you can get it by installation the WDK. My installation of WDK 6001.18000 has it.
At any rate, don't just go out and grab a .lib file from some random web page. You won't have headers, and who knows what the hell it really is.
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
ok thanks a million i found it in system32 .... but..... ok.....trying to run a midi program.... and don't really know what i'm doing....
this is the sample
Code:#include <stdio.h> #include <portmidi.h> #define MD_NOTEON 0x90 #define MD_NOTEOFF 0x80 #define MD_PRG 0xC0 #define SBYTE(mess,chan) mess | chan int main() { int cnt,i,dev; PmError retval; const PmDeviceInfo *info; PortMidiStream *mstream; Pm_Initialize(); if(cnt = Pm_CountDevices()) { for(i=0; i < cnt; i++) { info = Pm_GetDeviceInfo(i); if(info->output) printf("%d: %s \n", i, info->name); } printf("choose device: "); scanf("%d", &dev); Pt_Start(1, NULL, NULL); retval = Pm_OpenOutput(&mstream, dev, NULL,512,NULL,NULL,0); if(retval != pmNoError) printf("error: %s \n", Pm_GetErrorText(retval)); else { char chan = 0; int prg = 0; long time = 0; for(i=60; i < 72; prg+=4, i++) { Pm_WriteShort(mstream, 0, Pm_Message(SBYTE(MD_PRG,chan), prg, 0)); time = Pt_Time(NULL); Pm_WriteShort(mstream, 0, Pm_Message(SBYTE(MD_NOTEON,chan), i, 120)); while(Pt_Time(NULL) - time < 1000); Pm_WriteShort(mstream, 0, Pm_Message(SBYTE(MD_NOTEOFF,chan), i, 120)); } } Pm_Close(mstream); } else printf("No available output devices\n"); Pm_Terminate(); return 0; }
and using gcc -o test midi.c -I. -L. -lportmidi -lwinmm
i have the relevant .lib and .h files in the same directory so this *should* work but it doesn't....
orginally i thought i didn't have winmm.lib but if that's not it then i don't know....there's nothing wrong with the code so it must be a problem with how i'm implmenting it????
winmm is probably not in the library directory for gcc. What version of gcc are you using, MinGW or Cygwin? Where is it installed?
Do as I say, not as I do . . .
Experimentation is the essence of programming. Just remember to make a backup first.
"I'm a firm believer that <SomeGod> gave us two ears and one mouth for a reason - we are supposed to listen, twice as much as we talk." - LEAF
Questions posted by these guidelines are more likely to be answered.
Debian GNU/Linux user, with the awesome window manager, the git version control system, and the cmake buildsystem generator.
it's cool it's working
still giving loads of errors but it plays
I find it unlikely that winmm.LIB (as opposed to .DLL) could be found in the system32 directory. Not saying you're lying, but that's weird.
I'd still really encourage you to install the platSDK (even though you're using GCC) and link against a real import library instead of the dll...
Code://try //{ if (a) do { f( b); } while(1); else do { f(!b); } while(1); //}
your right i found a .dll file not a .lib.. but will install the platSDK as you advise might clear the warnings anyway if one body out there still wanting to help ..... have to put this code into my own to play a matrix and i know i have to change this part of the code but not sure how to call the matrix i've already built??
can someone please explain what this part of the code is doing?Code:else { char chan = 0; int prg = 0; long time = 0; for(i=60; i < 72; prg+=4, i++) { Pm_WriteShort(mstream, 0, Pm_Message(SBYTE(MD_PRG,chan), prg, 0)); time = Pt_Time(NULL); Pm_WriteShort(mstream, 0, Pm_Message(SBYTE(MD_NOTEON,chan), i, 120)); while(Pt_Time(NULL) - time < 1000); Pm_WriteShort(mstream, 0, Pm_Message(SBYTE(MD_NOTEOFF,chan), i, 120)); }