I am attempting to write a .dll using a library that comes with some demo projects that run with no issues. When I attempt to #include a header, the compiler complains that certain datatypes are not defined. here is a sample of the errors generated
1>c:\program files (x86)\audiokinetic\wwise v2012.1.4 build 4260\sdk\include\ak\wwise\utilities.h(82) : error C2061: syntax error : identifier 'LPCWSTR'
1>c:\program files (x86)\audiokinetic\wwise v2012.1.4 build 4260\sdk\include\ak\wwise\utilities.h(90) : error C2061: syntax error : identifier 'LPCWSTR'
1>c:\program files (x86)\audiokinetic\wwise v2012.1.4 build 4260\sdk\include\ak\wwise\utilities.h(97) : error C2061: syntax error : identifier 'LPCWSTR'
1>c:\program files (x86)\audiokinetic\wwise v2012.1.4 build 4260\sdk\include\ak\wwise\utilities.h(107) : error C2061: syntax error : identifier 'LPCWSTR'
1>c:\program files (x86)\audiokinetic\wwise v2012.1.4 build 4260\sdk\include\ak\wwise\utilities.h(110) : error C2061: syntax error : identifier 'DWORD'
1>c:\program files (x86)\audiokinetic\wwise v2012.1.4 build 4260\sdk\include\ak\wwise\utilities.h(113) : error C2061: syntax error : identifier 'DWORD'
adding
#include <windows.h>
#include <atlstr.h>
to this external utilities.h file solves the problem, but as its a 3rd party header I don’t believe I should be editing it, and considering these other demo projects #include the same header as I am, it seems to suggest that the problem lies elsewhere.
Can anyone think of a reason why this could be happening. The library I’m trying to use is Wwise (a sound engine). Here is a list of .libs im linking
AkSoundEngine.lib
AkMemoryMgr.lib
AkStreamMgr.lib
AkMusicEngine.lib
CommunicationCentral.lib
dxguid.lib
ws2_32.lib
dsound.lib
dinput8.lib
xinput.lib
Typically this is solved by changing the order your headers are included.
Assuming a file called
header.hhas the following:In you main:
Try: