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!

CMake Error at C:\..\API Development Kit 27.3001\Examples\Element_Test\CMakeLists.txt:85 (project):

LeeJaeYoung
Virtuoso

 

LeeJaeYoung_1-1696055772757.png

LeeJaeYoung_2-1696055882256.png

 

 I'm trying to study API in Trier version Archicad 27.
What should I do if this error message appears?

AC27 on window 11
1 ACCEPTED SOLUTION

Accepted Solutions
Solution

Things change between versions, and a lot of things depend on whats currently installed on you machine etc.

From the errors you get I would specify the following (in the CMake Settings I mentioned in my previous command):

  • CMakeGenerator: "Visual Studio 16 2019 x64" "Visual Studio 16 2019 Win64"
  • Toolset: "msvc_x64_x64"
  • maybe also add the following flag to CMake command arguments: "-T v142"

 

Edit: Fix actual generator to use.

View solution in original post

10 REPLIES 10

Hi Lee,

You are using some incompatible settings with your CMake generator.
I had the best success with using "Visual Studio 16 2019" or "Visual Studio 17 2022" generators instead of the "Ninja" generator.
Here would be the option if you are using "CMakeSettings.json":
Frame 7.png

Hope that helps,
Bernd

LeeJaeYoung
Virtuoso

How can I access your cmake settings?

스크린샷 2023-10-01 014701.png

 How can I access your cmake settings?
genenate is not included.

 

Python 3.10.11
In settings, the following settings appear.

스크린샷 2023-10-01 015147.png

AC27 on window 11
LeeJaeYoung
Virtuoso

I set up what you asked me to do.
Even though I reinstalled it... ^^

LeeJaeYoung_0-1696095075092.png

I came across these errors:

LeeJaeYoung_1-1696095204056.png

 

 

I want to know what the problem is.
This file was also compiled in archicad 26.
Why does archicad 27 produce this error message?
I need your help.
I am a beginner.

LeeJaeYoung_2-1696136980885.png

 

LeeJaeYoung_0-1696136865957.png

LeeJaeYoung_1-1696136961163.png

 

 

AC27 on window 11
Solution

Things change between versions, and a lot of things depend on whats currently installed on you machine etc.

From the errors you get I would specify the following (in the CMake Settings I mentioned in my previous command):

  • CMakeGenerator: "Visual Studio 16 2019 x64" "Visual Studio 16 2019 Win64"
  • Toolset: "msvc_x64_x64"
  • maybe also add the following flag to CMake command arguments: "-T v142"

 

Edit: Fix actual generator to use.

thank you
With your help, I was able to study API. ^^
Because compilation failed due to the warning of C2220, I compiled by deleting /WX as shown in the picture below.
Q1. Is it right to do this?

LeeJaeYoung_0-1696243925139.png

컴파일러 오류 C2220 | Microsoft Learn

 

I didn't have x64, so I chose win64.

LeeJaeYoung_1-1696244369077.png

 

AC27 on window 11

Glad I could help!

 


@LeeJaeYoung wrote:

Because compilation failed due to the warning of C2220, I compiled by deleting /WX as shown in the picture below.
Q1. Is it right to do this?


Yes that works. Alternatively you could keep the /WX flag and disable this specific warning with adding the flag /wd2220.

 


@LeeJaeYoung wrote:

I didn't have x64, so I chose win64.

LeeJaeYoung_1-1696244369077.png


That's the right one! I mistyped it.


The "-T v142" should maybe go to the "cmakeCommandArgs" instead of "ctestCommandArgs".

But since it works anyway for you, maybe it's not important.

Thank you again for your consideration. ^^
Well then, I hope you have a happy time.

AC27 on window 11

"The should maybe go to the "cmakeCommandArgs" instead of "ctestCommandArgs""

When I set it like this, this error occurs.

스크린샷 2023-10-02 220638.png

 

 

target_compile_options (${target} PUBLIC /W3 /WX /wd2220 /wd4996 /Zc:wchar_t-)

LeeJaeYoung_0-1696252244167.png

 

 

AC27 on window 11

Looks like you need to delete your CMake cache and reconfigure CMake. (Project -> Delete Cache and Reconfigure)