LabWindows/CVI

cancel
Showing results for 
Search instead for 
Did you mean: 

Proejct link error

Hello,

I'm having trouble with linking modules in a project. The error is as follows: Multiply defined symbol '_dPlot_Init' in modules 'Excel_XYscan_report.c' and 'Plot_XYscan.c'.

 

I have looked at both C files and don't understand the problem. The definition is located in a header file (DPLOTLIB.h) that is #included in another header named myheader.h. Myheader.h is included in both c files.

 

I have looked at the previous posts relating to multiply defined symbol linked errors but no luck finding a solution.  

 

I'm new to programming and CVI. Currently using CVI 6.0

 

Any help is much appreciated. 

 

Thanks.

0 Kudos
Message 1 of 7
(4,085 Views)

If I restart CVI the error description changes slightly by adding the location of the files .niobj. I'm not sure if this is relevant information. Error as follows:  Multiply defined symbol '_dPlot_Init' in modules
'e:\Excel_XYscan_Report\cvibuild.Excel_XYscan_Report\Plot_XYscan.nidobj' and
'e:\Excel_XYscan_Report\cvibuild.Excel_XYscan_Report\Excel_XYscan_report.nidobj'.

0 Kudos
Message 2 of 7
(4,069 Views)

This seems to be a case where you're not defining within the header files properly.  I'd take a look at these two links.

http://stackoverflow.com/questions/14870423/symbol-is-multiply-defined

http://stackoverflow.com/questions/18338061/fatal-error-multiply-defined-symbols-found

 

See if these help out!

0 Kudos
Message 3 of 7
(4,045 Views)

Hello Dsun,

I will take a look at the links. Thank you!

0 Kudos
Message 4 of 7
(4,042 Views)

One thing I did not mention in my original post is that the c files work fine seperately. They are two seperate programs that I'm combining now into one. It's not until merging and modifying under one project does it get an error. The dplotlib.h files has been used before with other programs with zero problems. 

0 Kudos
Message 5 of 7
(4,041 Views)

From what I'm understanding the preprocessor is producing two different objects with the same data definition. The error will go away once I remove the #include DPLOTLIB.H from myheader.h  and dircetly #include DPLOTLIB.h in one of the c files (Excel_XYscan_report.c). But now the problem is the other c file (Plot_XYscan.c) has errors because it does not know what type DPLOT is.

 

Any idea where to go from here?  

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

I solved my initial problem by moving all the DPLOT function calls to one C file but this is more of a workaround. But now I have another problem. 

 

Thanks.

0 Kudos
Message 7 of 7
(4,035 Views)