Bugs item #1727054, was opened at 2007-05-28 20:43
Message generated for change (Comment added) made by surfsmurf
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=865514&aid=1727054&group_id=173455

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: w32api
Group: None
Status: Open
Resolution: Accepted
Priority: 5
Private: No
Submitted By: Carsten S�rensen (surfsmurf)
Assigned to: Pedro Alves (pedroalves)
Summary: waveOutGetDevCaps problem

Initial Comment:
Using mingw32ce-0.10.0.20070208-cygwin

There's a problem with waveOutGetDevCaps - mmsystem.h defines 
waveOutGetDevCapsA and waveOutGetDevCapsW, but libcoredll.a exports only 
waveOutGetDevCaps.

If I do

---
#undef waveOutGetDevCaps

extern "C" MMRESULT WINAPI waveOutGetDevCaps(UINT,LPWAVEOUTCAPSW,UINT);
---

in my source, waveOutGetDevCaps works.

Regards,
Carsten Sorensen

----------------------------------------------------------------------

>Comment By: Carsten S�rensen (surfsmurf)
Date: 2007-05-30 12:59

Message:
Logged In: YES 
user_id=197168
Originator: YES

Success! Compiles, links, runs and displays the string in WAVEOUTCAPS
properly.

About the g++ thing - I'm using scons to build my project - when I'm
building the project for the mingw32ce platform I simply redefine the
internal path (which is different from $PATH) scons uses to look for build
tools. It was simply easier to retrofit mingw32ce to the existing build
scripts this way, as they use the compiler name to determine which compiler
options to use later on. Scons by design does not propagate the $PATH
environment variable to it's internal path in order to avoid problems when
there's multiple compilers installed (it either autoselects the compiler to
use or you can explicitly set the build environment), and I'd like to keep
it that way, to me it seems like it's the proper scons way of doing it.

So 'which g++' is kind of irrelevant, you'll have to believe me when I say
it's calling the right compiler ;)

Thanks a lot for your effort and thanks for cegcc, it's great having a
proper compiler.

----------------------------------------------------------------------

Comment By: Pedro Alves (pedroalves)
Date: 2007-05-30 11:52

Message:
Logged In: YES 
user_id=1370634
Originator: NO

Hi,

>Hmm still no go.

>g++ -o WaveOutDevice.o -c -O3 -Wall -Wno-unused-variable
-D_WIN32_WCE=0x0300 -I/Users/cso/code/oldsk00l/library WaveOutDevice.cpp

Missed that before, but, aren't you calling the system's g++ ?

What does 'which g++' say?

The recommended way to invoke g++ is:

arm-wince-mingw32ce-g++ -o WaveOutDevice.o -c -O3 -Wall
-Wno-unused-variable -I/Users/cso/code/oldsk00l/library WaveOutDevice.cpp

arm-wince-mingw32ce-g++ is in /opt/mingw32ce/bin, and that is what you
should put in your $PATH.

>This section in mmsystem.h looks all backwards to me
>
>#ifndef _WIN32_WCE
>#define waveOutGetDevCaps waveOutGetDevCapsW
>#define waveOutGetErrorText waveOutGetErrorTextW
>#define waveInGetDevCaps waveInGetDevCapsW
>#define waveInGetErrorText waveInGetErrorTextW
>#else
>#define waveOutGetDevCapsW waveOutGetDevCaps
>#define waveOutGetErrorTextW waveOutGetErrorText
>#define waveInGetDevCapsW waveInGetDevCaps
>#define waveInGetErrorTextW waveInGetErrorText
>#endif

Witness the power of lazy dumbness!  I guess I misstested it...

Could you test the new patch (v3)?

Tested by building this:

#include <windows.h>
#include <mmsystem.h>

int main ()
{
  LPWAVEOUTCAPSW a = NULL;
  LPWAVEOUTCAPS b = NULL;
  WAVEOUTCAPS *c = NULL;
  waveOutGetDevCaps (0, b, 0);
  waveOutGetDevCapsW (0, a, 0);
  waveOutGetDevCapsW (0, c, 0);
  return 0;
}

In c++ and c modes.

Cheers,
Pedro Alves

File Added: mmsystem.h.3.diff

----------------------------------------------------------------------

Comment By: Carsten S�rensen (surfsmurf)
Date: 2007-05-30 03:04

Message:
Logged In: YES 
user_id=197168
Originator: YES

Scratch that - that section is probably fine.

The problem is that mmsystem.h still declares waveOutGetDevCapsA and
waveOutGetDevCapsW as function prototypes - but not waveOutGetDevCaps.

I'm at a loss to explain why your example compiles :-/ ... perhaps because
I define _WIN32_WCE on the command line?

----------------------------------------------------------------------

