Okay, so I went back through and tried to do things in a new way. I'm still stuck, however.
I'm using Visual Studio 2008, Irrlicht 1.5. I downloaded the IrrCg from the SVN.
I copied the IrrCg.cpp and IrrCg.h files into their own folder and made a project with only those files in it. The project has the same settings as my game project, except I also put in the "Include" section the "../Irrlicht-1.5/source/Irrlicht" folder because IrrCg won't compile without it.
I set it to Release mode and changed the output to a static library like you suggested, Nadro
This produces a IrrCg.lib file and a IrrCg.obj file. At this point I'm a little confused.
Anyway, I grab the IrrCg.lib file (which is 2,134KB) and put it in the same folder as my Irrlicht.lib file, so I don't have to add any additional directories.
To test, I put it in my game project. The relevant code is:
Code: Select all
#include <irrlicht.h>
#include <Cg/cg.h>
#include "IrrCg.h"
// In the Irrlicht Engine, everything can be found in the namespace 'irr'.
using namespace irr;
// There are 5 sub namespaces in the Irrlicht Engine.
using namespace core;
using namespace scene;
using namespace video;
using namespace io;
using namespace gui;
//irrcg namespace
using namespace IrrCg;
/ To be able to use the Irrlicht.DLL file, we need to link with the Irrlicht.lib.
#ifdef _IRR_WINDOWS_
#pragma comment(lib, "Irrlicht.lib")
#pragma comment(lib, "IrrNewt.lib")
#pragma comment(lib, "IrrCg.lib")
#pragma warning(disable: 4800) //stupid boolean performance warning
#endif
At this point, the game still runs.
![Smile :)](./images/smilies/icon_smile.gif)
I'm feeling optimistic, but I haven't done anything with IrrCg yet.
So here we go! I try just to initialize IrrCg with the following code:
Code: Select all
//create the device
IrrlichtDevice* device = createDeviceEx(paramIrr);
if(!device)
return 1; //the device failed to create itself, so quit early
// Create Cg Programming Service
ICgProgrammingServices* GPU = new ICgProgrammingServices(device);
... no luck! I get a bunch of errors! I've removed a bunch to save space because they're all the same type of error:
Code: Select all
1>IrrCg.lib(IrrCg.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib 'msvcrt.lib' conflicts with use of other libs; use /NODEFAULTLIB:library
1>IrrCg.lib(IrrCg.obj) : error LNK2001: unresolved external symbol _cgGLDisableProfile
1>IrrCg.lib(IrrCg.obj) : error LNK2001: unresolved external symbol __imp__cgD3D9BindProgram
1>IrrCg.lib(IrrCg.obj) : error LNK2001: unresolved external symbol _cgSetParameter3d
...
...
1>IrrCg.lib(IrrCg.obj) : error LNK2001: unresolved external symbol _cgSetParameter4i
1>C:\Documents and Settings\RJ Layton\Desktop\thesis\mars\Debug\mars.exe : fatal error LNK1120: 34 unresolved externals
I'm a little confused because it keeps saying "IrrCg.obj" even though I haven't moved it like I did with IrrCg.lib. I'm really not too strong on compilers and stuff
So of course I run through the thread to try and figure out if I forgot anything. On page 4, Nadro suggests including the following:
Code: Select all
#pragma comment (lib,"cg.lib")
#pragma comment (lib,"IrrCg.lib")
#pragma comment (lib,"cgD3D9.lib")
#pragma comment (lib,"cgGL.lib")
I put that in my pragma comment stack...
Code: Select all
Error 40 fatal error LNK1104: cannot open file 'cg.lib'
Okay, so I take that one line out...
Code: Select all
>IrrCg.lib(IrrCg.obj) : MSIL .netmodule or module compiled with /GL found; restarting link with /LTCG; add /LTCG to the link command line to improve linker performance
1>LINK : fatal error LNK1104: cannot open file 'cgD3D9.lib'
Okay... can't find cgD3D9.lib either... so of course the same error comes up with cgGL.lib too.
What I don't understand is why it can't find these files... though they are .dll files. Inside "C:\Program Files\NVIDIA Corporation\Cg\bin" there are a bunch of .dll files like Nadro included with his examples... cg.dll, cdD3D9.dll, cgGL.dll.... And I have this folder included in my "executable" section in project settings.
Anyway I feel really lost
![Sad :(](./images/smilies/icon_sad.gif)
Hopefully all this documentation will lead to some help. Sorry for pestering, Nadro! I really appreciate the help.