Measurement Studio for VC++

cancel
Showing results for 
Search instead for 
Did you mean: 

unresolved external symbol NI::CNiGraph::Create & CreateControl

Hello, I have recently upgraded to VS2005 & NI MS 8.6

 

The project we have been building under VS2003 & NI MS 8.1 now will not build; I am getting three unresolved symbol references

 

error LNK2001: unresolved external symbol "public: virtual int __thiscall NI::CNiGraph::Create(char const *,unsigned long,struct tagRECT const &,class CWnd *,unsigned int,class CFile *,int,unsigned short *)"

error LNK2001: unresolved external symbol "public: virtual int __thiscall NI::CNiGraph::CreateControl(struct _GUID const &,char const *,unsigned long,struct tagRECT const &,class CWnd *,unsigned int,class CFile *,int,unsigned short *)"

error LNK2001: unresolved external symbol "public: virtual int __thiscall NI::CNiGraph::CreateControl(char const *,char const *,unsigned long,struct tagRECT const &,class CWnd *,unsigned int,class CFile *,int,unsigned short *)"

 

Nothing was changed in the project files between building with VS2003 and now with VS2005; all the header & library directories appear to be correct in VS. Any suggestions?

 

Regards,

k

0 Kudos
Message 1 of 6
(7,525 Views)

Hi kt_bouse,

 

Are you able to run any of the Measurement Studio 8.6 examples?  These can be found here by default: C:\Documents and Settings\All Users\Documents\National Instruments\MStudioVS2005\VCNET\Examples . An example that uses the CNiGraph control is the SimpleGraphSDI example under the Application folder in the examples folder.

 

If you can build and run the examples, make sure your project is using the NI namespace (using namespace NI) and give it a rebuild to make sure that you are clearing out all the compiled files before compiling again.

Eric B.
National Instruments
0 Kudos
Message 2 of 6
(7,510 Views)

Hey Eric, thanks for the response.

 

I can build the SimpleGraphSDI example solution with no problems.

 

I think something unknown changed between NI8.1/VS2003 and NI8.6/VS2005 because I can build the same codebase with VS2003 against the NI8.1 libraries, but when I turn around and build the exact same files with VS2005 and NI8.6 I get these unresolved externals and I suspect there is some simple define or something that I just don’t know about.

 

The module it’s complaining about is deriving a new class from CNiGraph and I am wondering if something about what needs to be implemented and/or overridden has changed between those two environments, or perhaps is more strict under the new compiler and/or libraries — i.e., we may have “gotten away” with something before that it now insists on having correct?

 

FWIW, we are using the NI classes in scores of other modules and only this one is being flagged; I’ll check into the namespace possibility, but that should affect _compilation_ not linkage — the compiler would throw an error about not being able to find the symbol CNiGraph at the point of derivation in the header…

 

Regards,
k

 

btw: on my system the path is C:\Documents and Settings\All Users\Shared Documents\National Instruments\MStudioVS2005\VCNET\Examples

0 Kudos
Message 3 of 6
(7,504 Views)

Hi kt_bouse,

 

Thanks for the information.  Based on your information (that you are using other NI controls just fine), the namespace possibility should not be the issue.

 

I've been working on trying to replicate your issue today (creating a class that inherits from CNiGraph in 2003/8.1, then using it in 2005/8.6), but haven't been able to replicate it yet.  I will get back with you next week once I am able to get this reproduced to see if it is an issue with how you are doing it, or if something did in fact change between 8.1 and 8.6.

 

One thing that would help me a lot would be your class that is inheriting from CNiGraph...that way I can take a look at it to see if anything seems incorrect and I can use that to compare to my code to find any differences.

Eric B.
National Instruments
0 Kudos
Message 4 of 6
(7,485 Views)

Hi Eric,

 

You’re going to love this one: after I opened and built the example, the problem went away! Seriously! I literally closed the one solution, opened the other, and did a Build All.

 

I was so surprised I shutdown, restarted, and did a Rebuild All — twice — haven’t seen the problem since… I didn’t change anything manually, though I did verify the existence of the ‘using namespace’ statement.

 

Maybe something about the installation/upgrade didn’t quite go cleanly? I haven’t a clue at this point, but I’m willing to run with it!

 

Thanks for your help,

k

0 Kudos
Message 5 of 6
(7,483 Views)
Glad to hear it!  I'm not sure what the issue could have been, but at least it is working now.
Eric B.
National Instruments
0 Kudos
Message 6 of 6
(7,458 Views)