Page 1 of 1

C:\Program Files\Microsoft DirectX SDK (August 2009)\Include

Posted: Mon Oct 19, 2009 11:31 am
by rohitchauhan802
I am compiling Ogre 1.6.4 with Codeblocks and MinGW with DirectX SDK August 2009 .

These are the errors .
Did anyone had this before so I can save some time .

C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|26|error: `__in' was not declared in this scope|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|27|warning: `__stdcall__' attribute only applies to function types|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|27|error: `__in' was not declared in this scope|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|46|warning: `__stdcall__' attribute only applies to function types|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|46|error: `__in' was not declared in this scope|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|47|warning: `__stdcall__' attribute only applies to function types|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|47|error: `__in' was not declared in this scope|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|71|warning: `__stdcall__' attribute only applies to function types|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|71|error: `__in_z' was not declared in this scope|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|71|error: `__in' was not declared in this scope|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|71|error: `__in' was not declared in this scope|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|71|error: `__in_z_opt' was not declared in this scope|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|71|error: `__in' was not declared in this scope|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|71|error: initializer expression list treated as compound expression|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|72|warning: `__stdcall__' attribute only applies to function types|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|72|error: `__in_z' was not declared in this scope|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|72|error: `__in' was not declared in this scope|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|72|error: `__in' was not declared in this scope|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|72|error: `__in_z_opt' was not declared in this scope|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|72|error: `__in' was not declared in this scope|
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|72|error: initializer expression list treated as compound expression|
||=== Build finished: 16 errors, 834 warnings ===|

Thanks for your time

Re: C:\Program Files\Microsoft DirectX SDK (August 2009)\Include

Posted: Mon Oct 19, 2009 12:51 pm
by synaptic
are you sure you have the sdk installed?

Re: C:\Program Files\Microsoft DirectX SDK (August 2009)\Include

Posted: Mon Oct 19, 2009 1:29 pm
by rohitchauhan802
Yes 500 MB + thing I downloaded and installed . Now , I removed MinGW and installed again , this time Latest Candidate Version instead of Current Version (Stable version i think ) . Same Errors

The error codeblocks shows is here , in DxErr.h File

HRESULT WINAPI DXTraceA( __in_z const char* strFile, __in DWORD dwLine, __in HRESULT hr, __in_z_opt const char* strMsg, __in BOOL bPopMsgBox );
HRESULT WINAPI DXTraceW( __in_z const char* strFile, __in DWORD dwLine, __in HRESULT hr, __in_z_opt const WCHAR* strMsg, __in BOOL bPopMsgBox );

********************************************************************************************************************************************
C:\Program Files\Microsoft DirectX SDK (August 2009)\Include\dxerr.h|71|error: `__in' was not declared in this scope|
********************************************************************************************************************************************

I am not exactly same level as a Programmer as mandrav or sinbad :) , so if anybody knows something could hint to sort it out , maybe its later useful for other people who want to use mingw+codeblocks

Re: C:\Program Files\Microsoft DirectX SDK (August 2009)\Include

Posted: Sun Oct 25, 2009 1:02 pm
by hd_
Looks like MSVC++ has some kind of code annotation extension. To get rid of the errors you are getting, add the following defines to the OgreD3D9Prerequisites.h header:
#define WINVER 0x500 // Multimonitor support requires WINVER >= 0x500 (Windows 2000 or greater)
#ifdef __MINGW32__
// (incomplete header) # include <specstrings.h> // define the MSVC++ extensions. Note: Possible conflicts with libstdc++
# define __in
# define __in_z
# define __in_z_opt
#endif

#define WIN32_LEAN_AND_MEAN
#define NOMINMAX // required to stop windows.h messing up std::min
#include <d3d9.h>
#include <d3dx9.h>
#include <dxerr.h>
I also needed to add that first line to get it working for me (I also needed to add that first line in the opengl render system prerequisites).

Re: C:\Program Files\Microsoft DirectX SDK (August 2009)\Include

Posted: Tue Oct 27, 2009 4:06 am
by thewonderidiot
I was getting the same error, and adding that stuff fixed it, but now I'm getting this:

Code: Select all

Linking dynamic library: ..\..\..\lib\RenderSystem_Direct3D9.dll
C:\mingw\bin\..\lib\gcc\mingw32\3.4.5\..\..\..\..\mingw32\bin\ld.exe: cannot find -ldxerr
collect2: ld returned 1 exit status
I'm using Code::Blocks 8.0.2 with the latest MinGW (I've tried the release, the candidate, and the old Toolbox for good measure) and the August 2009 DirectX SDK (have tried 2006 as well). Any ideas what's causing this?

EDIT:

