LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Problem in calling strtoll function in stdlibex.h

Hi all,

I encounter a problem when migrating my software, which using inifile instrument. I found problem in stdlibex.h and have the following error in compile:

2 Project link errors
Undefined symbol '_strtoll' referenced in "inifile.obj"
Undefined symbol '_strtoull' referenced in "inifile.obj"

then I try using strtoll function in a separate new project as attached, and found the below error:

1 Project linke error
Undefined symbol '_strtoll' referenced in "TryStdlibex.c"

I re-install LabWindows/CVI and still get the problem.

May anyone help?
Thanks in advance.
0 Kudos
Message 1 of 8
(4,625 Views)
In which version of CVI are you getting these link errors? I think the problem you're having is that your using the version of inifile.obj that came with CVI 8.5, yet you're trying to use it in a project that you're building with a version of CVI that is older than 8.5.

Those two functions were only added to CVI in version 8.5, and that is also when inifile began using them. Previous versions of CVI had only the equivalent strtol64 and strtoul64 functions.

Luis
0 Kudos
Message 2 of 8
(4,615 Views)

Hello LuisG,

 

Sorry for no response for so long.

 

I am using LabWindows/CVI 8.5 already and I have removed the CVI 8.1 before installation.

 

The strange thing is I cannot even compile "C:\Program Files\National Instruments\CVI85\toolslib\toolbox" that come from CVI with the same error! 

 

After I change to the two functions you mentioned, the same error persist. I attached the files i modified.

 

Please help 

 

Thanks in advance

 

km9394 

0 Kudos
Message 3 of 8
(4,552 Views)

This is very strange. It really is as if you were using an older version of the CVI compiler, instead of CVI 8.5. I assume that you have checked the Help>>About box to confirm that this CVI 8.5?

 

The problem is not with inifile.c. That file is expected to have references to strtoll. Let's try a couple of simpler tests:

 

1. Can you expand the "Libraries" tree in the bottom left of your workspace, and confirm that there is a "strtoll" function panel under ANSI C>>General Utilities>>String to Arithmetic Expressio?

 

2. In the CVI interactive window (or a completely new project) can you try to compile the following code:

 

#include <ansi_c.h>
static long long    n;
n = strtoll ("9876543210", 0, 10);

 

Let me know what you find.

 

Luis

Message Edited by LuisG on 08-13-2008 12:05 PM
0 Kudos
Message 4 of 8
(4,543 Views)

Thanks for reply. Here is my result 

 

1. There is strtoll in the function tree. 

 

2. There is no problem in interactive execution, i can run it.

 

But once I move those code to a new project, it show the error again:

 

1 Project link error

- Undefined symbol '_strtoll' referenced in "TryStdlibex.c'

 

It is really strange that once I move it to a project I cannot run the code anymore.

 

Thanks 

0 Kudos
Message 5 of 8
(4,530 Views)

So, essentially, you can use strtoll in the interactive window, but not in an actual project? Yeah, that's pretty strange.

 

Do you have access to a different computer where you could install CVI 8.5 and try the same thing? At this point, I suspect an installation problem, where somehow CVI is linking against a different version of cvi.lib file what is expected. Actually, you might want to also search your computer for all files named cvi.lib. There should be four of them found under the CVI85 installation folder, and no others. Assuming that that's the case, can you check and then let me know the date and size of CVI85\bin\msvc\cvi.lib?

 

Depending on what happens when you test it with a different installation of CVI, there are a couple of strategies we can then try, in order to continue narrowing this down.

 

Thanks for helping us figure this out!

 

Luis

0 Kudos
Message 6 of 8
(4,517 Views)

Hi,km9394 

I suggest you do the following steps:

 1, delete the folder in your project folder named "cvibuild.YourProjectName"

 2,rebuild your project

 

I encountered this problem as you once,and solved in this way, hope it wil work, 

anyway, let me know the result or mail me (liang.chen@ni.com)

 

 

 Topkins

 

0 Kudos
Message 7 of 8
(4,478 Views)

Thanks for your help, LuisG 

 

I have solved the problem by removing one cvi.lib, i think it is accidentally copied with the toolkit files.

 

Have a nice day 

 

km9394 

 

0 Kudos
Message 8 of 8
(4,475 Views)