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

Message ListMessage List     Post MessagePost Message

  Cannot build demos for Qt6 on XCode 26.1.1
Posted by Paul Messick on Nov-26-2025 14:31
Hi!

Trying to build and run the demos to see if this package will do what I need. I'm start at the starting gate with the following build error(s):

ld: warning: duplicate -rpath '@executable_path/../Frameworks' ignored
ld: warning: search path '../../lib' not found
ld: library 'chartdir' not found

This is a fairly new version of XCode. Maybe there is a problem there?

Paul

  Re: Cannot build demos for Qt6 on XCode 26.1.1
Posted by Peter Kwan on Nov-27-2025 01:25
Attachments:
Hi Paul,

The Qt sample code comes with a Qt project file "qtdemo.pro". We are expecting the user will use the Qt Creator (the development tool from Qt) to open the project file and compile the project.

We have not actually tested the Qt sample code with XCode. Would you mind to clarify how do you use XCode to compile the Qt sample code? The error message seems to be related to the project configuration, such as setting up the search path for the linker, the name of the ChartDirector library, and how it should be distributed with the compiled application.

The "qtdemo.pro" project file is designed to support macOS, Linux and Windows. The Qt Creator should know which option to use based on the running operating system. For example, on macOS, it should not use "chartdir" (this is for Linux), and it should copy the "libchartdir.7.dylib" to the Frameworks folder of the application bundle. (This is the standard folder to store third party libraries for macOS applications.)

Would you consider to use Qt Creator for Qt projects?

Best Regards
Peter Kwan
Screenshot-2025-11-26-at-10.jpg

  Re: Cannot build demos for Qt6 on XCode 26.1.1
Posted by Paul Messick on Nov-27-2025 15:27
Hi Peter,

Just so you know, Qt Creator uses XCode as the compiler. I am using the latest version of Qt and Qt Creator to try and do this. The error message appears in Qt Creator, but I reference XCode because a) I know that is the compiler, and b) it might be significant since this is a very recent version of XCode, v26.1.1.

All I have done is opened qtdemo.pro and attempted to build it. (FWIW, I am able to create a new Qt project and build and run that with no problem.)

Does this information change your comments in any way?

  Re: Cannot build demos for Qt6 on XCode 26.1.1
Posted by Peter Kwan on Nov-27-2025 21:09
Hi Paul,

We have found out the cause the issue. It is due to the Qt Creator version. Apparently, the behaviour of the Qt Creator has changed in recent versions about how directories are resolved. We will come up with a modified project file "qmake.pro" that can solve the problem. It should be available in a few hours. I will update this thread when it is available.

In previous versions of Qt Creator, relative paths are relative to the project file. It appears recently this has changed, and the path is not guaranteed to be relative to anything. If you look at the "Compiler Output" tab of Qt Creator, all code compiles normally. It breaks when linking the code because the linker cannot find the ChartDirector library using the relative path.

Regards
Peter Kwan

  Re: Cannot build demos for Qt6 on XCode 26.1.1
Posted by Peter Kwan on Nov-28-2025 03:07
Attachments:
Hi Paul,

Attached please find the updated Qt project files. Please use them to replace the existing project files in the sample code.

For example, if you are trying the "ChartDirector/qtdemo/qtdemo.pro" project, please use the updated "qtdemo/qtdemo.pro" project file in the download to replace the existing project file. This should fix the compatibility issue with the lastest Qt Creator.

In any C++ project, if you use a library, you must link the code with the library. When distributing your executable, you must include the library as part of the distribution. These steps are usually configured in a "Makefile" or "project file". The current issue is that the lastest Qt Creator cannot find the library, because the lastest Qt Creator sets the default directory differently from previous Qt Creator. The updated project file configures the path in a way that is compatible with both the lastest Qt Creator and older Qt Creator.

When you use ChartDirector in your own project, you would need to configure your project to link with the ChartDirector library libchartdir.7.dylib and to include it in the executable distribution. This is the same as any other dynamic library that you may use.

Best Regards
Peter Kwan
cd_qt_project_files.zip
cd_qt_project_files.zip

4.72 Kb

  Re: Cannot build demos for Qt6 on XCode 26.1.1
Posted by Paul Messick on Nov-28-2025 07:04
Attachments:
Hi Peter,

Thanks for updating this so quickly. Perfect!

There are a couple of things I notice:

1) There continues to be an error at the end of the build:

ld: warning: duplicate -rpath '@executable_path/../Frameworks' ignored

So something is not quite right there.

and,

2) Running the app generates the attached message from Macos. Clicking on Done allows the app to run. This happens on every run.

Maybe the dylib needs to be signed in some way?

Thanks,

Paul
Screenshot 2025-11-28 at 10.02.05 am.png

  Re: Cannot build demos for Qt6 on XCode 26.1.1
Posted by Peter Kwan on Nov-28-2025 12:30
Hi Paul,

(1) The "duplicate -rpath" is not an error. It is a warning and can be ignored.

The "-rpath" is the runtime search path. The executable uses this path to search for the library at runtime. The sample project is configured to copy the ChartDirector library to '@executable_path/../Frameworks', so we need to ensure this directory is in the runtime search path. As the directory '@executable_path/../Frameworks' is a standard directory, it is possible some other libraries in your application are also using the same directory and set the same runtime path. The linker simply tells you the runtime path has already been set so it is not necessary to set it again, but it is not harmful either. These "other libraries" can come from Qt Creator, XCode or macOS itself, depending on its version and configuration.

If you know the '@executable_path/../Frameworks' has already been added to the runtime search path, you can remove the line in the sample code project file that adds the runtime search path. Normally, the application programmer needs to decide where the put the libraries at compile time and runtime, and set the compile time and runtime search paths accordingly.


(2) In the ChartDirector download page, it contains a note that you should unquarantine the downloaded package before extracting its contents. See:

https://www.advsofteng.com/macos_unquarantine.html

If you have already extracted its contents, you can open the command shell, and enter:

xattr -c -r ChartDirector

The above assumes "ChartDirector" is the directory that contains the ChartDirector distribution. The command will unquarantine all files in the directory and its subdirectories.

Normally, if an application is to be distributed, the application programmer should sign the application. It is not necessary to sign a library that can only be used as part of an application. The entire application needs to be signed as a whole. (In macOS, the "entire application" refers to the application bundle.)

Best Regards
Peter Kwan