Upgrading to Cg v1.2 - problem and solution for Linux.

Become a member of the CGSociety

Connect, Share, and Learn with our Large Growing CG Art Community. It's Free!

Thread Tools Display Modes
  03 March 2004
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:

pc@linux.my$ 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.
  01 January 2006
Thread automatically closed

This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.
CGTalk Policy/Legalities
Note that as CGTalk Members, you agree to the terms and conditions of using this website.
Thread Closed share thread

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Society of Digital Artists

Powered by vBulletin
Copyright 2000 - 2006,
Jelsoft Enterprises Ltd.
Minimize Ads
Forum Jump

All times are GMT. The time now is 07:34 AM.

Powered by vBulletin
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.