Also, the latest dependencies for Code::Blocks are for 1.6.1, so that's what I've been using to try to compile this. Is there a newer version of the dependencies I should be using?

Re: C:\Program Files\Microsoft DirectX SDK (August 2009)\Inc

Posted: Tue Oct 27, 2009 11:29 am
by hd_
That problem is quite simple to fix- you need to link dxerr.lib. I have been working at getting 1.7 compiled over the last few days and I have finally succeeded with freeimage, ois, dx9 and opengl support :D There were several things that I had to change to get it working and I hope to be able to inform the ogre team of ways to make it easier for us mingw users.

Anyway, as far as dependencies go, bellow I have included my own dependencies package (I assume it will work for 1.6 - I started with the 1.6.1 dependencies and then recompiled OIS and FreeImage, included the August 2009 direct x files, new free type files, new cg files and I also use the newer directory structure, without the Samples/Common thing ).

Be sure to read the readme (quoted below), as you will almost certainly run into the problems listed there (solutions supplied). The d3d solution is potentially very shaky though, perhaps someone else will be able to figure out a better one than I came up with.

My MinGW Dependencies Package:
http://www.filefactory.com/file/b1932fc ... encies.zip
Mirror: http://www.hdsanctum.com/ogre/Dependencies.zip
(whoops, looks like I included the .svn directory in there- oh well- just delete/ignore it I guess. I hope I didn't violate any licenses supplying this.)

Just to help out other people who might run into these problems and try to google them:
(Note: The directory 'src to mingw_msvc_compat' is not part of the dependecies
package- it was just included for completeness')

Currently, you need to manually add some libraries when compiling some files with
cmake generated makefiles. This is fairly simple, you usually just follow the
directory of the module being compiled to:
SOMEMODULE\CMakeFiles\SOMEMODULE.dir
Then open link.txt and add the necessary libs.

Example, you will need to change the Sample Browser to link in some necessary
libraries (see below), so you would go to:
\build\Samples\Browser\CMakeFiles\SampleBrowser.dir
and find link.txt

------------------------------------------------------------
Libraries that currently need to be manually linked:

------------------------------
Error:
"undefined reference to `htons@4'"
"undefined reference to `htonl@4'"
etc ...

Solution:
The FreeImage static lib requires the following libraries to be linked:
-lwsock32 -lws2_32

------------------------------
Error:
"undefined reference to `IID_IDirectInput8A'"
"undefined reference to `DirectInput8Create@20'"
"undefined reference to `GUID_Slider'"
"undefined reference to `c_dfDIJoystick2'"
"undefined reference to `GUID_SysMouse'"
"undefined reference to `c_dfDIMouse2'"
etc ...

Solution:
The OIS static lib requires the following libraries to be linked:
"C:\ogre\Dependencies\lib\Release\dxguid.lib"
"C:\ogre\Dependencies\lib\Release\dinput8.lib"
[Or where ever you have extracted this Dependencies folder to- or if you like,
point it at you direct x sdk directory]

------------------------------
Error:
"undefined reference to `_chkstk'"
"undefined reference to `__security_cookie'"
"undefined reference to `@__security_check_cookie@4'"

Solution:
The D3D9 libraries were compiled with MSVC++. Currently, they will complain about
unknown references to _chkstk, __security_cookie and similar. I created the
following lib (containing mostly stubs) to convince the compiler everything is ok.
WARNING!: This is definitely an experimental hack, use at your own risk!

The D3d9 static libs require the following libraries to be linked:
"C:\ogre\Dependencies\lib\Release\libmingw_msvc_compat.a"


Edit: I fixed the broken download link. If it breaks again or you have any questions, feel free to PM me.

Re: C:\Program Files\Microsoft DirectX SDK (August 2009)\Include

Posted: Tue Jan 12, 2010 10:09 pm
by helium668
Hello,

I'm currently facing the same problem you described with mingw 3.4.5 and ogre 1.7rc1 :
Error:
"undefined reference to `_chkstk'"
"undefined reference to `__security_cookie'"
"undefined reference to `@__security_check_cookie@4'"

Solution:
The D3D9 libraries were compiled with MSVC++. Currently, they will complain about
unknown references to _chkstk, __security_cookie and similar. I created the
following lib (containing mostly stubs) to convince the compiler everything is ok.
WARNING!: This is definitely an experimental hack, use at your own risk!
I would like to know how you did create this library stub and also is your ogre3D working with D3D when
you add those modifications ? thanks ahead

he668

Re: C:\Program Files\Microsoft DirectX SDK (August 2009)\Include

Posted: Tue Jan 12, 2010 10:37 pm
by jacmoe
Maybe this works:
http://www.openframeworks.cc/setup/codeblocks
Grab the CodeBlocks Additions download.
That *could* work.