10-27-2016 08:15 AM
Hello all,
I believe this is a bug in CVI.
I can compile but not link programs that use the function SetRingItemAttribute(). Obviously other user interface functions work fine. I'm using CVI for Linux 13.0.0.30, and the documentation for that functions says that it's been in CVI since version 2012. The function is present in the userint.h installed on Linux, but absent from the various libcvi.so libraries.
Patch ? Workaround ?
10-28-2016 02:31 PM - edited 10-28-2016 02:35 PM
gdargaud,
I was looking into this, but did not find any documentation of this behavior occurring before. With that, I was of course not able to find a workaround or patch yet either. The best way to continue forward with this is for me to recreate the behavior to verify if this is in fact a bug. In recreating it, I can investigate whether we have any viable workarounds.
Could you please provide me with the exact steps you are following when you come across this behavior? I would like to be able to recreate this as accurately as possible. Please include your code as well, prefereably a stripped down version that is the smallest recreatable case of the misbehavior. I'll see if I can reproduce it and continue forward accordingly.
Note, if you don't want your code shared on a public forum, you can submit a bug report via this link.
Regards,
Will - Applications Engineer
11-02-2016 05:26 AM
Hello Willy,
the following program compiles and runs fine on Windows, but on Linux you get:
$ cvicc TestRing.prj Building Release configuration of /tmp/TestRing.prj Compiling /tmp/TestRing.c Link TestRing.exe /tmp/cvibuild.TestRing/Release/TestRing.o: In function `main': TestRing.c:(.text.startup+0x10a): undefined reference to `SetRingItemAttribute' collect2: error: ld returned 1 exit status Build failed.
11-03-2016 12:39 PM
gdargaud,
I looked into this a little more, I think there may be a way to include necessary libraries at compile time. What are you entering into the command line to compile this on your Linux system?
Also, I haven't had the chance to look myself, but are there any other functions in your code from the User Interface Library? Basically, anything on this list: http://zone.ni.com/reference/en-XX/help/370051V-01/cvi/uiref/cviuser_interface_library_function/
If so, do you get the same errors with those functions or not?
-Will
11-04-2016 05:37 AM - edited 11-04-2016 05:38 AM
OK, I took the whole list from that page and compiled it on Linux. Here are the results.
Simple typos on the page:
GetNumTableCellRingItems instead of GetNumTableCellRingsItems DiscardNumericColorRamp instead of DiscardColorRamp GetCVIWindowHandleForCurrThread instead of GetCVIWindowHandleforCurrThread
Missing from header file (doesn't compile):
MinimizeAllWindows
Windows specific functions (I guess):
RegisterWinMsgCallback UnRegisterWinMsgCallback GetCVIWindowHandle GetCVIWindowHandleForCurrThread NewActiveXCtrl NewActiveXCtrlFromFile GetObjHandleFromActiveXCtrl GetActiveXCtrlFromObjHandle DSBindCtrl DSBindPlot DSBindTableCellRange DSUnbind DSGetBoundPlotID
Functions present in the headers file and documentation but missing from the library files (linker error):
GetRingItemAttribute SetRingItemAttribute GetTreeCellRingItemAttribute SetTreeCellRingItemAttribute GetTableCellRingItemAttribute SetTableCellRingItemAttribute GetRealFontTypefaceNameLength GetRealFontTypefaceName
11-07-2016 02:21 PM
Gdargaud,
Are you compiling this for a 32-bit or 64-bit system?
I think it would be a good idea to focus on the Windows specific function and it is curious that they're missing. There might be some manual libraries we might be able to add but I think the system architecture would be helpful before going down that route.
11-08-2016 03:03 AM
It's perfectly normal for the Windows-specific functions to be missing on Linux, and it's documented that way. But the last list of functions I provided are NOT documented as missing on Linux, and are only user-interface related, so I don't see why they should be missing. And I need them !
I'm using Scientific Linux 7.2, 64-bits, but CVI is 32 bits anyway.
11-09-2016 12:45 PM
Gdargaud,
I think the best next step would be for me to replicate Scientific Linux 7.2 64-bits with CVI and see if I can replicate your behavior.
Is there anything else I should know when trying to do so?
I plan on making a fresh install and then running the TestRing.prj that you attached.
11-10-2016 02:05 AM
Do you mean if you try that function on an older or 32-bits SL, it works ? Here's the complete code to test all the functions. And the results:
$ cvicc TestRing.prj Building Release configuration of /tmp/TestRing.prj Compiling /tmp/TestRing.c Link TestRing.exe /tmp/cvibuild.TestRing/Release/TestRing.o: In function `main': TestRing.c:(.text.startup+0xfe): undefined reference to `SetRingItemAttribute' TestRing.c:(.text.startup+0x35d): undefined reference to `GetRingItemAttribute' TestRing.c:(.text.startup+0x365): undefined reference to `SetRingItemAttribute' TestRing.c:(.text.startup+0x4ad): undefined reference to `GetTreeCellRingItemAttribute' TestRing.c:(.text.startup+0x4b5): undefined reference to `SetTreeCellRingItemAttribute' TestRing.c:(.text.startup+0x94d): undefined reference to `GetTableCellRingItemAttribute' TestRing.c:(.text.startup+0x955): undefined reference to `SetTableCellRingItemAttribute' TestRing.c:(.text.startup+0xe6d): undefined reference to `GetRealFontTypefaceNameLength' TestRing.c:(.text.startup+0xe75): undefined reference to `GetRealFontTypefaceName' collect2: error: ld returned 1 exit status Build failed.
12-01-2016 05:16 AM
So, is this confirmed as a bug and will there be a fix on the next version ? BTW, when is the next Linux version of CVI due ? It's been over 3 years now...