winmm.lib

This is a discussion on winmm.lib within the C Programming forums, part of the General Programming Boards category; Code: hi can anybody tell me what winmm.lib is?? is it supposed to be on my computer already or do ...

  1. #1
    Registered User
    Join Date
    Dec 2008
    Posts
    13

    winmm.lib

    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 :)

  2. #2
    and the hat of copycat stevesmithx's Avatar
    Join Date
    Sep 2007
    Posts
    507
    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

  3. #3
    Registered User
    Join Date
    Dec 2008
    Posts
    13
    nice feature but already tried that

  4. #4
    Resu Deretsiger Nightowl's Avatar
    Join Date
    Nov 2008
    Location
    /dev/null
    Posts
    186
    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.

  5. #5
    and the hat of copycat stevesmithx's Avatar
    Join Date
    Sep 2007
    Posts
    507
    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

  6. #6
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,274
    Quote Originally Posted by jaquenta View Post
    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
    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);
    //}

  7. #7
    Registered User
    Join Date
    Dec 2008
    Posts
    13
    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("&#37;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????

  8. #8
    Resu Deretsiger Nightowl's Avatar
    Join Date
    Nov 2008
    Location
    /dev/null
    Posts
    186
    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.

  9. #9
    Registered User
    Join Date
    Dec 2008
    Posts
    13
    it's cool it's working

    still giving loads of errors but it plays

  10. #10
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,274
    Quote Originally Posted by jaquenta View Post
    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);
    //}

  11. #11
    Registered User
    Join Date
    Dec 2008
    Posts
    13
    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??
    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));
    			}
    can someone please explain what this part of the code is doing?

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. winmm.lib
    By herWter in forum Windows Programming
    Replies: 2
    Last Post: 07-13-2008, 05:30 AM
  2. Eject a cd with C++ code
    By Yuri in forum C++ Programming
    Replies: 8
    Last Post: 08-24-2005, 02:09 AM
  3. lcc win32 and winmm.lib
    By underthesun in forum Windows Programming
    Replies: 1
    Last Post: 07-01-2005, 06:36 AM
  4. explicit library file
    By subdene in forum C++ Programming
    Replies: 5
    Last Post: 06-21-2004, 11:25 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21