解决ubuntu下程序双击不能运行的问题

作者: shaoliang 2020-04-09 12:32   访问数:713

                                                         

#-------------------------------------------------
#
# Project created by QtCreator 2020-04-09T08:09:48
#
#-------------------------------------------------

QT       += core gui

greaterThan(QT_MAJOR_VERSION, 4): QT += widgets

TARGET = untitled4
TEMPLATE = app

# The following define makes your compiler emit warnings if you use
# any feature of Qt which has been marked as deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000    # disables all the APIs deprecated before Qt 6.0.0


SOURCES += \
        main.cpp \
        widget.cpp

HEADERS += \
        widget.h

FORMS += \
        widget.ui

QMAKE_LFLAGS += -no-pie



可以在shell下运行,需要修改chmod +x 


但是不能双击运行


在pro文件中添加


QMAKE_LFLAGS += -no-pie



Release 运行才可以

鲁ICP备19029146号-1 管理
CopyRight@51dr.top 页面打开时间 0.0300 秒.