|
LNK2019 Error |
Posted by Chuck Willette on Feb-03-2012 04:57 |
|
I'm a newbie at this, so I need a little help here. I have an existing Win 32 C++ project
that I am adding charting to. To try it out, I simply included the "simpleline.cpp" file into
the project and used #include "stdafx.h" and #include "chartdir.h". I do not understand
why the build fails. What have I done wrong, and what do I need to do to make it work?
Chuck
1>------ Build started: Project: FAuvSurf 4.0, Configuration: Debug Win32 ------
1>Build started 2/2/2012 3:36:38 PM.
1>InitializeBuildStatus:
1> Touching "Debug\\FAuvSurf 4.0.unsuccessfulbuild".
1>ClCompile:
1> FAuv_Global_Variables.cpp
1> simpleline.cpp
1> Write CSV File.cpp
1> Set_Lamp_Parameters.cpp
1> Read_PF.cpp
1> K_calc.cpp
1> Get_Console_Params.cpp
1> FAuv_Coil_Main.cpp
1> Auto Layout.cpp
1> Generating Code...
1>ManifestResourceCompile:
1> All outputs are up-to-date.
1>simpleline.obj : error LNK2019: unresolved external symbol _CBaseChart_makeChart
referenced in function "public: bool __thiscall BaseChart::makeChart(char const *)" (?
makeChart@BaseChart@@QAE_NPBD@Z)
1>simpleline.obj : error LNK2019: unresolved external symbol _CAxis_setLabels
referenced in function "public: class TextBox * __thiscall Axis::setLabels(class
StringArray)" (?setLabels@Axis@@QAEPAVTextBox@@VStringArray@@@Z)
1>simpleline.obj : error LNK2019: unresolved external symbol _TextBox2Box referenced
in function "public: __thiscall TextBox::TextBox(class TextBoxInternal *)" (??
0TextBox@@QAE@PAVTextBoxInternal@@@Z)
1>simpleline.obj : error LNK2019: unresolved external symbol _Box2DrawObj referenced
in function "public: __thiscall Box::Box(class BoxInternal *)" (??
0Box@@QAE@PAVBoxInternal@@@Z)
1>simpleline.obj : error LNK2019: unresolved external symbol _CAxis_setLabelStep
referenced in function "public: void __thiscall Axis::setLabelStep(int,int,int,int)" (?
setLabelStep@Axis@@QAEXHHHH@Z)
1>simpleline.obj : error LNK2019: unresolved external symbol _XYChart2BaseChart
referenced in function "public: __thiscall XYChart::XYChart(int,int,int,int,int)" (??
0XYChart@@QAE@HHHHH@Z)
1>simpleline.obj : error LNK2019: unresolved external symbol _CXYChart_create
referenced in function "public: __thiscall XYChart::XYChart(int,int,int,int,int)" (??
0XYChart@@QAE@HHHHH@Z)
1>simpleline.obj : error LNK2019: unresolved external symbol _CBaseChart_destroy
referenced in function "public: virtual __thiscall BaseChart::~BaseChart(void)" (??
1BaseChart@@UAE@XZ)
1>simpleline.obj : error LNK2019: unresolved external symbol _CXYChart_xAxis
referenced in function "public: class Axis * __thiscall XYChart::xAxis(void)" (?
xAxis@XYChart@@QAEPAVAxis@@XZ)
1>simpleline.obj : error LNK2019: unresolved external symbol _CXYChart_setPlotArea
referenced in function "public: class PlotArea * __thiscall
XYChart::setPlotArea(int,int,int,int,int,int,int,int,int)" (?
setPlotArea@XYChart@@QAEPAVPlotArea@@HHHHHHHHH@Z)
1>simpleline.obj : error LNK2019: unresolved external symbol _CXYChart_addLineLayer
referenced in function "public: class LineLayer * __thiscall XYChart::addLineLayer(class
DoubleArray,int,char const *,int)" (?
addLineLayer@XYChart@@QAEPAVLineLayer@@VDoubleArray@@HPBDH@Z)
1>simpleline.obj : error LNK2019: unresolved external symbol _LineLayer2Layer
referenced in function "public: __thiscall LineLayer::LineLayer(class LineLayerInternal *)"
(??0LineLayer@@QAE@PAVLineLayerInternal@@@Z)
1>C:\\Users\\Chuck\\Documents\\Visual Studio 2010\\Projects\\FAuvSurf\\Debug\\FAuvSurf
4.0.exe : fatal error LNK1120: 12 unresolved externals
1>
1>Build FAILED.
1>
1>Time Elapsed 00:00:05.19
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ========== |
Re: LNK2019 Error |
Posted by Peter Kwan on Feb-04-2012 00:40 |
|
Hi Chuck,
The errors you see are linker errors, not compiler errors. It means your code is correct and compiles successfully. But the linker cannot linked your code, because it cannot resolve the symbols. Iti is probably because you have not linked with the ChartDirector library "chartdir50.lib", which contains the required symbols.
To solve the problem, please configure your linker to link with "chartdir50.lib" as one of the libraries. For the exact steps, please refer to the documentation of your linker or your development tools. In some versions of Visual Studio, the steps are: Select "Project/Properties" from the menu bar, go to "Linker" -> "Input", in the "Additional Dependencies" field, add the path of the file "chartdir50.lib".
Hope this can help.
Regards
Peter Kwan |
Re: LNK2019 Error |
Posted by Dhiral on Jun-29-2012 05:05 |
|
Kwan,
I did link library file chartdir51.lib to the project (Linker -> input -> (Path to
chartdir51.lib)/chartdir51.lib). Even then I am getting Linker Errors.
I downloaded trial version free from the website. Can you please suggest a solution.
Thanks,
Dhiral |
Re: LNK2019 Error |
Posted by Dhiral on Jun-29-2012 06:09 |
|
Hi,
Found the solution. I had downloaded 64 bit version of the ChartDirector since I have 64 bit
operating system. But I was making Win32 console application. Apparently you get linking
problems when you try to link to a library which was compiled for 64 bit. So now I
downloaded 32 bit version of the ChartDirector |
Re: LNK2019 Error |
Posted by yariv on Sep-11-2012 17:43 |
|
Thanks,
Had the same problem and it solved my case |
|