armory
armory copied to clipboard
[Linux (C)] unable to compile project
unable to compile a Linux (C) HashLink project on Ubuntu.
Armory is producing the linux (C) HashLink project correctly, using the lastest SDK. But the project will not compile manually.
I tried the command "make" in the produced "Release" directory as per the documentation :
Afterwards, you can compile the project using the generated makefile in blend_file_location/build_projectname/linux-hl-build/Release
but it will return a full list of errors when trying to compile, and return the following:
makefile:11: recipe for target 'kore_sources.o' failed
I ran into the same problem. Have you solved it?
Check the : Build status
After I installed CodeBlocks IDE on Ubuntu, it seems that the project is able to compile in CodeBlocks now...
Refer to the WIKI: https://github.com/Kode/Kha/wiki/Linux
The Linux target creates C++ and OpenGL or Vulkan based project files for Code::Blocks and CLion in addition to a makefile. To make the CLion project work it can be necessary to restart CLion once after loading the project.
@moxiaomomo first time I see this page. thanks you for pointing it, I will give it a try.
the Armory documentation will need to be updated as well : https://github.com/armory3d/armory/wiki/linux
I updated the wiki according to what worked in my machine (see diff). I wasn't able to build with the makefile, even after I installed codeblocks.
Were you able to build with the makefile at all? If not, this may be a bug in Kha.
This is not a workable resolution - I'm building things as part of CI/CD, so I can't open the project inside Codeblocks to perform the build. I need a working makefile
.
(For what it's worth, I can't build inside Codeblocks even to test things out, so this is pointing to a Kha/Kinc issue)
@Clockwork-Muse make CFLAGS=-std=c11
in the Release directory works for me.
@tong - So I discovered (essentially).
Given that the makefile has gcc -std=c++11
, I'm assuming that something in Kha is substituting the wrong flag set.
i solved replacing inside the ../linux-hl-build/Release/makefile
"gcc -std=c++11"
with "gcc -std=c11"
on all rows, and set CFLAGS=-std=c11
on top of the makefile. After that you can run make <projectname>
from Release folder than put the executable inside linux-hl
(the one with datas) folder and run it from there with ./<project_name>
i created a script that shoul automate this task, note you should put the correct path name inside the script
#!/bin/bash
cd **<REPLACE_WITH_BUILD_PATH_NAME>**/linux-hl-build/Release
sed -i 's/CFLAGS=-std=c99/CFLAGS=-std=c11/g' makefile
sed -i 's/gcc -std=c++11/gcc -std=c11/g' makefile
make **<REPLACE_WITH_NAME_USED_IN_ARMORY_EXPORTER_SETTINGS>**
cp **<REPLACE_WITH_NAME_USED_IN_ARMORY_EXPORTER_SETTINGS>** ../../linux-hl/
cd ../../linux-hl
./**<REPLACE_WITH_NAME_USED_IN_ARMORY_EXPORTER_SETTINGS>**
put that file inside blender project folder and make it executable with chmod +x than run it
I've noticed that it compile end run fine only with OpenGL, vulkan compiles but give me this error during execution
Starting KoreHL ArmorySDK/Kha/Kinc/Backends/Graphics5/Vulkan/Sources/Kore/CommandList5Impl.cpp:224: void flush_init_cmd(): Assertion '!err' failed. Aborted (core dumped)
.... same, although in my case I can (bizarrely) only get OpenGL to run under a debugger....
@notwarp thanks for looking into this, that's great. Are you able to compile a Linux (C) HashLink exported project now, does it compile completely without errors? And are you on Ubuntu?
Wondering if this can be closed?
@notwarp thanks for looking into this, that's great. Are you able to compile a Linux (C) HashLink exported project now, does it compile completely without errors? And are you on Ubuntu?
Wondering if this can be closed?
Hi, what i wrote is a workaround, it is not meant to be a real solution, but yes i'm able to compile without errors just remember to put the correct name inside the script and select opengl inside the armory properties within blender.
Anyway we should look deeper for find where the CFLAGS are set duriing build of the project
ok this will need further review then. thanks
with the SDK version 2021-8 a new problem prevent me compile the project :
ArmorySDK/Kha/Backends/KoreHL/KoreC/system.cpp:49:37: error: no matching function for call to ‘Kore::Mouse::unlock(int&)’ Kore::Mouse::the()->unlock(windowId);
ArmorySDK/Kha/Backends/KoreHL/KoreC/system.cpp:53:45: error: no matching function for call to ‘Kore::Mouse::canLock(int&)’ return Kore::Mouse::the()->canLock(windowId);
ArmorySDK/Kha/Backends/KoreHL/KoreC/system.cpp:57:46: error: no matching function for call to ‘Kore::Mouse::isLocked(int&)’ return Kore::Mouse::the()->isLocked(windowId);
for improve the makefile generation there is, inside the file in ArmorySDK/Kha/Kinc/Tools/kincmake/out/Exporters/LinuxExporter.js, the code for generate the makefile.
Can someone give a look at this?
Kha needs to be updated, similar issues for Win/Android here. https://github.com/armory3d/armory/issues/2267#issuecomment-895213813
ok thanks I've just updated the SDK in the addon panel of Armory. Is still impossible for me compile using Vulkan API, that you know, there are some steps other than the installation of the Vulkan SDK to do before build the project?