LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

porting excel report demo to msvc... what libraries do I link to?

Hi,

 

I'm trying to port the excelreportdemo cvi project to msvc and I'm having trouble determining what library files I need to link to. I've added excelreport.c and excelreportdemo.c as the source files. I've included cvirt.lib, cvisupp.lib, cviauto.lib and cvimain.lib (to implement WinMain) in the link list. When I build the project I get the following link errors:

 

 

excelreport.obj : error LNK2001: unresolved external symbol _CmtGetThreadLocalVar
excelreport.obj : error LNK2001: unresolved external symbol _Excel_SetProperty
excelreport.obj : error LNK2001: unresolved external symbol _Excel_NewApp@20
excelreport.obj : error LNK2001: unresolved external symbol _CmtDiscardThreadLocalVar
excelreport.obj : error LNK2001: unresolved external symbol _CmtNewThreadLocalVar
excelreport.obj : error LNK2001: unresolved external symbol ___caErrChk
excelreport.obj : error LNK2001: unresolved external symbol _Excel_AppQuit@8
excelreport.obj : error LNK2001: unresolved external symbol _Excel_AppRun@508
excelreport.obj : error LNK2001: unresolved external symbol _Excel_GetProperty@20
excelreport.obj : error LNK2001: unresolved external symbol _Excel_WorkbooksAdd@28
excelreport.obj : error LNK2001: unresolved external symbol _Excel_WorkbooksOpen@208
excelreport.obj : error LNK2001: unresolved external symbol _Excel_WorkbookClose@56
excelreport.obj : error LNK2001: unresolved external symbol _Excel_WorkbookSave@8
excelreport.obj : error LNK2001: unresolved external symbol _Excel_WorkbookSaveAs@172
excelreport.obj : error LNK2001: unresolved external symbol _CA_GetInterfaceFromObjHandle
excelreport.obj : error LNK2001: unresolved external symbol _Excel_IID_Worksheet
excelreport.obj : error LNK2001: unresolved external symbol _Excel_SheetsItem@28
excelreport.obj : error LNK2001: unresolved external symbol _Excel_IID_Chart
excelreport.obj : error LNK2001: unresolved external symbol _Excel_SheetsAdd@76
excelreport.obj : error LNK2001: unresolved external symbol _Excel_WorksheetDelete@8
excelreport.obj : error LNK2001: unresolved external symbol _Excel_RangeInsert@28
excelreport.obj : error LNK2001: unresolved external symbol _Excel_RangeGetItem@44
excelreport.obj : error LNK2001: unresolved external symbol _Excel_RangeDelete@28
excelreport.obj : error LNK2001: unresolved external symbol _Excel_ShapesAddPicture@40
excelreport.obj : error LNK2001: unresolved external symbol _Excel_WorksheetActivate@8
excelreport.obj : error LNK2001: unresolved external symbol _Excel_RangeAddress@80
excelreport.obj : error LNK2001: unresolved external symbol _Excel_RangeFind@128
excelreport.obj : error LNK2001: unresolved external symbol _Excel_WorksheetRange@44
excelreport.obj : error LNK2001: unresolved external symbol _Excel_ChartObjectsItem@28
excelreport.obj : error LNK2001: unresolved external symbol _Excel_WorksheetChartObjects@28
excelreport.obj : error LNK2001: unresolved external symbol _Excel_RangeSelect@12
excelreport.obj : error LNK2001: unresolved external symbol _Excel_BordersItem@16
excelreport.obj : error LNK2001: unresolved external symbol _Excel_HyperlinksAdd@68
excelreport.obj : error LNK2001: unresolved external symbol _Excel_RangePrintOut@140
excelreport.obj : error LNK2001: unresolved external symbol _Excel_DialogShow@492
excelreport.obj : error LNK2001: unresolved external symbol _Excel_DialogsItem@16
excelreport.obj : error LNK2001: unresolved external symbol _Excel_RangeFillRight@12
excelreport.obj : error LNK2001: unresolved external symbol _Excel_RangeFillLeft@12
excelreport.obj : error LNK2001: unresolved external symbol _Excel_RangeFillDown@12
excelreport.obj : error LNK2001: unresolved external symbol _Excel_RangeFillUp@12
excelreport.obj : error LNK2001: unresolved external symbol _Excel_RangeSort@132
excelreport.obj : error LNK2001: unresolved external symbol _Excel_RangeShow@12
excelreport.obj : error LNK2001: unresolved external symbol _Excel_RangeSetItem@56
excelreport.obj : error LNK2001: unresolved external symbol _Excel_RangeAddComment@28
excelreport.obj : error LNK2001: unresolved external symbol _Excel_CommentText@60
excelreport.obj : error LNK2001: unresolved external symbol _Excel_ChartMove@40
excelreport.obj : error LNK2001: unresolved external symbol _Excel_ChartObjectsAdd@44
excelreport.obj : error LNK2001: unresolved external symbol _Excel_ChartDelete@8
excelreport.obj : error LNK2001: unresolved external symbol _Excel_ChartObjectDelete@12
excelreport.obj : error LNK2001: unresolved external symbol _Excel_ChartPrintOut@136
excelreport.obj : error LNK2001: unresolved external symbol _Excel_ChartActivate@8
excelreport.obj : error LNK2001: unresolved external symbol _Excel_ChartObjectActivate@12
excelreport.obj : error LNK2001: unresolved external symbol _Excel_ChartSetSourceData@28
excelreport.obj : error LNK2001: unresolved external symbol _Excel_ChartChartWizard@184
excelreport.obj : error LNK2001: unresolved external symbol _Excel_AxesItem@20
excelreport.obj : error LNK2001: unresolved external symbol _Excel_ChartAxes@32
cviauto.lib(implib.obj) : error LNK2001: unresolved external symbol ___security_cookie
cviauto.lib(implib.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4

 

TIA for any help you can offer!

 

Jesse

0 Kudos
Message 1 of 4
(3,450 Views)

Jesse:

 

Take a look at Casey W's post here: http://forums.ni.com/t5/LabWindows-CVI/GUI-functions-in-MS-eMbedded-VC/m-p/554180#M30579

 

At least one thing you're missing is the program file for the CVI Instrument Microsoft Excel 9.0 Object Library.  If you follow Casey's note 3, you'll see that the program file you need to add is C:\Program Files\National Instruments\CVI2010\toolslib\activex\excel\msvc\excel2000.obj

If you're not using CVI2010, the parent directory may be different but the object file should still be on the path [CVI home]\toolslib\activex\excel\msvc\excel2000.obj

0 Kudos
Message 2 of 4
(3,436 Views)

Ah, that helps (somewhat); thanks!

 

I get fewer link errors, but not 0:

 

 

excelreport.obj : error LNK2001: unresolved external symbol _CmtGetThreadLocalVar
excelreport.obj : error LNK2001: unresolved external symbol _CmtDiscardThreadLocalVar
excelreport.obj : error LNK2001: unresolved external symbol _CmtNewThreadLocalVar
excelreport.obj : error LNK2001: unresolved external symbol ___caErrChk
excelreport.obj : error LNK2001: unresolved external symbol _CA_GetInterfaceFromObjHandle
cviauto.lib(implib.obj) : error LNK2001: unresolved external symbol ___security_cookie
cviauto.lib(implib.obj) : error LNK2001: unresolved external symbol @__security_check_cookie@4
So I'm still missing something.
TIA for all your help.
Jesse

 

0 Kudos
Message 3 of 4
(3,433 Views)

Jesse:

 

More questions, not answers:

 

CA_GetInterfaceFromObjHandle is defined in cviauto.h, and you said you included cviauto.lib, so I'm surprised you're getting the link error for CA_GetInterfaceFromObjHandle.

 

CmtGetThreadLocalVar, CmtDiscardThreadLocalVar, and CmtNewThreadLocalVar are in CVI's internal Utility library to deal with thread-safe variables.  I have never tried using those functions with an external compiler, so I don't know if or how they work there.

 

__caErrChk is a macro defined in cviauto.h, which is included in excelreport.c, which you say you added to your project.  So why is it undefined?  You could try including it in your top level file.

 

I don't know where security_cookie comes from.

 

Sorry I couldn't help.

 

 

 

 

0 Kudos
Message 4 of 4
(3,426 Views)