This code was functioning on my coworker's solaris. So I'm sure its a linking error. We also had the exact same problem before, before I had reformatted my linux partition, and fixed it by fixing the lib paths. Could someone confirm that my compile command is valid? Then I would know that the problem is a missing library and I can go ask him about it.

I'm not sure if this would do anything to fix your problem, but have you tried compiling you program first, then linking it afterwards. Perhaps using a makefile? I had a similar sort of problem that seemed to work after I separated the compiling and linking procedures.

I'm not sure if this would do anything to fix your problem, but have you tried compiling you program first, then linking it afterwards. Perhaps using a makefile? I had a similar sort of problem that seemed to work after I separated the compiling and linking procedures.

I have using a makefile. Its simply:

Code:

all:
g++ the command listed above

But, I know thats not what you meant. I don't know how to produce a makefile that compiles and then links...

It basically compiles all the source files individually first before linking them. I was getting errors compiling and linking in one go, but that might have been because I was doing something wrong. IDK.

mike_g, the point of having a makefile is so that you can do only partial compilation of your program, whatever was changed since last time. To do that, you'll have to have separate rules for each of your source files.