|
-
October 1st, 2010, 08:06 AM
#1
Linker error with purify
Are there any purify experts out there? I’m trying to run a newly installed version of purify on a Solaris 8 system and am having problems. I’ve tried to go to the IBM site to get help on this, but I’ve found absolutely nothing with any substance. Anyway, I thought I’d try here to see if someone could help me. Here’s the problem.
I wrote a very simple little program with memory leaks to test purify and this is what happens.
a. I can compile the program with a simple command as such. b. I can also compile the program with the debug flag as such.
Both a and b work just fine. But when I try to use purify, this is what happens.
c. I can compile the program with purify as such. d. I cannot compile the program in debug mode with purify as such. purify CC –g –o main main.C
When I try I get the following linker error…
Undefined symbol
int std::char_traits<char>::eof()
c works just fine with purify. The problem is since c wasn’t compiled in debug mode, you cannot check for memory leaks while the process is active, and more importantly, you cannot see the lines where the memory leaks occur (or at least the place where the leaked memory was allocated). In order to do this, you need to compile the code in debug mode.
Does anyone have any ideas why I’m getting the undefined symbol only when I use purify?
Thanks for any help that can be provided.
Note: I've also tried doing this in separate compiling and linking steps with the exact same results.
Last edited by sszd; October 1st, 2010 at 08:47 AM.
-
October 1st, 2010, 10:23 AM
#2
Re: Linker error with purify
Is the error a general linker error, or is it a purify error?
If it is a linker error, then the obvious first step is to see if the library where the C++ standard library exists is seen by the linker. How you do that within CC or that "purify" command-line is something you need to investigate.
More than likely, the linker settings are wrapped up in CC while they are incomplete or missing in the "purify" command.
Regards,
Paul McKenzie
-
October 1st, 2010, 01:00 PM
#3
Re: Linker error with purify
I'm actually having a similar trouble in Visual Studio.....release build works fine, but when I switch to debug I get a mysterious unresolved external symbol error that I really shouldn't be getting. It's the constructor for one of my classes. I'm looking right at it, I know it exists, even release mode knows it exists. But debug doesn't.....
If I figure out what's going on I'll let you know, although I doubt it's exactly the same problem.
-
October 1st, 2010, 02:27 PM
#4
Re: Linker error with purify
Thanks for your responses but I think I figured out what the problem was. I don't know why it appears to be doing this, but it looks like it's completely ignoring the LD_LIBRARY_PATH environment variable. So, the location of the standard C++ libraries were not being seen. If I force the paths to these libraries by using the -L and -R options on the compiler command line, then it actually works. Of course, this doesn't explain why I don't get the linker error in non-debug mode without having to force the paths.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|