ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  having trouble getting rid of pre compiled header
Posted by jef on Nov-20-2024 09:49
Using VS 2022 in MFC mode trying to call graph function from inside a dialog called "DlgResults.cpp".  I was getting "can't find precompiled header" so I turned off the ChartViewer.cpp property for precompiled headers and getting link error:

"1>ChartViewer.obj : error LNK2019: unresolved external symbol _CChart_getResourceLoader referenced in function "void * __cdecl Chart::getResourceLoader(void)" (?getResourceLoader@Chart@@YAPAXXZ)"

which is one of 54 such errors. I include a header called "chartgroup.h" containing:

#include each of the following:
bchartdir.h
framework.h
Financechart.h
<windows.h>
<string>
<vector>
chartdir.h

and using ChartViewer.h in the dialog that is trying to call my plotting function.

Compiles but not linking due to something missing. I built a small test program that works but now trying to incorporate into my 30k lines of C++ code application.

I'm stumped.

any help would be appreciated.
thanks,
jeff

  Re: having trouble getting rid of pre compiled header
Posted by Peter Kwan on Nov-20-2024 12:01
Attachments:
Hi jef,

This is a linker error. Have you verified that the project is configured to link with the correct "chartdir70.lib"? (There are 2 "chartdir70.lib/chartdir70.dll", one for 32-bit applications and one for 64-bit applications.) The _CChart_getResourceLoader is in "chartdir70.lib". I have attached a screenshot for your reference.

Best Regards
Peter Kwan
devenv_20241120120104.png

  Re: having trouble getting rid of pre compiled header
Posted by jef on Nov-23-2024 01:52
Attachments:
Your reply fixed this problem but in the process have another: My program has 3 blocks of code: 1. a user interface; 2. a computation library DLL; and 3. the chardir70.lib. when I set the property of the interface to "x64" and the DLL to x64; I get an error that target is 86 in conflict with x64. when i switch everything to Win32 it works. I definitely have the chart70.lib for the 64 bit case. is the 86 conflict because the computation engine was developed under VS2005 maybe? The DLL still compiles (with warnings) under VS2022. If I use configuration manager to create <New> there are ARM, ARM64, and ARM64EC. not sure these would help getting back to 64bit processing.
propertypg.jpg

  Re: having trouble getting rid of pre compiled header
Posted by Peter Kwan on Nov-25-2024 14:02
Hi jef,

Please try the original mfc sample code that comes with ChartDirector (in ChartDirector/mfcdemo). Please try to build it for Win32 and also for x64 to make sure it works. This is to confirm that your Visual Studio can build both 32-bit and 64-bit projects.

For your case, to build x64, your computation library DLL and the corresponding import library (the .lib file) needs to be x64 as well. The linker configuration for x64 needs to link with the 64-bit import librarys for both the ChartDirector DLL and your computation library DLL.

Before you build, please Clean the project file (right click on the project in the solution explorer, and select "Clean").  Make sure your Active Solution Platform is x64, not Win32. (When you set the project to x64, it does not necessarily mean that the solution is x64. You may need to set the Active Solution Platform as well.)

If the above still cannot solve the problem, please let me know what is the output from Build. (In Visual Studio, there is an Output window, and you can view the Build log there.) It should have the exact error message and other details.

The word "target" usually means the intended output of the build. If "target is 86 in conflict with x64", it may mean Visual Studio solution is configured to build a Win32 binary, but something in the project is in x64. The exact wording is important to understand what it means, so it better if we can have the original Build log.

Best Regards
Peter Kwan