We value your input!
Please participate in Archicad 28 Home Screen and Tooltips/Quick Tutorials survey

Archicad C++ API
About Archicad add-on development using the C++ API.
SOLVED!

Problem with compiling API Example using ARCHICAD27 and Visual Studio 2022

NH
Participant

Hi Everyone,

 

Hoping someone can give us a hand in solving the following problem.  

 

We just downloaded the API Development Kit for Archicad 27 and tried to compile an example API(Communication_Manager). But ran into problem.

 

The CMake process has completed successfully and Python has been installed, but the following message is output during build and it does not complete.

 

>------ Build All started: Project: Communication_Manager, Configuration: x64-Debug ------
  [Microsoft (R) Build Engine version 16.10.2+857e5a733 for .NET Framework]
  Copyright (C) Microsoft Corporation.All rights reserved.
  
    Compiling resources...
    Python 
C:\Program Files (x86)\Microsoft Visual Studio\2019\Professional\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets(241,5): error MSB8066: 'D:\Users\hori\Documents\tps2022_24\Communication_Manager\out\build\x64-Debug\CMakeFiles\dd9445f5f69aac1b619e8d669ae551ed\AddOnResources.stamp.rule;D:\Users\hori\Documents\tps2022_24\Communication_Manager\out\build\x64-Debug\CMakeFiles\de08dd971fc2e36bebf5c91ed235a88a\AddOnResources.rule'[ custom build ended with code 9009.]

Build All failed.

 

We apologize for the inconvenience, but some of the above messages have been translated from Japanese and may not be accurate. (The range enclosed in [] is the translated part)

 

thank you

 

N.H

1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Hi NH,

 

Yes I agree, that most likely there's some issue with finding the python installation.

First I would check if there's python installed here: C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64 (or similar last folder)

 

If it's installed there, than you could try adding that path to the system environment variable called "PATH".

Then try again by deleting the CMake cache and reconfigure (In Visual Studio menu "Project -> Delete Cache and Reconfigure")

View solution in original post

6 REPLIES 6

Hi NH!

Please also post the way you configure CMake. (CMakeSettings.json or CMakePresets.json or the command line you use)

Best,
Bernd

Hi Bernd

Thank you for your reply

Send the contents of CMakeSettings.json.

{
  "configurations": [
    {
      "name": "x64-Debug",
      "generator": "Visual Studio 16 2019 Win64",
      "configurationType": "Debug",
      "inheritEnvironments": [ "msvc_x64_x64" ],
      "buildRoot": "${projectDir}\\out\\build\\${name}",
      "installRoot": "${projectDir}\\out\\install\\${name}",
      "cmakeCommandArgs": "",
      "buildCommandArgs": "",
      "ctestCommandArgs": "",
      "variables": [
        {
          "name": "AC_API_DEVKIT_DIR",
          "value": "C:/Program Files/GRAPHISOFT/API Development Kit 27.3001",
          "type": "PATH"
        }
      ]
    }
  ]
}

 

The contents of AddOnResources.rule and AddOnResources.stamp.rule listed in the error were both below.

# generated from CMake

 

Please inspect

 

HN

The contents of AddOnResources.rule and AddOnResources.stamp.rule are normal.

 

OK CMakeSettings.json look good too. I'm just a confused now which Visual Studio version you are using. Because for compiling you are using VS2019, but in the topic title you mentioned VS2022. I would recommend to open the project also in VS2019 in case that's not what you were doing.

 

Also now I'm wondering, why the build output has a line which explicitly states "Python".

Normally there should be the name of a resource file next.

 

Please check the following and report back:

  1. Open "Developer PowerShell for VS 2019" and execute
     python -c "import os, sys; print(os.path.dirname(sys.executable))​"
    so we see which python is used for the build process.
  2. Please confirm if the two files are available in the Communication_Manager project:
    RFIX\Communication_ManagerFix.grc
    RINT\Communication_Manager.grc

 

Hi Bernd

Thank you for your reply

 

Visual Studio is mainly using 2022.
I tried opening and building in 2019 as instructed, but there seems to be no change in the results.
Regarding the project status in 2019, I have attached an image including the state of RFIX\Communication_ManagerFix.grc and RINT\Communication_Manager.grc.

 

image.png

 

Next, paste the image resulting from "python -c".

 

image.png

 

Since the only result returned is "Python", it seems likely that the installation did not go well.
I have also pasted the "Tools" - "Get Tools and Features" section below (please forgive me for the inscription in Japanese).

 

image.png

 

Please inspect

 

HN

Solution

Hi NH,

 

Yes I agree, that most likely there's some issue with finding the python installation.

First I would check if there's python installed here: C:\Program Files (x86)\Microsoft Visual Studio\Shared\Python37_64 (or similar last folder)

 

If it's installed there, than you could try adding that path to the system environment variable called "PATH".

Then try again by deleting the CMake cache and reconfigure (In Visual Studio menu "Project -> Delete Cache and Reconfigure")

NH
Participant

Hi Bernd
Thank you for the solution.

 

I had checked the PATH settings in another article, but since "Python was not found;" did not appear, I assumed that it was working normally.

 

I look forward to working with you.