This content originally appeared on DEV Community and was authored by 海前 王
CXX = cl
CXXFLAGS = /MDd /DWIN32 /D_DEBUG /D_WINDOWS /D_UNICODE /DUNICODE /D_AFXDLL
INCLUDE_DIR1 = "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/include"
INCLUDE_DIR2 = "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/atlmfc/include"
INCLUDE_DIR3 = "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Include"
LIB_DIR1 = "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/lib"
LIB_DIR2 = "C:/Program Files (x86)/Microsoft Visual Studio 10.0/VC/atlmfc/lib"
LIB_DIR3 = "C:/Program Files (x86)/Microsoft SDKs/Windows/v7.0A/Lib"
# 目标文件和可执行文件
OBJ = mfc.obj
SRC = mfc.cpp
EXE = mfc.exe
# 规则
all: $(EXE)
#一直报error LNK2019: 无法解析的外部符号 _WinMain@16,该符号在函数 ___tmainCRTStartup 中被引用 加上/ENTRY:wWinMainCRTStartup就好了
$(EXE): $(OBJ)
link /nologo /OUT:$(EXE) /SUBSYSTEM:WINDOWS /ENTRY:wWinMainCRTStartup /NODEFAULTLIB:msvcrt /LIBPATH:$(LIB_DIR3) /LIBPATH:$(LIB_DIR1) /LIBPATH:$(LIB_DIR2) $(OBJ) mfc100ud.lib mfcs100ud.lib msvcrtd.lib kernel32.lib user32.lib gdi32.lib
$(OBJ): $(SRC)
$(CXX) $(CXXFLAGS) /I$(INCLUDE_DIR1) /I$(INCLUDE_DIR2) /I$(INCLUDE_DIR3) /c $(SRC) /Fo$(OBJ)
clean:
del $(OBJ) $(EXE)
{
// 使用 IntelliSense 了解相关属性。
// 悬停以查看现有属性的描述。
// 欲了解更多信息,请访问: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "启动",
"type": "cppvsdbg",
"request": "launch",
"args": ["args1","args2"],
"program": "C:\\Users\\Administrator\\Desktop\\mfcmk\\mfc.exe"
}
]
}
This content originally appeared on DEV Community and was authored by 海前 王
Print
Share
Comment
Cite
Upload
Translate
Updates
There are no updates yet.
Click the Upload button above to add an update.
APA
MLA
海前 王 | Sciencx (2024-09-05T01:28:52+00:00) makefile mfc. Retrieved from https://www.scien.cx/2024/09/05/makefile-mfc/
" » makefile mfc." 海前 王 | Sciencx - Thursday September 5, 2024, https://www.scien.cx/2024/09/05/makefile-mfc/
HARVARD海前 王 | Sciencx Thursday September 5, 2024 » makefile mfc., viewed ,<https://www.scien.cx/2024/09/05/makefile-mfc/>
VANCOUVER海前 王 | Sciencx - » makefile mfc. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/09/05/makefile-mfc/
CHICAGO" » makefile mfc." 海前 王 | Sciencx - Accessed . https://www.scien.cx/2024/09/05/makefile-mfc/
IEEE" » makefile mfc." 海前 王 | Sciencx [Online]. Available: https://www.scien.cx/2024/09/05/makefile-mfc/. [Accessed: ]
rf:citation » makefile mfc | 海前 王 | Sciencx | https://www.scien.cx/2024/09/05/makefile-mfc/ |
Please log in to upload a file.
There are no updates yet.
Click the Upload button above to add an update.