Hello,
I've been studying a lot C++ and 64-bit Assembly during my apprenticeship and would like to get into GUI programming with Qt.
Sadly I can't figure out how to get my project properly set up to call an extern assembly function from my .s or .asm file.
This is what I have tried:
.pro
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = test---
TEMPLATE = app
DEFINES += QT_DEPRECATED_WARNINGS
QMAKE_EXTRA_COMPILERS += nasm
# or should I use QMAKE += nasm
SOURCES += main.cpp\
mainwindow.cpp\
asm.s
HEADERS += mainwindow.h
FORMS += mainwindow.ui
LIBS += asm.s
QT += core gui
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
TARGET = test---
TEMPLATE = app
DEFINES += QT_DEPRECATED_WARNINGS
QMAKE_EXTRA_COMPILERS += nasm
# or should I use QMAKE += nasm
SOURCES += main.cpp\
mainwindow.cpp\
asm.s
HEADERS += mainwindow.h
FORMS += mainwindow.ui
LIBS += asm.s
To copy to clipboard, switch view to plain text mode
mainwindow.cpp
//code
extern "C" __int64 assembly();
//code
void MainWindow::on_pushButton_clicked()
{
int zahl = assembly(); // for testing purposes I just want the value of rax to be returned and put into the variable zahl
}
//code
extern "C" __int64 assembly();
//code
void MainWindow::on_pushButton_clicked()
{
int zahl = assembly(); // for testing purposes I just want the value of rax to be returned and put into the variable zahl
}
To copy to clipboard, switch view to plain text mode
asm.s
.code
.global
assembly proc
mov rax, 1
ret
xor rax, rax
assembly endp
end
.code
.global
assembly proc
mov rax, 1
ret
xor rax, rax
assembly endp
end
To copy to clipboard, switch view to plain text mode
Whenever I attempt to compile the program I get an error message stating that the symbol assembly cannot be found.
I'm really desperate and need someone help me with this problem 
I've been browsing the internet for hours but couldn't get a decent solution
Bookmarks