🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Thread View: borland.public.cppbuilder.nativeapi
5 messages
5 total messages Started by James5950 Tue, 04 Mar 2008 00:37
LINK Error with ksmedia.h
#599
Author: James5950
Date: Tue, 04 Mar 2008 00:37
28 lines
1759 bytes
Hello Sir,

I need help...
I try to create WASAPI application and include ks.h and ksmedia.h on my 
project, I got the link error message as below,
How to setting the m_wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM; without any 
link error? This setting is work on MS Visual Studio 2005. Is a bug on 
BCB2007?

Thanks for any comments,
James

/*Code Start

#include <ks.h>
#include <ksmedia.h>

    m_wfx.SubFormat = KSDATAFORMAT_SUBTYPE_PCM;
    m_wfx.Format.wFormatTag = WAVE_FORMAT_EXTENSIBLE;

Code End*/


//Error Message

[ILINK32 Error] Error: Unresolved external '_KSDATAFORMAT_SUBTYPE_PCM' 
referenced from D:\VRDRUMMIDI PROJECT\WASAPI\WASPAI 
DEMOWAVE2\DEBUG\WAVEFILE.OBJ
Re: LINK Error with ksmedia.h
#600
Author: Remy Lebeau (TeamB)
Date: Tue, 04 Mar 2008 01:01
27 lines
1842 bytes
"James5950" <James@1come.com.tw> wrote in message 
news:47cc99e1@newsgroups.borland.com...

> I try to create WASAPI application and include ks.h and ksmedia.h
> on my project, I got the link error message as below

You did not include the .lib file that actually defines the contents of 
KSDATAFORMAT_SUBTYPE_PCM.  However...

> How to setting the m_wfx.SubFormat ... without any link error?

... you cannot use VC++ static libraries in Borland projects, so you will 
have to define the contents of KSDATAFORMAT_SUBTYPE_PCM in your code 
directly, ie:

    // KSDATAFORMAT_SUBTYPE_PCM = 00000001-0000-0010-8000-00aa00389b71
    const GUID KSDATAFORMAT_SUBTYPE_PCM { 0x00000001, 0x0000, 0x0010, {0x80, 
0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} };

> This setting is work on MS Visual Studio 2005. Is a bug on BCB2007?

No.  It is merely an incompatibility between Borland and Microsoft 
compilers.


Gambit 
Re: LINK Error with ksmedia.h
#601
Author: James5950
Date: Tue, 04 Mar 2008 01:49
25 lines
1932 bytes
Thanks Remy,

More questions,

> You did not include the .lib file that actually defines the contents of 
> KSDATAFORMAT_SUBTYPE_PCM.  However...

Which .lib need include?  I can not find about ksmedia.lib in BCB2007 
library directory.

> ... you cannot use VC++ static libraries in Borland projects, so you will 
> have to define the contents of KSDATAFORMAT_SUBTYPE_PCM in your code 
> directly, ie:
>
>    // KSDATAFORMAT_SUBTYPE_PCM = 00000001-0000-0010-8000-00aa00389b71
>    const GUID KSDATAFORMAT_SUBTYPE_PCM { 0x00000001, 0x0000, 0x0010, 
> {0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} };
    DEFINE_WAVEFORMATEX_GUID(WAVE_FORMAT_PCM)
DEFINE_GUIDSTRUCT("00000001-0000-0010-8000-00aa00389b71", 
KSDATAFORMAT_SUBTYPE_PCM);

Could you provide me more detail about define this GUID? I try it can not 
work.

James 
Re: LINK Error with ksmedia.h
#602
Author: Remy Lebeau (TeamB)
Date: Tue, 04 Mar 2008 02:25
33 lines
2020 bytes
"James5950" <James@1come.com.tw> wrote in message 
news:47ccaabb@newsgroups.borland.com...

> Which .lib need include?

KSDATAFORMAT_SUBTYPE_PCM is defined in ksuser.lib, which cannot be used in 
BCB projects.

> I can not find about ksmedia.lib in BCB2007 library directory.

There is no such file to begin with.

> I try it can not work.

Did you try undefining the original KSDATAFORMAT_SUBTYPE_PCM?

    #undef KSDATAFORMAT_SUBTYPE_PCM
    const GUID KSDATAFORMAT_SUBTYPE_PCM = { 0x00000001, 0x0000, 0x0010, 
{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} };

Otherwise, you will have to give it a different name, ie:

    const GUID my_KSDATAFORMAT_SUBTYPE_PCM = { 0x00000001, 0x0000, 0x0010, 
{0x80, 0x00, 0x00, 0xaa, 0x00, 0x38, 0x9b, 0x71} };

    m_wfx.SubFormat = my_KSDATAFORMAT_SUBTYPE_PCM;

Either way, ignore the original #define macros, they don't work without the 
.lib to back them up.


Gambit 
Re: LINK Error with ksmedia.h
#604
Author: James5950
Date: Tue, 04 Mar 2008 02:38
7 lines
1225 bytes
Hello Remy,

It's work now, without link error.

Thank you,

James
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads