CgProgramManager Plugin Error

mertainer

07-12-2010 20:22:10

I'm currently trying to add CgProgramManager Plugin to my application, but everytime I add it as a plugin to the plugins.cfg file, when debugging the game it crashes on launch.

The following error is output.


I'm currently using MOGRE 1.7.1.0 with VB.NET 2010, with .NET framework 4.0.

I've also tried compiling MOGRE from the source but whenether I try to run the game using those DLL's the game will crash on launch.

Thank you in advance.

GantZ

08-12-2010 18:06:59

could you post your ogre.log content ? is the cg.dll and the cgProgramManager on the same directory ?

mertainer

08-12-2010 20:11:25

Here's the plugins.cfg file:
# Defines plugins to load

# Define plugin folder
PluginFolder=.

# Define plugins
Plugin=RenderSystem_Direct3D9
Plugin=RenderSystem_GL
Plugin=Plugin_OctreeSceneManager
Plugin=Plugin_CgProgramManager_d


And here's the ogre.log file:
20:11:01: Creating resource group General
20:11:01: Creating resource group Internal
20:11:01: Creating resource group Autodetect
20:11:01: SceneManagerFactory for type 'DefaultSceneManager' registered.
20:11:01: Registering ResourceManager for type Material
20:11:01: Registering ResourceManager for type Mesh
20:11:01: Registering ResourceManager for type Skeleton
20:11:01: MovableObjectFactory for type 'ParticleSystem' registered.
20:11:01: OverlayElementFactory for type Panel registered.
20:11:01: OverlayElementFactory for type BorderPanel registered.
20:11:01: OverlayElementFactory for type TextArea registered.
20:11:01: Registering ResourceManager for type Font
20:11:01: ArchiveFactory for archive type FileSystem registered.
20:11:01: ArchiveFactory for archive type Zip registered.
20:11:01: DDS codec registering
20:11:01: FreeImage version: 3.13.1
20:11:01: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
20:11:01: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic,bay,bmq,cr2,crw,cs1,dc2,dcr,dng,erf,fff,hdr,k25,kdc,mdc,mos,mrw,nef,orf,pef,pxn,raf,raw,rdc,sr2,srf,arw,3fr,cine,ia,kc2,mef,nrw,qtk,rw2,sti,drf,dsc,ptx,cap,iiq,rwz
20:11:01: PVRTC codec registering
20:11:01: Registering ResourceManager for type HighLevelGpuProgram
20:11:01: Registering ResourceManager for type Compositor
20:11:01: MovableObjectFactory for type 'Entity' registered.
20:11:01: MovableObjectFactory for type 'Light' registered.
20:11:01: MovableObjectFactory for type 'BillboardSet' registered.
20:11:01: MovableObjectFactory for type 'ManualObject' registered.
20:11:01: MovableObjectFactory for type 'BillboardChain' registered.
20:11:01: MovableObjectFactory for type 'RibbonTrail' registered.
20:11:01: Loading library .\RenderSystem_Direct3D9
20:11:01: Installing plugin: D3D9 RenderSystem
20:11:01: D3D9 : Direct3D9 Rendering Subsystem created.
20:11:01: D3D9: Driver Detection Starts
20:11:01: D3D9: Driver Detection Ends
20:11:01: Plugin successfully installed
20:11:01: Loading library .\RenderSystem_GL
20:11:01: Installing plugin: GL RenderSystem
20:11:01: OpenGL Rendering Subsystem created.
20:11:01: Plugin successfully installed
20:11:01: Loading library .\Plugin_OctreeSceneManager
20:11:01: Installing plugin: Octree & Terrain Scene Manager
20:11:01: Plugin successfully installed
20:11:01: Loading library .\Plugin_CgProgramManager_d
20:11:04: *-*-* OGRE Shutdown
20:11:04: Unregistering ResourceManager for type Compositor
20:11:04: Unregistering ResourceManager for type Font
20:11:04: Unregistering ResourceManager for type Skeleton
20:11:04: Unregistering ResourceManager for type Mesh
20:11:04: Unregistering ResourceManager for type HighLevelGpuProgram


EDIT: I have the cg.dll file and the plugin dll on the same directory as the executable.

GantZ

08-12-2010 21:49:18

You use the Plugin_CgProgramManager_d, which is the debug version of the plugin. since the other plugin are not the debug version, i assume you use the release version of mogre. In this case, you must use the release version of the plugin, the one that don't have _d at the end. You must avoid mixing debug / release version of plugins.

mertainer

08-12-2010 22:58:49

I've changed to the Release version of cg and it's plugin and instead the following error occurs:



Ogre.log
22:56:24: Creating resource group General
22:56:24: Creating resource group Internal
22:56:24: Creating resource group Autodetect
22:56:24: SceneManagerFactory for type 'DefaultSceneManager' registered.
22:56:24: Registering ResourceManager for type Material
22:56:24: Registering ResourceManager for type Mesh
22:56:24: Registering ResourceManager for type Skeleton
22:56:24: MovableObjectFactory for type 'ParticleSystem' registered.
22:56:24: OverlayElementFactory for type Panel registered.
22:56:24: OverlayElementFactory for type BorderPanel registered.
22:56:24: OverlayElementFactory for type TextArea registered.
22:56:24: Registering ResourceManager for type Font
22:56:24: ArchiveFactory for archive type FileSystem registered.
22:56:24: ArchiveFactory for archive type Zip registered.
22:56:24: DDS codec registering
22:56:24: FreeImage version: 3.13.1
22:56:24: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
22:56:24: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic,bay,bmq,cr2,crw,cs1,dc2,dcr,dng,erf,fff,hdr,k25,kdc,mdc,mos,mrw,nef,orf,pef,pxn,raf,raw,rdc,sr2,srf,arw,3fr,cine,ia,kc2,mef,nrw,qtk,rw2,sti,drf,dsc,ptx,cap,iiq,rwz
22:56:24: PVRTC codec registering
22:56:24: Registering ResourceManager for type HighLevelGpuProgram
22:56:24: Registering ResourceManager for type Compositor
22:56:24: MovableObjectFactory for type 'Entity' registered.
22:56:24: MovableObjectFactory for type 'Light' registered.
22:56:24: MovableObjectFactory for type 'BillboardSet' registered.
22:56:24: MovableObjectFactory for type 'ManualObject' registered.
22:56:24: MovableObjectFactory for type 'BillboardChain' registered.
22:56:24: MovableObjectFactory for type 'RibbonTrail' registered.
22:56:24: Loading library .\RenderSystem_Direct3D9
22:56:24: Installing plugin: D3D9 RenderSystem
22:56:24: D3D9 : Direct3D9 Rendering Subsystem created.
22:56:24: D3D9: Driver Detection Starts
22:56:24: D3D9: Driver Detection Ends
22:56:24: Plugin successfully installed
22:56:24: Loading library .\RenderSystem_GL
22:56:24: Installing plugin: GL RenderSystem
22:56:24: OpenGL Rendering Subsystem created.
22:56:25: Plugin successfully installed
22:56:25: Loading library .\Plugin_OctreeSceneManager
22:56:25: Installing plugin: Octree & Terrain Scene Manager
22:56:25: Plugin successfully installed
22:56:25: Loading library .\Plugin_CgProgramManager
22:56:30: OGRE EXCEPTION(7:InternalErrorException): Could not load dynamic library .\Plugin_CgProgramManager. System Error: The specified procedure could not be found.

in DynLib::load at ..\..\ogre\OgreMain\src\OgreDynLib.cpp (line 91)

GantZ

10-12-2010 18:21:26

do you use the correct version of the cg plugin ? (the one that come with the mogre package) seem like you try to load a library that haven't been built against mogre. Try to open it in dependency walker : http://www.dependencywalker.com/, and see if it can load it without error. also, double check that you use a valid Plugin_CgProgramManager.

mertainer

12-12-2010 23:10:21

When trying to open dependencywalker with cg.dll, i get an error if i use the x64 version of the program. If I use the x86 it works fine. Should this problem be related with a x64 OS?

I've tried the plugin from the MogreSDK release folder and the program runs, although when it starts to initialise resources it returns a AccessViolationException.

Here's the Ogre.log file:

23:08:24: Creating resource group General
23:08:24: Creating resource group Internal
23:08:24: Creating resource group Autodetect
23:08:24: SceneManagerFactory for type 'DefaultSceneManager' registered.
23:08:24: Registering ResourceManager for type Material
23:08:24: Registering ResourceManager for type Mesh
23:08:24: Registering ResourceManager for type Skeleton
23:08:24: MovableObjectFactory for type 'ParticleSystem' registered.
23:08:24: OverlayElementFactory for type Panel registered.
23:08:24: OverlayElementFactory for type BorderPanel registered.
23:08:24: OverlayElementFactory for type TextArea registered.
23:08:24: Registering ResourceManager for type Font
23:08:24: ArchiveFactory for archive type FileSystem registered.
23:08:24: ArchiveFactory for archive type Zip registered.
23:08:24: DDS codec registering
23:08:24: FreeImage version: 3.13.1
23:08:24: This program uses FreeImage, a free, open source image library supporting all common bitmap formats. See http://freeimage.sourceforge.net for details
23:08:24: Supported formats: bmp,ico,jpg,jif,jpeg,jpe,jng,koa,iff,lbm,mng,pbm,pbm,pcd,pcx,pgm,pgm,png,ppm,ppm,ras,tga,targa,tif,tiff,wap,wbmp,wbm,psd,cut,xbm,xpm,gif,hdr,g3,sgi,exr,j2k,j2c,jp2,pfm,pct,pict,pic,bay,bmq,cr2,crw,cs1,dc2,dcr,dng,erf,fff,hdr,k25,kdc,mdc,mos,mrw,nef,orf,pef,pxn,raf,raw,rdc,sr2,srf,arw,3fr,cine,ia,kc2,mef,nrw,qtk,rw2,sti,drf,dsc,ptx,cap,iiq,rwz
23:08:24: PVRTC codec registering
23:08:24: Registering ResourceManager for type HighLevelGpuProgram
23:08:24: Registering ResourceManager for type Compositor
23:08:24: MovableObjectFactory for type 'Entity' registered.
23:08:24: MovableObjectFactory for type 'Light' registered.
23:08:24: MovableObjectFactory for type 'BillboardSet' registered.
23:08:24: MovableObjectFactory for type 'ManualObject' registered.
23:08:24: MovableObjectFactory for type 'BillboardChain' registered.
23:08:24: MovableObjectFactory for type 'RibbonTrail' registered.
23:08:24: Loading library .\RenderSystem_Direct3D9
23:08:24: Installing plugin: D3D9 RenderSystem
23:08:24: D3D9 : Direct3D9 Rendering Subsystem created.
23:08:24: D3D9: Driver Detection Starts
23:08:24: D3D9: Driver Detection Ends
23:08:24: Plugin successfully installed
23:08:24: Loading library .\RenderSystem_GL
23:08:24: Installing plugin: GL RenderSystem
23:08:24: OpenGL Rendering Subsystem created.
23:08:25: Plugin successfully installed
23:08:25: Loading library .\Plugin_OctreeSceneManager
23:08:25: Installing plugin: Octree & Terrain Scene Manager
23:08:25: Plugin successfully installed
23:08:25: Loading library .\Plugin_CgProgramManager
23:08:25: Installing plugin:
23:08:25: Plugin successfully installed
23:08:25: *-*-* OGRE Initialising
23:08:25: *-*-* Version 1.7.1 (Cthugha)
23:08:25: Creating resource group Bootstrap
23:08:25: Added resource location 'Media/packs/OgreCore.zip' of type 'Zip' to resource group 'Bootstrap'
23:08:25: Creating resource group Caelum
23:08:25: Added resource location 'Media/Caelum' of type 'FileSystem' to resource group 'Caelum'
23:08:25: Creating resource group GUI
23:08:25: Added resource location 'Media/gui' of type 'FileSystem' to resource group 'GUI'
23:08:25: Added resource location 'Media' of type 'FileSystem' to resource group 'General'
23:08:25: Added resource location 'Media/fonts' of type 'FileSystem' to resource group 'General'
23:08:25: Added resource location 'Media/materials/programs' of type 'FileSystem' to resource group 'General'
23:08:25: Added resource location 'Media/materials/scripts' of type 'FileSystem' to resource group 'General'
23:08:25: Added resource location 'Media/materials/textures' of type 'FileSystem' to resource group 'General'
23:08:25: Added resource location 'Media/models' of type 'FileSystem' to resource group 'General'
23:08:25: Added resource location 'Media/packs/cubemap.zip' of type 'Zip' to resource group 'General'
23:08:25: Added resource location 'Media/packs/skybox.zip' of type 'Zip' to resource group 'General'
23:08:25: Creating resource group l0
23:08:25: Added resource location 'Media/Levels/l0' of type 'FileSystem' to resource group 'l0'
23:08:25: Creating resource group l1
23:08:25: Added resource location 'Media/Levels/l1' of type 'FileSystem' to resource group 'l1'
23:08:25: D3D9 : RenderSystem Option: Allow NVPerfHUD = No
23:08:25: D3D9 : RenderSystem Option: FSAA = 0
23:08:25: D3D9 : RenderSystem Option: Floating-point mode = Fastest
23:08:25: D3D9 : RenderSystem Option: Full Screen = No
23:08:25: D3D9 : RenderSystem Option: Rendering Device = Monitor-1-NVIDIA GeForce GT 240
23:08:25: D3D9 : RenderSystem Option: Resource Creation Policy = Create on all devices
23:08:25: D3D9 : RenderSystem Option: VSync = No
23:08:25: D3D9 : RenderSystem Option: VSync Interval = 1
23:08:25: D3D9 : RenderSystem Option: Video Mode = 1024 x 768 @ 32-bit colour
23:08:25: D3D9 : RenderSystem Option: sRGB Gamma Conversion = No
23:08:29: CPU Identifier & Features
23:08:29: -------------------------
23:08:29: * CPU ID: GenuineIntel: Intel(R) Core(TM)2 Quad CPU Q8300 @ 2.50GHz
23:08:29: * SSE: yes
23:08:29: * SSE2: yes
23:08:29: * SSE3: yes
23:08:29: * MMX: yes
23:08:29: * MMXEXT: yes
23:08:29: * 3DNOW: no
23:08:29: * 3DNOWEXT: no
23:08:29: * CMOV: yes
23:08:29: * TSC: yes
23:08:29: * FPU: yes
23:08:29: * PRO: yes
23:08:29: * HT: no
23:08:29: -------------------------
23:08:29: D3D9 : Subsystem Initialising
23:08:29: Registering ResourceManager for type Texture
23:08:29: Registering ResourceManager for type GpuProgram
23:08:29: D3D9RenderSystem::_createRenderWindow "Jogo Sem Nome", 1024x768 windowed miscParams: FSAA=0 FSAAHint= colourDepth=32 gamma=false monitorIndex=0 useNVPerfHUD=false vsync=false vsyncInterval=1
23:08:29: D3D9 : Created D3D9 Rendering Window 'Jogo Sem Nome' : 1024x768, 32bpp
23:08:29: D3D9 : WARNING - disabling VSync in windowed mode can cause timing issues at lower frame rates, turn VSync on if you observe this problem.
23:08:29: D3D9: Vertex texture format supported - PF_FLOAT16_RGB
23:08:29: D3D9: Vertex texture format supported - PF_FLOAT16_RGBA
23:08:29: D3D9: Vertex texture format supported - PF_FLOAT32_RGB
23:08:29: D3D9: Vertex texture format supported - PF_FLOAT32_RGBA
23:08:29: D3D9: Vertex texture format supported - PF_FLOAT16_R
23:08:29: D3D9: Vertex texture format supported - PF_FLOAT32_R
23:08:29: D3D9: Vertex texture format supported - PF_FLOAT16_GR
23:08:29: D3D9: Vertex texture format supported - PF_FLOAT32_GR
23:08:29: RenderSystem capabilities
23:08:29: -------------------------
23:08:29: RenderSystem Name: Direct3D9 Rendering Subsystem
23:08:29: GPU Vendor: nvidia
23:08:29: Device Name: Monitor-1-NVIDIA GeForce GT 240
23:08:29: Driver Version: 8.17.12.6063
23:08:29: * Fixed function pipeline: yes
23:08:29: * Hardware generation of mipmaps: yes
23:08:29: * Texture blending: yes
23:08:29: * Anisotropic texture filtering: yes
23:08:29: * Dot product texture operation: yes
23:08:29: * Cube mapping: yes
23:08:29: * Hardware stencil buffer: yes
23:08:29: - Stencil depth: 8
23:08:29: - Two sided stencil support: yes
23:08:29: - Wrap stencil values: yes
23:08:29: * Hardware vertex / index buffers: yes
23:08:29: * Vertex programs: yes
23:08:29: * Number of floating-point constants for vertex programs: 256
23:08:29: * Number of integer constants for vertex programs: 16
23:08:29: * Number of boolean constants for vertex programs: 16
23:08:29: * Fragment programs: yes
23:08:29: * Number of floating-point constants for fragment programs: 224
23:08:29: * Number of integer constants for fragment programs: 16
23:08:29: * Number of boolean constants for fragment programs: 16
23:08:29: * Geometry programs: no
23:08:29: * Number of floating-point constants for geometry programs: 0
23:08:29: * Number of integer constants for geometry programs: 0
23:08:29: * Number of boolean constants for geometry programs: 0
23:08:29: * Supported Shader Profiles: hlsl ps_1_1 ps_1_2 ps_1_3 ps_1_4 ps_2_0 ps_2_a ps_2_b ps_2_x ps_3_0 vs_1_1 vs_2_0 vs_2_a vs_2_x vs_3_0
23:08:29: * Texture Compression: yes
23:08:29: - DXT: yes
23:08:29: - VTC: no
23:08:29: - PVRTC: no
23:08:29: * Scissor Rectangle: yes
23:08:29: * Hardware Occlusion Query: yes
23:08:29: * User clip planes: yes
23:08:29: * VET_UBYTE4 vertex element type: yes
23:08:29: * Infinite far plane projection: yes
23:08:29: * Hardware render-to-texture: yes
23:08:29: * Floating point textures: yes
23:08:29: * Non-power-of-two textures: yes
23:08:29: * Volume textures: yes
23:08:29: * Multiple Render Targets: 4
23:08:29: - With different bit depths: yes
23:08:29: * Point Sprites: yes
23:08:29: * Extended point parameters: yes
23:08:29: * Max Point Size: 10
23:08:29: * Vertex texture fetch: yes
23:08:29: * Number of world matrices: 0
23:08:29: * Number of texture units: 8
23:08:29: * Stencil buffer depth: 8
23:08:29: * Number of vertex blend matrices: 0
23:08:29: - Max vertex textures: 4
23:08:29: - Vertex textures shared: no
23:08:29: * Render to Vertex Buffer : no
23:08:29: * DirectX per stage constants: yes
23:08:29: ***************************************
23:08:29: *** D3D9 : Subsystem Initialised OK ***
23:08:29: ***************************************
23:08:29: DefaultWorkQueue('Root') initialising on thread main.
23:08:29: Particle Renderer Type 'billboard' registered
23:08:29: SceneManagerFactory for type 'OctreeSceneManager' registered.
23:08:29: SceneManagerFactory for type 'TerrainSceneManager' registered.
23:08:29: Initialising resource group General
23:08:29: Parsing scripts for resource group General

mertainer

23-12-2010 02:21:11

bump. anyone?

mertainer

17-01-2011 15:32:01

Seems that if I use mRoot.EnablePlugin after all the resources are loaded there ain't an error. But whenever I try to use, for example, CaelumSharp with a cg shader, It says that it doesn't have any supported techniques.