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

Archicad 25 compile error

poco2013
Mentor
With the release of the 25 devkit, I am trying to compile Tibor's Example project: PUBLISH--- archicad-additional-jason-commands. Referenced in a previous post.

I used Cmake to create the Visual Studio vcxproj file it run without error.

cmake -G "Visual Studio 16 2019" -A "x64" -DAC_API_DEVKIT_DIR="C:\API Development Kit 25.3002" in the publish directory.

When I try to compile in 2019, I get the following errors.

everity Code Description Project File Line Suppression State
Error MSB8066 Custom build for 'C:\API Development Kit 25.3002\Examples\AddonExample\CMakeFiles\732d89a1e72b09b8bddc61f03f9b716a\AddOnResources.stamp.rule;C:\API Development Kit 25.3002\Examples\AddonExample\CMakeFiles\11ca4d47a3aec2bb356bac488405510b\AddOnResources.rule' exited with code 2. AddOnResources C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets 241



Severity Code Description Project File Line Suppression State
Error MSB8066 Custom build for 'C:\Users\gteac\Archicad_C++\Tibor\CMakeFiles\aa734dfd9b322fa42576535f2535fe79\AddOnResources.stamp.rule;C:\Users\gteac\Archicad_C++\Tibor\CMakeFiles\e63756136f579f4ec9c201a3279cbe19\AddOnResources.rule' exited with code 2. AddOnResources C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\MSBuild\Microsoft\VC\v160\Microsoft.CppCommon.targets 241


Severity Code Description Project File Line Suppression State
Error LNK1104 cannot open file 'C:\Users\gteac\Archicad_C++\Tibor\ResourceObjects\Tibor.res' AddOn C:\Users\gteac\Archicad_C++\Tibor\LINK 1

The other test examples compile without err but there I did not use cmake -- just the supplied vcxproj file in the examples.

Tibor's code does not supply a vcxproj file so I have to use cmake to create one.
I assume that I need to add some path but don't know what.
Anyone get a chance to compile this example and what do I need to do to fix it??
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
1 ACCEPTED SOLUTION

Accepted Solutions
Solution
Hey Gerry! I didn't take a close look at your errors, but I was able to compile the project. Please check my fork of Tibor's project where the branch `easy_vs_2019_build` contains a commit which should simplify compilation:
https://github.com/bschwb/archicad-additional-json-commands/tree/easy_vs_2019_build

As described in the README.md chapter "Build (Windows)" you should open the project folder in VS 2019 and wait for the CMake config to finish. You might need to adjust the AC_API_DEVKIT_DIR in "CMakeSettings.json" in case you have it installed in a different path than me. After the CMake config is done, you should be able to just build with "Build All".

The commit message of the commit explains a bit which changes I had to make in case you are interested.

I hope this helps and let me know if it works for you
Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: bschwb.com

View solution in original post

5 REPLIES 5
Solution
Hey Gerry! I didn't take a close look at your errors, but I was able to compile the project. Please check my fork of Tibor's project where the branch `easy_vs_2019_build` contains a commit which should simplify compilation:
https://github.com/bschwb/archicad-additional-json-commands/tree/easy_vs_2019_build

As described in the README.md chapter "Build (Windows)" you should open the project folder in VS 2019 and wait for the CMake config to finish. You might need to adjust the AC_API_DEVKIT_DIR in "CMakeSettings.json" in case you have it installed in a different path than me. After the CMake config is done, you should be able to just build with "Build All".

The commit message of the commit explains a bit which changes I had to make in case you are interested.

I hope this helps and let me know if it works for you
Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: bschwb.com
poco2013
Mentor
OK -- Thanks for the input. I followed the instructions but now are getting the error:

Severity Code Description Project File Line Suppression State
Error C1083 Cannot open source file: 'wd4996': No such file or directory AddOn C:\Users\gteac\Archicad_C++\Tibor1\c1xx 1

Any thoughts??
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
Oops that was my fault. The original commit was not 100% correct and I force pushed over it last night, so it seems you got one of the wrong intermediate commits.

Easiest would be to just redownload the repo again. The correct last commit on the "easy_vs_2019_build" has the hash "0011e20f1619464fa6e762c8479b50c22ff6485d".

Or you could go into CMakeLists.txt and in line 7 change "wd4996" to "/wd4996".
Bernd Schwarzenbacher - Archicad Add-On Developer - Get Add-Ons & Archicad Tips on my Website: bschwb.com
poco2013
Mentor
Thanks -- That fixed the problem.

However, now the add-on is not working correctly??

The first publish works fine and publishes to the proper folder, but it does not shut down Archicad at the end. It simply closes the plan and there is a blank Archicad screen with a dialog that says 'Python script running".
After the time out period,the python dialog gives the message of restarting Archicad but the program just hangs Note: Archicad never closed -- just the plan.
If I then click the stop button on the Python dialog, the program crashes with the message:
"Something went wrong.& the application closed unexpectedly"

Don't believe i saw this problem running Tibor's apx addon file directly. But could have made some different settings in the mean time?
Gerry

Windows 11 - Visual Studio 2022; ArchiCAD 27
Tibor Lorantfy
Graphisoft Alumni
Graphisoft Alumni
bschwb wrote:
Hey Gerry! I didn't take a close look at your errors, but I was able to compile the project. Please check my fork of Tibor's project where the branch `easy_vs_2019_build` contains a commit which should simplify compilation
Thanks Bernd for forking and helping to make build easier!
Yes, I forgot to upload CompileResources.py to the github repo. Oops, it's corrected now.

poco2013 wrote:
The first publish works fine and publishes to the proper folder, but it does not shut down Archicad at the end. It simply closes the plan and there is a blank Archicad screen with a dialog that says 'Python script running".
You have to run the python script external from Archicad, so not from the Python Palette.
If you run it from the Palette, then the python script is not allowed to close the Archicad instance.

Gerry, congrats for the Keynote Add-On btw