[QBS] How to connect COSMIC compiler
-
@jsulm I have a stm8 project which correct builded in Cosmic IDE. And now I want to work with this project in Qt Creator, I add a cosmic compiler in setting, but when I am trying to build it (with Qbs) its didnt work. And the warnings on img above didnt talk anything.
p.s. In release 1.20 qbs have cosmic compiler support -
Hi.
Unfortunately, I didn't add the
Cosmic
compiler support to QtCreator itself (I didn't have the time or desire ). The reason is that this compiler is rarely used (but you can add the task on QtCreator bug-tracker and then I will try, maybe). ;)A good news is that you can add the
Cosmic
toolchain inQtCreator
asCustom
toolchain as follows:-
Make sure that the
BareMetal
plugin is enabled. -
Goto
Tools->Options->Kits->Compilers->Add Custom->C
:- Set desired compiler name (e.g.
Cosmic (C)
). - Choose path to the
cxstm8.exe
executable (in my case this wasc:\COSMIC\FSE_Compilers\CXSTM8\cxstm8.exe
). - Choose API
unknown-baremetal-generic-unknown-unknown
. - Click on
Apply
button.
- Set desired compiler name (e.g.
-
Goto
Tools->Option->Devices->Devices->Add->Bare Metal Device
:- Set desired sevice name (e.g.
stm8
). - Click on
Apply
button.
- Set desired sevice name (e.g.
-
Goto
Tools->Options->Kits->Kits->Add
:- Set desired kit name (e.g.
COSMIC
). - Set
Device Type
->Bare Metal
. - Set
Device
->stm8
. - Set
Compiler C
->Cosmic (C)
. - Set
Compiler C++
->None
. - Set
Debugger
->None
. - Set
Qt version
->None
.
- Set desired kit name (e.g.
Right now, you need to tell to
Qbs
that this custom compiler iscosmic
forstm8
architecture (these names are special reserved inQbs
, this and this):-
Click on
Change
button in theAdditional Qbs Profile Setitngs
entry (in yourKit
), and then:- Add entry for
Key
->qbs.architecture
;Value
->stm8
. - Add entry for
Key
->qbs.toolchain
;Value
->cosmic
. - Click on
OK
button.
- Add entry for
-
Click on
Apply
in yourKit
.
Right now you need to check that the
Qbs
recognized that profile, gotoTools->Options->Qbs->Profiles
, and then:- Choose your
COSMIC
kit from the combo box. - Make sure that its profile values are
qbs.architecture
isstm8
, andqbs.toolchain
iscosmic
and also the compiler path is valid and the compiler names arecxstm8.exe
. - Other
targetPlatform
can be empty.
It should work. ;)
PS: Alternativelly, you can use the
VSCode
IDE with theQbs
extension, there are not need to make such configuration. ;)
PS2: If you is aRussian
speacker, then you can ask direct questions in thisDiscord
channel. -
-
Really thank you for helping me, but of couse I did all as you say and it didn`t work.
You need to set the
Show command line
check-box inBuild Steps
of yourProjects
side pane options. Then we can see the real compiler invokes and they errors.You can start at first from the simple
main.c
application.Reffering to discord server doesn`t work, maybe you can to send a invitation.
Try this.
-
Seems your Qbs configuration is wrong. Please show the Qbs profile settings (screenshoot with expanded items) for your
Cosmic
kit (fromTools->Options->Qbs->Profiles
).If you prefer russian lang I would waiting in discord
No, I will there a later.
-
Hmm.. what's QtCreator version is? Need to use at least v6.0.2 (because there are Qbs 1.21).
-
Try to re-start the QtCreator, then clear all
*.user
files from the sources of your project and then re-open yourtest
project againfrom scratch
. -
Well, right now the Qbs invokes the cosmic compiler.
Seems, you need in the cosmic linker files
*.lkf
that is the cosmic-dependend stuff. Please read the cosmic compiler manual how to compile the simple application (what's you need for this).Maybe you need in
*.lkf
stub as here.Also, due to the COSMIC is an very outdated toolchain, then maybe you need to place your project with the short paths as possible (because the cosmic has a limitations for that).