Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Need help setting up my Qt project w/ NASM (MakeFile.Debug:98)
Forum Updated to NodeBB v4.3 + New Features

Need help setting up my Qt project w/ NASM (MakeFile.Debug:98)

Scheduled Pinned Locked Moved Solved General and Desktop
assemblerassemblynasmmakefile.debug
11 Posts 4 Posters 2.5k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • ? Offline
    ? Offline
    A Former User
    wrote on 2 Dec 2018, 10:51 last edited by A Former User 12 Mar 2018, 20:37
    #1

    Hello,

    I have found a useful article on how to set up Qt for NASM assembler.
    For testing purposes I wanted to return the contents of rax and display them inside a label.

    But I keep getting the following error: Error: [Makefile.Debug:98: test.o] Error 2

    Do I need an extra installation of NASM or certain compiler settings?

    thanks

    source:

    .pro

    QT       += core gui
    
    greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
    
    TARGET = test_stuff
    TEMPLATE = app
    
    DEFINES += QT_DEPRECATED_WARNINGS
    
    APIs deprecated before Qt 6.0.0
    
    QMAKE_EXTRA_COMPILERS += nasm
    NASMEXTRAFLAGS = -f elf64 -g -F dwarf
    OTHER_FILES += $$NASM_SOURCES
    nasm.output = ${QMAKE_FILE_BASE}.o
    nasm.commands = nasm $$NASMEXTRAFLAGS -o ${QMAKE_FILE_BASE}.o ${QMAKE_FILE_NAME}
    nasm.input = NASM_SOURCES
    
    NASM_SOURCES = test.asm
    
    CONFIG += c++11
    
    SOURCES += \
            main.cpp \
            mainwindow.cpp
    
    HEADERS += \
            mainwindow.h
    
    FORMS += \
            mainwindow.ui
    
    # Default rules for deployment.
    qnx: target.path = /tmp/$${TARGET}/bin
    else: unix:!android: target.path = /opt/$${TARGET}/bin
    !isEmpty(target.path): INSTALLS += target
    
    DISTFILES += \
        test.asm
    
    

    mainwindow.cpp

    #include "mainwindow.h"
    #include "ui_mainwindow.h"
    
    MainWindow::MainWindow(QWidget *parent) :
        QMainWindow(parent),
        ui(new Ui::MainWindow)
    {
        ui->setupUi(this);
    }
    
    MainWindow::~MainWindow()
    {
        delete ui;
    }
    
    extern "C" __int64 _testmain();
    
    
    
    void MainWindow::on_pushButton_clicked()
    {
        ui->label->setText(QString::number(_testmain()));
    }
    
    

    test.asm

    section .text
    global _testmain:function
    
    
    _testmain:
    mov rax, 1234
    ret
    
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 2 Dec 2018, 21:23 last edited by
      #2

      Hi,

      Can you post the complete error ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      ? 1 Reply Last reply 3 Dec 2018, 04:44
      0
      • S SGaist
        2 Dec 2018, 21:23

        Hi,

        Can you post the complete error ?

        ? Offline
        ? Offline
        A Former User
        wrote on 3 Dec 2018, 04:44 last edited by
        #3

        @SGaist said in Need help setting up my Qt project w/ NASM (MakeFile.Debug:98):

        Hi,

        Can you post the complete error ?

        Hi,

        This is all I got:
        [Makefile.Debug:98: test.o] Error 2
        Got this after right clicking and select "display output". (translations added after "//")

        process_begin: CreateProcess(NULL, nasm -f elf64 -g -F dwarf -o test.o ../test_stuff/test.asm, ...) failed.
        make (e=2): Das System kann die angegebene Datei nicht finden. // the system cannot find the mentioned file
        
        mingw32-make[1]: *** [Makefile.Debug:98: test.o] Error 2
        mingw32-make[1]: Leaving directory 'D:/Dokumente/build-test_stuff-Desktop_Qt_5_12_0_MinGW_64_bit-Debug'
        mingw32-make: *** [Makefile:36: debug] Error 2
        05:37:11: Der Prozess "D:\Qt\Tools\mingw730_64\bin\mingw32-make.exe" wurde mit dem Rückgabewert 2 beendet. //the process "D:..." has been terminated with a return value of 2
        Fehler beim Erstellen/Deployment des Projekts test_stuff (Kit: Desktop Qt 5.12.0 MinGW 64-bit) // Error while compiling/Deployment of "test_stuff..." 
        Bei der Ausführung von Schritt "Make" //during the execution of "Make"
        05:37:11: Verstrichene Zeit: 00:02.
        
        A 1 Reply Last reply 3 Dec 2018, 05:14
        0
        • ? A Former User
          3 Dec 2018, 04:44

          @SGaist said in Need help setting up my Qt project w/ NASM (MakeFile.Debug:98):

          Hi,

          Can you post the complete error ?

          Hi,

          This is all I got:
          [Makefile.Debug:98: test.o] Error 2
          Got this after right clicking and select "display output". (translations added after "//")

          process_begin: CreateProcess(NULL, nasm -f elf64 -g -F dwarf -o test.o ../test_stuff/test.asm, ...) failed.
          make (e=2): Das System kann die angegebene Datei nicht finden. // the system cannot find the mentioned file
          
          mingw32-make[1]: *** [Makefile.Debug:98: test.o] Error 2
          mingw32-make[1]: Leaving directory 'D:/Dokumente/build-test_stuff-Desktop_Qt_5_12_0_MinGW_64_bit-Debug'
          mingw32-make: *** [Makefile:36: debug] Error 2
          05:37:11: Der Prozess "D:\Qt\Tools\mingw730_64\bin\mingw32-make.exe" wurde mit dem Rückgabewert 2 beendet. //the process "D:..." has been terminated with a return value of 2
          Fehler beim Erstellen/Deployment des Projekts test_stuff (Kit: Desktop Qt 5.12.0 MinGW 64-bit) // Error while compiling/Deployment of "test_stuff..." 
          Bei der Ausführung von Schritt "Make" //during the execution of "Make"
          05:37:11: Verstrichene Zeit: 00:02.
          
          A Offline
          A Offline
          aha_1980
          Lifetime Qt Champion
          wrote on 3 Dec 2018, 05:14 last edited by
          #4

          Hi @SnuggleKat

          stuff/test.asm, ...) failed. make (e=2): Das System kann die angegebene Datei nicht finden. // the system cannot find

          that sounds as if nasm is not in the PATH environment variable.

          What happens if you type nasm in a command window?

          Regards

          Qt has to stay free or it will die.

          ? 1 Reply Last reply 3 Dec 2018, 06:03
          1
          • A aha_1980
            3 Dec 2018, 05:14

            Hi @SnuggleKat

            stuff/test.asm, ...) failed. make (e=2): Das System kann die angegebene Datei nicht finden. // the system cannot find

            that sounds as if nasm is not in the PATH environment variable.

            What happens if you type nasm in a command window?

            Regards

            ? Offline
            ? Offline
            A Former User
            wrote on 3 Dec 2018, 06:03 last edited by
            #5

            @aha_1980 said in Need help setting up my Qt project w/ NASM (MakeFile.Debug:98):

            Hi @SnuggleKat

            stuff/test.asm, ...) failed. make (e=2): Das System kann die angegebene Datei nicht finden. // the system cannot find

            that sounds as if nasm is not in the PATH environment variable.

            What happens if you type nasm in a command window?

            Regards

            Hi,
            do you mean cmd.exe?
            Typing in "nasm" there doesn't lead to anything.
            So I assume Qt doesn't come with an assembly compiler.

            However, I have an installation of nasm from here
            Added it as a path variable but no change

            A jsulmJ 2 Replies Last reply 3 Dec 2018, 06:08
            0
            • ? A Former User
              3 Dec 2018, 06:03

              @aha_1980 said in Need help setting up my Qt project w/ NASM (MakeFile.Debug:98):

              Hi @SnuggleKat

              stuff/test.asm, ...) failed. make (e=2): Das System kann die angegebene Datei nicht finden. // the system cannot find

              that sounds as if nasm is not in the PATH environment variable.

              What happens if you type nasm in a command window?

              Regards

              Hi,
              do you mean cmd.exe?
              Typing in "nasm" there doesn't lead to anything.
              So I assume Qt doesn't come with an assembly compiler.

              However, I have an installation of nasm from here
              Added it as a path variable but no change

              A Offline
              A Offline
              aha_1980
              Lifetime Qt Champion
              wrote on 3 Dec 2018, 06:08 last edited by
              #6

              @SnuggleKat

              do you mean cmd.exe?

              yes

              Typing in "nasm" there doesn't lead to anything.
              So I assume Qt doesn't come with an assembly compiler.

              Qt is a library, no compiler, so yes.

              However, I have an installation of nasm from here
              Added it as a path variable but no change

              How did you do and verify this?

              Qt has to stay free or it will die.

              ? 1 Reply Last reply 3 Dec 2018, 06:42
              2
              • A aha_1980
                3 Dec 2018, 06:08

                @SnuggleKat

                do you mean cmd.exe?

                yes

                Typing in "nasm" there doesn't lead to anything.
                So I assume Qt doesn't come with an assembly compiler.

                Qt is a library, no compiler, so yes.

                However, I have an installation of nasm from here
                Added it as a path variable but no change

                How did you do and verify this?

                ? Offline
                ? Offline
                A Former User
                wrote on 3 Dec 2018, 06:42 last edited by
                #7

                @aha_1980 said in Need help setting up my Qt project w/ NASM (MakeFile.Debug:98):

                How did you do and verify this?

                By following the link of my last post you can find an installer.
                I then added the installation path as system variable

                A 1 Reply Last reply 3 Dec 2018, 07:22
                0
                • ? A Former User
                  3 Dec 2018, 06:42

                  @aha_1980 said in Need help setting up my Qt project w/ NASM (MakeFile.Debug:98):

                  How did you do and verify this?

                  By following the link of my last post you can find an installer.
                  I then added the installation path as system variable

                  A Offline
                  A Offline
                  aha_1980
                  Lifetime Qt Champion
                  wrote on 3 Dec 2018, 07:22 last edited by
                  #8

                  @SnuggleKat

                  And does nasm work in Windows cmd.exe after you modified PATH? Otherwise there is still something wrong. Please post the output of echo %PATH% in that case.

                  Note that your need to re-open the cmd.exe after you made global environment changes.

                  Qt has to stay free or it will die.

                  ? 1 Reply Last reply 3 Dec 2018, 16:56
                  2
                  • ? A Former User
                    3 Dec 2018, 06:03

                    @aha_1980 said in Need help setting up my Qt project w/ NASM (MakeFile.Debug:98):

                    Hi @SnuggleKat

                    stuff/test.asm, ...) failed. make (e=2): Das System kann die angegebene Datei nicht finden. // the system cannot find

                    that sounds as if nasm is not in the PATH environment variable.

                    What happens if you type nasm in a command window?

                    Regards

                    Hi,
                    do you mean cmd.exe?
                    Typing in "nasm" there doesn't lead to anything.
                    So I assume Qt doesn't come with an assembly compiler.

                    However, I have an installation of nasm from here
                    Added it as a path variable but no change

                    jsulmJ Offline
                    jsulmJ Offline
                    jsulm
                    Lifetime Qt Champion
                    wrote on 3 Dec 2018, 08:11 last edited by
                    #9

                    @SnuggleKat said in Need help setting up my Qt project w/ NASM (MakeFile.Debug:98):

                    So I assume Qt doesn't come with an assembly compiler.

                    No, the compiler does

                    https://forum.qt.io/topic/113070/qt-code-of-conduct

                    1 Reply Last reply
                    1
                    • A aha_1980
                      3 Dec 2018, 07:22

                      @SnuggleKat

                      And does nasm work in Windows cmd.exe after you modified PATH? Otherwise there is still something wrong. Please post the output of echo %PATH% in that case.

                      Note that your need to re-open the cmd.exe after you made global environment changes.

                      ? Offline
                      ? Offline
                      A Former User
                      wrote on 3 Dec 2018, 16:56 last edited by A Former User 12 Mar 2018, 20:28
                      #10

                      @aha_1980 said in Need help setting up my Qt project w/ NASM (MakeFile.Debug:98):

                      @SnuggleKat

                      And does nasm work in Windows cmd.exe after you modified PATH? Otherwise there is still something wrong. Please post the output of echo %PATH% in that case.

                      Note that your need to re-open the cmd.exe after you made global environment changes.

                      Processing echo %PATH% gave me the following:

                      C:\Users\acer>echo %PATH%
                      C:\PS3\ProDG\bin;c:\devkitPro\msys\bin;C:\mingw\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Brackets\command;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\python27;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\WINDOWS\System32\OpenSSH\;C:\Users\acer\AppData\Local\Microsoft\WindowsApps;C:\Users\acer\AppData\Roaming\Dashlane\6.1841.0.13779\bin\Firefox_Extension\{442718d9-475e-452a-b3e1-fb1ee16b8e9f}\components;C:\Users\acer\AppData\Roaming\Dashlane\6.1841.0.13779\ucrt;C:\Users\acer\AppData\Roaming\Dashlane\6.1841.0.13779\bin\Qt
                      
                      ? 1 Reply Last reply 3 Dec 2018, 20:32
                      0
                      • ? A Former User
                        3 Dec 2018, 16:56

                        @aha_1980 said in Need help setting up my Qt project w/ NASM (MakeFile.Debug:98):

                        @SnuggleKat

                        And does nasm work in Windows cmd.exe after you modified PATH? Otherwise there is still something wrong. Please post the output of echo %PATH% in that case.

                        Note that your need to re-open the cmd.exe after you made global environment changes.

                        Processing echo %PATH% gave me the following:

                        C:\Users\acer>echo %PATH%
                        C:\PS3\ProDG\bin;c:\devkitPro\msys\bin;C:\mingw\bin;C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files (x86)\Windows Kits\8.1\Windows Performance Toolkit\;C:\Program Files (x86)\Brackets\command;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\python27;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\MySQL\MySQL Utilities 1.6\;C:\WINDOWS\System32\OpenSSH\;C:\Users\acer\AppData\Local\Microsoft\WindowsApps;C:\Users\acer\AppData\Roaming\Dashlane\6.1841.0.13779\bin\Firefox_Extension\{442718d9-475e-452a-b3e1-fb1ee16b8e9f}\components;C:\Users\acer\AppData\Roaming\Dashlane\6.1841.0.13779\ucrt;C:\Users\acer\AppData\Roaming\Dashlane\6.1841.0.13779\bin\Qt
                        
                        ? Offline
                        ? Offline
                        A Former User
                        wrote on 3 Dec 2018, 20:32 last edited by A Former User 12 Mar 2018, 20:37
                        #11

                        Ok, added nasm to my environment variables. Made a little mistake there.
                        Typing "nasm" into cmd now outputs:

                        nasm:fatal: no input file specified
                        type `nasm -h' for help
                        

                        However, the error in Qt Creator remains the same
                        EDIT: It works now!

                        Just had to restart Qt :)

                        Thank you guys, you are awesome :)

                        0_1543869413550_7f9efd09-e39b-47de-a914-cf569dc2572c-image.png

                        1 Reply Last reply
                        2

                        1/11

                        2 Dec 2018, 10:51

                        • Login

                        • Login or register to search.
                        1 out of 11
                        • First post
                          1/11
                          Last post
                        0
                        • Categories
                        • Recent
                        • Tags
                        • Popular
                        • Users
                        • Groups
                        • Search
                        • Get Qt Extensions
                        • Unsolved