LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

linker errors trying to use toolbox.h (toolbox.fp) on a realtime target

Hi,

I'm writing an application (OK technically a DLL but whatever) to run on a CVI Realtime controller.

I want to use both the list functionality (ListCreate, etc.) from toolbox.h and the ini file functions (Ini_New, etc.) from inifile.h.

I've added toolbox.fp and inifile.fp to my library list using: Customise Library Menu -> browse, but when I hit Run or Build -> Create Debuggable DLL I get 130 odd link errors. Here's a few examples:

 Undefined symbol '_MenuIsOpen' referenced in "toolbox.obj".
 Undefined symbol '_GlobalMemoryStatus@4' referenced in "toolbox.obj".
 Undefined symbol '_GetComputerNameA@8' referenced in "toolbox.obj".
 Undefined symbol '_GetUserNameA@8' referenced in "toolbox.obj".
 Undefined symbol '_GetVersionExA@4' referenced in "toolbox.obj".
 Undefined symbol '_DeleteDC@4' referenced in "toolbox.obj".
 Undefined symbol '_DeleteObject@4' referenced in "toolbox.obj".
 Undefined symbol '_GetDIBits@28' referenced in "toolbox.obj".
 Undefined symbol '_DefWindowProcA@16' referenced in "toolbox.obj".
 Undefined symbol '_CallWindowProcA@20' referenced in "toolbox.obj".
 Undefined symbol '_GetKeyboardType@4' referenced in "toolbox.obj".
 Undefined symbol '_CreatePopupMenu@0' referenced in "toolbox.obj".
 Undefined symbol '_DestroyMenu@4' referenced in "toolbox.obj".
 Undefined symbol '_GetMenuItemCount@4' referenced in "toolbox.obj".
 Undefined symbol '_TrackPopupMenu@28' referenced in "toolbox.obj".
 Undefined symbol '_InsertMenuItemA@16' referenced in "toolbox.obj".
 Undefined symbol '_GetMenuItemInfoA@16' referenced in "toolbox.obj".
 Undefined symbol '_SetMenuItemInfoA@16' referenced in "toolbox.obj".
 Undefined symbol '_GetMenuDefaultItem@12' referenced in "toolbox.obj".
 ...

 

Can anyone tell me where I'm going wrong with this please?

 

Thanks.

 

Adam.

0 Kudos
Message 1 of 11
(6,330 Views)
well, this adds the library, but you will need to add the include file to the source code, too, i.e.

#include <inifile.h>

0 Kudos
Message 2 of 11
(6,327 Views)

I can be pretty stupid sometimes but I did remember to add the #include <inifile.h> line to my code.

CVI automatically added #include "toolbox.h" to all of the files I use ListType in.

0 Kudos
Message 3 of 11
(6,323 Views)
sorry..., but you didn't mention in your post that you did include the ini file, so we had to guess. This was the simplest guess 🙂
0 Kudos
Message 4 of 11
(6,315 Views)

Hi Adam,

 

Unfortunately, the Programmer's Toolbox isn't yet supported in CVI Real-Time. I'm sorry that you didn't get a more informative message than simply a bunch of link errors.

 

However, off the top of my head, I can't think of any reason why the functions you want to use (ListCreate, etc...) couldn't work. Therefore, a possible workaround, although a bit messy, would be for you to copy and paste only the functions that you need to use from toolbox.c into your own souce code.

 

Luis

0 Kudos
Message 5 of 11
(6,275 Views)

Thanks for the reply Luis.

 

Not the answer I was hoping for but I had a suspision it might be the case. Could really do with NI sorting this out. It's a bit of a let down that CVI Real-Time is not as polished as it first looked.

 

In the mean time I think I shall do as you suggest and see how easy it is to copy the functions I want without all the other fluf coming with it.

 

Adam

Message 6 of 11
(6,270 Views)

LuisG wrote:

Hi Adam,

 

Unfortunately, the Programmer's Toolbox isn't yet supported in CVI Real-Time. I'm sorry that you didn't get a more informative message than simply a bunch of link errors.

 

However, off the top of my head, I can't think of any reason why the functions you want to use (ListCreate, etc...) couldn't work. Therefore, a possible workaround, although a bit messy, would be for you to copy and paste only the functions that you need to use from toolbox.c into your own souce code.

 

Luis


Is this ever planned to be supported by CVI Real-Time?  I figured that by using NI's own libraries that I was safe to port my code to real-time but am frustrated to find out that isn't the case.

Message 7 of 11
(6,187 Views)
Porting the toolbox to real-time is something that has been being discussed for a while,  but so far we haven't yet been able to fit it into our schedule. The reason it hasn't received as high a priority is because it's not a standard CVI library, and because it's open source, thus enabling programmers to just grab the pieces that they need.

 

However, both of you make a good point about the completeness of the real-time module. The distinction between standard CVI libraries and other libraries is increasingly blurry, so this is becoming somewhat of a spurious distinction. And since we are receiving specific requests for this, we'll definitely go ahead and raise the priority.

 

Luis

0 Kudos
Message 8 of 11
(6,166 Views)
Well I ripped the toolbox files apart and produced a set of stand alone List functions that suited my purposes. Not fully tested by any means but seem to work so far.
Download All
0 Kudos
Message 9 of 11
(6,158 Views)

I did the same for the Ini file functions. These need the List files.

Download All
0 Kudos
Message 10 of 11
(6,157 Views)