|03 March 2004||#1|
Computer Graphics Researcher
Upgrading to Cg v1.2 - problem and solution for Linux.
Here I describe two problems compiling Cg 1.1 demos and upgrading from Cg v1.1 to Cg v1.2 which seem to be common and can waste significant time and efforts to unexperienced developers.
First if anyone has problems compiling the Cg 1.1 demos that come with the SDK for Linux and complaining about glut whatever, just go to: http://www.csit.fsu.edu/~blanco/Cg/Cg_projects.htm and pay attention to the lines describing how to modify the Makefile, by adding some library paths. (should be done for the Mekafile in each demo's directory)
Well this works OK with version Cg v1.1. So I was working for a while and everything was just fine. Unfortunately if you upgrade to the new Cg v1.2 which is available from nVidia since end of February you may appear to have problems compiling your *.c or *.cpp files with the Makefile you already have.
Although the Cg compiler is working and you can compile the file with command like that:
firstname.lastname@example.org$ cgc -profile vp30 -o vertexProfile.vp vertexProfile.cg
you will not be able to compile the Cg loading program or even execute already compiled one. In my case I got several erros about undefined references in pthread_**** in lib /usr/lib/libCg.so on my Slackweare 9.1. It appears that additional pthread library should be added to the linker path. So what you can do is to open your Makefile and assure that you have -pthread statement in one of the following lines: (usually only one you should have not both lines)
LFLAGS= -L/usr/X11R6/lib -lXmu -lXi -lCgGL -lCg -lglut -lGLU -lGL -pthread
LLDLIBS = -lm -lXm -lCgGL -lCg -lGL -lGLU -lglut -lXi -pthread
After correcting the libs paths everything has to be fine.
I want to thank Jason Allen who enlightened me on this solution for hte second problem. Thanks Jason.
|Thread Closed share thread|