08-29-2016 01:29 PM
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.
08-29-2016 02:22 PM - edited 08-29-2016 02:23 PM
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'.
08-30-2016 11:27 AM
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!
08-30-2016 11:40 AM
Hello Dsun,
I will take a look at the links. Thank you!
08-30-2016 11:45 AM
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.
08-30-2016 12:37 PM
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?
08-30-2016 01:25 PM
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.