03-23-2009 08:41 AM
Solved! Go to Solution.
03-23-2009 11:09 AM
Hi JoeKenZ,
There was a memory leak that was fixed in CVI 8.5. Are you using an older version than that?
Luis
03-23-2009 11:15 AM
03-23-2009 11:31 AM - edited 03-23-2009 11:31 AM
There's no patch for 8.0.0, if that's you mean.
But since the Programmer's Toolbox is open-source, you can easily fix it yourself:
In line 3365 of the 8.0.0 version of C:\Program Files\National Instruments\CVI80\toolslib\toolbox\toolbox.c, you need to add the following ListDispose function call:
if (RectContainsPoint (bounds, point))
{
PointConvertCoordinates (panel, child, &point, FALSE);
ListDispose (sortedChildren);
return PointToPanel (child, point);
}
After you make the change, you'll need to recompile the file (Options>>Create Object File) to regenerate the object file, and then restart CVI.
Luis
03-23-2009 11:56 AM
Beautiful, thank you.
03-24-2009 05:40 AM
03-25-2009 11:22 AM
Guillaume,
This command line should work (called from the root cvi directory)
gcc -fPIC -O2 -D_REENTRANT -D_BSD_SOURCE -D_SVID_SOURCE -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I./include -I./toolslib/toolbox-I./toolslib/custctrl/custsupp toolslib/toolbox/toolbox.c -o toolslib/toolbox/toolbox.o
You will also need write access to the CVIDIR/toolslib/toolbox directory for the command to succeed.
I don't think any of the defines are really required, but they are in the makefile we used to build the original object.
Also calling cvicc toolbox.c should probably work, but I can't currently test it.
Michael
NI
03-27-2009 11:40 AM
03-21-2012 04:02 AM
Hello Michael,
I just tried to recompile the toolbox, but here's what I get. Something must have changed between version 8 and version 2010...
$ cd /usr/local/natinst/cvi2010; sudo chown -R someuser . $ gcc -fPIC -O2 -D_REENTRANT -D_BSD_SOURCE -D_SVID_SOURCE -D_XOPEN_SOURCE=500 -D_GNU_SOURCE -I./include -I./toolslib/toolbox -I./toolslib/custctrl/custsupp toolslib/toolbox/toolbox.c -o toolslib/toolbox/toolbox.o /usr/lib/gcc/i386-redhat-linux/4.1.2/../../../crt1.o: In function `_start': (.text+0x18): undefined reference to `main' /tmp/ccULcfdP.o: In function `CVIAbsoluteTimeFromCNVTime': toolbox.c:(.text+0x2154): undefined reference to `CVIAbsoluteTimeFromTimeUnit' /tmp/ccULcfdP.o: In function `CVIAbsoluteTimeFromCVIANSITime': toolbox.c:(.text+0x21c9): undefined reference to `CVIAbsoluteTimeFromTimeUnit' /tmp/ccULcfdP.o: In function `CVIAbsoluteTimeToCNVTime': toolbox.c:(.text+0x2257): undefined reference to `CVIAbsoluteTimeToTimeUnit' /tmp/ccULcfdP.o: In function `CVIAbsoluteTimeToCVIANSITime': toolbox.c:(.text+0x22f0): undefined reference to `CVIAbsoluteTimeToTimeUnit' /tmp/ccULcfdP.o: In function `CVIAbsoluteTimeFromCVIUILTime': toolbox.c:(.text+0x237b): undefined reference to `GetDateTimeElements' toolbox.c:(.text+0x23e5): undefined reference to `CVIAbsoluteTimeFromLocalCalendar' /tmp/ccULcfdP.o: In function `CVIAbsoluteTimeToCVIUILTime': toolbox.c:(.text+0x2495): undefined reference to `CVIAbsoluteTimeToLocalCalendar' toolbox.c:(.text+0x24e0): undefined reference to `MakeDateTime' /tmp/ccULcfdP.o: In function `PostDeferredCallToThreadAndWait': toolbox.c:(.text+0x25a8): undefined reference to `CmtGetCurrentThreadID' toolbox.c:(.text+0x25cc): undefined reference to `Timer' toolbox.c:(.text+0x25e8): undefined reference to `PostDeferredCallToThread' toolbox.c:(.text+0x2607): undefined reference to `Timer' /tmp/ccULcfdP.o: In function `ToolBoxAtExitFunction': toolbox.c:(.text+0x2bed): undefined reference to `CVIRTEHasBeenDetached' /tmp/ccULcfdP.o: In function `DelayQueueDispose': toolbox.c:(.text+0x2c73): undefined reference to `DiscardCtrl' toolbox.c:(.text+0x2c88): undefined reference to `DiscardPanel' /tmp/ccULcfdP.o: In function `FreeThreadLocalResourcesCallback': toolbox.c:(.text+0x2ce4): undefined reference to `DiscardPanel' /tmp/ccULcfdP.o: In function `ComparePanelZPlaneOrder': toolbox.c:(.text+0x2daa): undefined reference to `GetPanelAttribute' toolbox.c:(.text+0x2dc6): undefined reference to `GetPanelAttribute'
...
03-21-2012 08:19 AM
Oops, I missed a very important option. You need to add a '-c' to the gcc command line to tell it to just compile the c file and not try to link it into an executable. Anywhere on the command line should be fine, but I would put it right before the '-o toolslib/toolbox/toolbox.o' part of the command line.
-Michael
NI