From: SnickerSun Date: Wed, 26 Nov 2025 23:34:01 +0000 (+0800) Subject: 创建M1 测试工具分支,初步可以编译通过 X-Git-Url: http://git.snicker.com.cn/?a=commitdiff_plain;h=6681addd4e717484486f56376bec7cb86781dc56;p=mirrors%2Ffactory_tool.git 创建M1 测试工具分支,初步可以编译通过 --- diff --git a/.vscode/c_cpp_properties.json b/.vscode/c_cpp_properties.json new file mode 100644 index 0000000..c271e66 --- /dev/null +++ b/.vscode/c_cpp_properties.json @@ -0,0 +1,64 @@ +{ + "configurations": [ + { + "name": "Win32", + "includePath": [ + "${workspaceFolder}/**", + "${workspaceFolder}/lib", + "d:/Qt/Qt5.14.2/5.14.2/mingw73_32/include", + "d:/Qt/Qt5.14.2/5.14.2/mingw73_32/include/QtCore", + "d:/Qt/Qt5.14.2/5.14.2/mingw73_32/include/QtGui", + "d:/Qt/Qt5.14.2/5.14.2/mingw73_32/include/QtWidgets", + "d:/Qt/Qt5.14.2/5.14.2/mingw73_32/include/QtSql", + "d:/Qt/Qt5.14.2/5.14.2/mingw73_32/include/QtSerialPort", + "d:/Qt/Qt5.14.2/5.14.2/mingw73_32/include/QtANGLE", + "d:/Qt/Qt5.14.2/5.14.2/mingw73_32/include/QtCore/5.14.2", + "d:/Qt/Qt5.14.2/5.14.2/mingw73_32/include/QtCore/5.14.2/QtCore", + "d:/Qt/Qt5.14.2/5.14.2/mingw73_32/include/QtGui/5.14.2", + "d:/Qt/Qt5.14.2/5.14.2/mingw73_32/include/QtGui/5.14.2/QtGui", + "d:/Qt/Qt5.14.2/5.14.2/mingw73_32/include/QtWidgets/5.14.2", + "d:/Qt/Qt5.14.2/5.14.2/mingw73_32/include/QtWidgets/5.14.2/QtWidgets", + "C:/Program Files (x86)/Windows Kits/10/Include/*/um", + "C:/Program Files (x86)/Windows Kits/10/Include/*/shared", + "C:/Program Files (x86)/Windows Kits/10/Include/*/winrt" + ], + "defines": [ + "_DEBUG", + "UNICODE", + "_UNICODE", + "WIN32", + "MINGW_HAS_SECURE_API=1", + "QT_WIDGETS_LIB", + "QT_GUI_LIB", + "QT_SQL_LIB", + "QT_SERIALPORT_LIB", + "QT_CORE_LIB", + "QT_NEEDS_QMAIN" + ], + "windowsSdkVersion": "10.0.19041.0", + "compilerPath": "d:/Qt/Qt5.14.2/Tools/mingw730_32/bin/g++.exe", + "cStandard": "c11", + "cppStandard": "c++11", + "intelliSenseMode": "gcc-x64", + "compilerArgs": [ + "-fno-keep-inline-dllexport", + "-g", + "-std=gnu++11", + "-Wall", + "-Wextra", + "-fexceptions", + "-mthreads" + ], + "browse": { + "path": [ + "${workspaceFolder}", + "d:/Qt/Qt5.14.2/5.14.2/mingw73_32/include" + ], + "limitSymbolsToIncludedHeaders": true + } + } + ], + "version": 4 +} + + diff --git a/.vscode/extensions.json b/.vscode/extensions.json new file mode 100644 index 0000000..7df067f --- /dev/null +++ b/.vscode/extensions.json @@ -0,0 +1,12 @@ +{ + "recommendations": [ + "ms-vscode.cpptools", + "ms-vscode.cpptools-extension-pack", + "twxs.cmake", + "ms-vscode.cmake-tools", + "formulahendry.code-runner", + "ms-vscode.cpptools-theme" + ] +} + + diff --git a/.vscode/launch.json b/.vscode/launch.json new file mode 100644 index 0000000..8b331a9 --- /dev/null +++ b/.vscode/launch.json @@ -0,0 +1,89 @@ +{ + "version": "0.2.0", + "configurations": [ + { + "name": "Debug (GDB)", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/debug/HiBTMacWriteTool.exe", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [ + { + "name": "PATH", + "value": "${env:PATH};d:\\Qt\\Qt5.14.2\\5.14.2\\mingw73_32\\bin" + } + ], + "externalConsole": false, + "MIMode": "gdb", + "miDebuggerPath": "d:\\Qt\\Qt5.14.2\\Tools\\mingw730_32\\bin\\gdb.exe", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + }, + { + "description": "Set Disassembly Flavor to Intel", + "text": "-gdb-set disassembly-flavor intel", + "ignoreFailures": true + } + ], + "preLaunchTask": "build: Debug" + }, + { + "name": "Release (GDB)", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/release/HiBTMacWriteTool.exe", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [ + { + "name": "PATH", + "value": "${env:PATH};d:\\Qt\\Qt5.14.2\\5.14.2\\mingw73_32\\bin" + } + ], + "externalConsole": false, + "MIMode": "gdb", + "miDebuggerPath": "d:\\Qt\\Qt5.14.2\\Tools\\mingw730_32\\bin\\gdb.exe", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ], + "preLaunchTask": "build: Release" + }, + { + "name": "Debug (No Build)", + "type": "cppdbg", + "request": "launch", + "program": "${workspaceFolder}/debug/HiBTMacWriteTool.exe", + "args": [], + "stopAtEntry": false, + "cwd": "${workspaceFolder}", + "environment": [ + { + "name": "PATH", + "value": "${env:PATH};d:\\Qt\\Qt5.14.2\\5.14.2\\mingw73_32\\bin" + } + ], + "externalConsole": false, + "MIMode": "gdb", + "miDebuggerPath": "d:\\Qt\\Qt5.14.2\\Tools\\mingw730_32\\bin\\gdb.exe", + "setupCommands": [ + { + "description": "Enable pretty-printing for gdb", + "text": "-enable-pretty-printing", + "ignoreFailures": true + } + ] + } + ] +} + + diff --git a/.vscode/settings.json b/.vscode/settings.json new file mode 100644 index 0000000..67b3e2f --- /dev/null +++ b/.vscode/settings.json @@ -0,0 +1,55 @@ +{ + "files.associations": { + "*.h": "cpp", + "*.cpp": "cpp", + "*.ui": "xml", + "*.qrc": "xml", + "*.pro": "makefile", + "*.pri": "makefile" + }, + "C_Cpp.default.includePath": [ + "${workspaceFolder}/**", + "${workspaceFolder}/lib", + "d:/Qt/Qt5.14.2/5.14.2/mingw73_32/include" + ], + "C_Cpp.default.defines": [ + "UNICODE", + "_UNICODE", + "WIN32", + "MINGW_HAS_SECURE_API=1", + "QT_WIDGETS_LIB", + "QT_GUI_LIB", + "QT_SQL_LIB", + "QT_SERIALPORT_LIB", + "QT_CORE_LIB" + ], + "C_Cpp.default.compilerPath": "d:/Qt/Qt5.14.2/Tools/mingw730_32/bin/g++.exe", + "C_Cpp.default.cStandard": "c11", + "C_Cpp.default.cppStandard": "c++11", + "C_Cpp.default.intelliSenseMode": "gcc-x64", + "files.exclude": { + "**/.git": true, + "**/.svn": true, + "**/.hg": true, + "**/CVS": true, + "**/.DS_Store": true, + "**/Thumbs.db": true + }, + "search.exclude": { + "**/node_modules": true, + "**/bower_components": true, + "**/*.code-search": true, + "**/debug": true, + "**/release": true, + "**/.qmake.stash": true + }, + "files.watcherExclude": { + "**/.git/objects/**": true, + "**/.git/subtree-cache/**": true, + "**/node_modules/**": true, + "**/debug/**": true, + "**/release/**": true + } +} + + diff --git a/.vscode/tasks.json b/.vscode/tasks.json new file mode 100644 index 0000000..f01276a --- /dev/null +++ b/.vscode/tasks.json @@ -0,0 +1,152 @@ +{ + "version": "2.0.0", + "tasks": [ + { + "label": "qmake: Configure Project", + "type": "shell", + "command": "qmake", + "args": [ + "HiBTMacWriteTool.pro" + ], + "options": { + "cwd": "${workspaceFolder}", + "env": { + "QTDIR": "d:\\Qt\\Qt5.14.2\\5.14.2\\mingw73_32", + "PATH": "${env:PATH};d:\\Qt\\Qt5.14.2\\5.14.2\\mingw73_32\\bin" + } + }, + "group": { + "kind": "build", + "isDefault": false + }, + "problemMatcher": [] + }, + { + "label": "fix: Link Order", + "type": "shell", + "command": "powershell", + "args": [ + "-ExecutionPolicy", + "Bypass", + "-File", + "${workspaceFolder}/fix_link_order.ps1" + ], + "options": { + "cwd": "${workspaceFolder}" + }, + "group": "build", + "problemMatcher": [] + }, + { + "label": "rebuild: Clean and Build", + "type": "shell", + "command": "powershell", + "args": [ + "-ExecutionPolicy", + "Bypass", + "-File", + "${workspaceFolder}/rebuild_fixed.ps1" + ], + "options": { + "cwd": "${workspaceFolder}" + }, + "group": "build", + "problemMatcher": [ + "$gcc" + ], + "presentation": { + "reveal": "always", + "panel": "dedicated" + } + }, + { + "label": "build: Debug", + "dependsOn": [ + "fix: Link Order", + "clean: Build Files" + ], + "type": "shell", + "command": "mingw32-make", + "args": [], + "options": { + "cwd": "${workspaceFolder}/../build-HiBTMacWriteTool-Desktop_Qt_5_14_2_MinGW_32_bit-Debug", + "env": { + "QTDIR": "d:\\Qt\\Qt5.14.2\\5.14.2\\mingw73_32", + "PATH": "${env:PATH};d:\\Qt\\Qt5.14.2\\5.14.2\\mingw73_32\\bin" + } + }, + "group": { + "kind": "build", + "isDefault": true + }, + "problemMatcher": [ + "$gcc" + ], + "presentation": { + "reveal": "always", + "panel": "dedicated" + } + }, + { + "label": "build: Release", + "dependsOn": [ + "fix: Link Order" + ], + "type": "shell", + "command": "mingw32-make", + "args": [ + "release" + ], + "options": { + "cwd": "${workspaceFolder}/../build-HiBTMacWriteTool-Desktop_Qt_5_14_2_MinGW_32_bit-Debug", + "env": { + "QTDIR": "d:\\Qt\\Qt5.14.2\\5.14.2\\mingw73_32", + "PATH": "${env:PATH};d:\\Qt\\Qt5.14.2\\5.14.2\\mingw73_32\\bin" + } + }, + "group": "build", + "problemMatcher": [ + "$gcc" + ], + "presentation": { + "reveal": "always", + "panel": "dedicated" + } + }, + { + "label": "clean: Build Files", + "type": "shell", + "command": "mingw32-make", + "args": [ + "clean" + ], + "options": { + "cwd": "${workspaceFolder}/../build-HiBTMacWriteTool-Desktop_Qt_5_14_2_MinGW_32_bit-Debug", + "env": { + "QTDIR": "d:\\Qt\\Qt5.14.2\\5.14.2\\mingw73_32", + "PATH": "${env:PATH};d:\\Qt\\Qt5.14.2\\5.14.2\\mingw73_32\\bin" + } + }, + "group": "build", + "problemMatcher": [] + }, + { + "label": "qmake: Reconfigure", + "type": "shell", + "command": "qmake", + "args": [ + "HiBTMacWriteTool.pro" + ], + "options": { + "cwd": "${workspaceFolder}", + "env": { + "QTDIR": "d:\\Qt\\Qt5.14.2\\5.14.2\\mingw73_32", + "PATH": "${env:PATH};d:\\Qt\\Qt5.14.2\\5.14.2\\mingw73_32\\bin" + } + }, + "group": "build", + "problemMatcher": [] + } + ] +} + diff --git a/HiBTMacWriteTool.pro b/HiBTMacWriteTool.pro index 02f9591..6ac13f3 100644 --- a/HiBTMacWriteTool.pro +++ b/HiBTMacWriteTool.pro @@ -48,7 +48,8 @@ DEPENDPATH += $$PWD/. LIBS += -L$$PWD/lib/ -LIBS += -lAdvapi32 +#LIBS += -lAdvapi32 +win32:LIBS += -lshell32 D:\Qt\Qt5.14.2\Tools\mingw730_32\i686-w64-mingw32\lib\libadvapi32.a INCLUDEPATH += $$PWD/lib