Comment By: Carsten S�rensen (surfsmurf)
Date: 2007-05-30 02:52

Message:
Logged In: YES 
user_id=197168
Originator: YES

Hmm still no go.

g++ -o WaveOutDevice.o -c -O3 -Wall -Wno-unused-variable
-D_WIN32_WCE=0x0300 -I/Users/cso/code/oldsk00l/library WaveOutDevice.cpp
WaveOutDevice.cpp: In member function 'virtual bool
Oldsk00l::CWaveOutDevice::Open()':
WaveOutDevice.cpp:94: error: 'waveOutGetDevCaps' was not declared in this
scope

Note that I define _WIN32_WCE on the command line when calling g++ ...
This section in mmsystem.h looks all backwards to me

#ifndef _WIN32_WCE
#define waveOutGetDevCaps waveOutGetDevCapsW
#define waveOutGetErrorText waveOutGetErrorTextW
#define waveInGetDevCaps waveInGetDevCapsW
#define waveInGetErrorText waveInGetErrorTextW
#else
#define waveOutGetDevCapsW waveOutGetDevCaps
#define waveOutGetErrorTextW waveOutGetErrorText
#define waveInGetDevCapsW waveInGetDevCaps
#define waveInGetErrorTextW waveInGetErrorText
#endif

----------------------------------------------------------------------

Comment By: Pedro Alves (pedroalves)
Date: 2007-05-30 00:53

Message:
Logged In: YES 
user_id=1370634
Originator: NO

Sorry for that,
Please try the new attached patch.

Tested by buiding this:

#include <windows.h>
#include <mmsystem.h>

int main ()
{
  waveOutGetDevCaps (0,NULL,0);
  return 0;
}

File Added: mmsystem.h.2.diff

----------------------------------------------------------------------

Comment By: Carsten S�rensen (surfsmurf)
Date: 2007-05-29 11:17

Message:
Logged In: YES 
user_id=197168
Originator: YES

I grabbed the newer of the two diffs. There are new problems - when
including mmsystem.h now, I get

g++ -o WaveOutDevice.o -c -O3 -Wall -Wno-unused-variable
-D_WIN32_WCE=0x0300 -I/Users/cso/code/oldsk00l/library WaveOutDevice.cpp
/Users/cso/mingw32ce/lib/gcc/arm-wince-mingw32ce/4.1.0/../../../../arm-wince-mingw32ce/include/mmsystem.h:1568:
error: 'LPWAVEOUTCAPS' has not been declared
/Users/cso/mingw32ce/lib/gcc/arm-wince-mingw32ce/4.1.0/../../../../arm-wince-mingw32ce/include/mmsystem.h:1601:
error: 'LPWAVEINCAPS' has not been declared
/Users/cso/mingw32ce/lib/gcc/arm-wince-mingw32ce/4.1.0/../../../../arm-wince-mingw32ce/include/mmsystem.h:1669:
error: 'LPMIXERCAPS' has not been declared
/Users/cso/mingw32ce/lib/gcc/arm-wince-mingw32ce/4.1.0/../../../../arm-wince-mingw32ce/include/mmsystem.h:1678:
error: 'LPMIXERLINE' has not been declared
/Users/cso/mingw32ce/lib/gcc/arm-wince-mingw32ce/4.1.0/../../../../arm-wince-mingw32ce/include/mmsystem.h:1687:
error: 'LPMIXERLINECONTROLS' has not been declared
WaveOutDevice.cpp: In member function 'virtual bool
Oldsk00l::CWaveOutDevice::Open()':
WaveOutDevice.cpp:94: error: invalid conversion from 'WAVEOUTCAPS*' to
'int'
WaveOutDevice.cpp:94: error:   initializing argument 2 of 'MMRESULT
waveOutGetDevCaps(UINT, int, UINT)'

----------------------------------------------------------------------

Comment By: Pedro Alves (pedroalves)
Date: 2007-05-29 01:33

Message:
Logged In: YES 
user_id=1370634
Originator: NO

Hi Carsten,

Thanks for reporting.

It looks like there are other functions with the
same problem, so I fixed them too.  Please could you
try the attached patch to mmsystem.h?

Cheers,
Pedro Alves

File Added: mmsystem.h.diff

----------------------------------------------------------------------

Comment By: Pedro Alves (pedroalves)
Date: 2007-05-29 01:19

Message:
Logged In: YES 
user_id=1370634
Originator: NO

Hi Carsten,

Thanks for reporting.

It looks like there are other functions with the
same problem, so I fixed them too.  Please could you
try the attached patch to mmsystem.h?

Cheers,
Pedro Alves

File Added: mmsystem.h.diff

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=865514&aid=1727054&group_id=173455

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Cegcc-devel mailing list
Cegcc-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/cegcc-devel

Reply via email to