LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Linker error: Undefined symbol CRC referenced in .obj

Solved!
Go to solution

Hi,

 

I am getting the following error when building a project in Debug64 configuration. I am using LabWindowsCVI 2015 Version 15.0.0 (408).

 

Build Status (ProjectName.prj - Debug64)
 Link ProjectName.exe
  error: Undefined symbol 'CRC' referenced in "c:\CVIProjects\cvibuild.ProjectName\Debug64\OrgCheck.obj".  
Build failed.

 

Here's what I tried:

 

CRC seems to be a function used in OrgCheck.c and it is declared in one of the header files and defined in another source file

  • deflared function CRC in OrgCheck.c
  • declared function CRC as an extern in OrgCheck.c

 

The project is using GPIB/488.2 so i tried what was recommended in NI Knowledge Undefined Symbol Errors.....that Uses GPIB/GPIB 488.2 ..Libraries but the GPIB/488.2 libraries were already linked.

 

I tried to rebuild the project in Debug, Release, and Release64 configuration as recommended here Undefined Symbol Link Error in LabWindows™/CVI™ 2012 When Building a Static Library (Although it is not build as a static library). This made no difference

 

Nothing resolved the issue.

 

Does anyone has recommendation on how to resolve this linker error?

 

Thanks!

 

 

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

Btw, Target Type of this project is set to Executable (I noticed many people have issues when building it as DLL or Static Library so I just wanted to clarify).

 

Here is what I did in the meantime:

  • Rebuild project -> did not help
  • cleaned project -> recompiled OrgCheck.c (build just fine) -> build project -> fail
  • cleaned project -> recompild every source file individually -> build project -> failed with same error as stated above

 

I'll keep updating this if anything changes.

 

Thanks,

ZerMahlMeer

0 Kudos
Message 2 of 6
(7,299 Views)

Hey ZerMahlMeer,

 

Are you building this into an executable? Try going to Build » Target Settings and make sure that "Instrument Driver Support Only" is not checked.

 

http://digital.ni.com/public.nsf/allkb/8890718DE5A63F5C862568D600625021?OpenDocument

Libby B.
Applications Engineering Specialist - RF Wireless
National Instruments
0 Kudos
Message 3 of 6
(7,283 Views)

Hello Libby,

 

yes, I am building it into an executable. 

 

Thanks for your suggestion but "Instrument Driver Support Only" was not selected.

 

ZerMahlMeer

0 Kudos
Message 4 of 6
(7,277 Views)

Ok, I got that same error (not exactly the same but in all case it was an Undefined symbol was referencedin in xyz.obj) in other projects as well. 

 

Is there a good way to debug linker error? Any suggestions are welcome.

 

Thanks

ZerMahlMeer.

Message 5 of 6
(7,220 Views)
Solution
Accepted by topic author ZerMahlMeer

It is running now. I got some help from a senior. Solution: file OrgCheck.c was not part of the project list  (In CVI ->right click on project->add existing file will add it). So function CRC was declared in a header file and it was able to find that, but it could not find the implementation. I thought if it can find the header file (the directory was added to the Include Paths) it would also be able to find it's source file.

 

Hope that helps someone with the same problem.

Message 6 of 6
(7,213 Views)