[問題] 關於標頭檔成為exe一部份的cmd指令
看板C_and_CPP (C/C++)作者machia045413 (Amber)時間10年前 (2015/10/22 23:17)推噓4(4推 0噓 11→)留言15則, 5人參與討論串1/2 (看更多)
開發平台(Platform): (Ex: VC++, GCC, Linux, ...)
DevC++
額外使用到的函數庫(Library Used): (Ex: OpenGL, ...)
另外設置的.h標頭檔
問題(Question):
前些日子研讀了此篇https://www.ptt.cc/bbs/C_and_CPP/M.1316515713.A.567.html
因為作業上也需要利用cmd指令一步步將cpp檔轉成exe檔
不過額外的要求是加入.h標頭檔一起執行成為exe檔
我一直以為是在linker時加入 指令如下
C:\Dev-Cpp\MinGW64\bin\ld.exe "D:\104_1\demo.o" "D:\104_1\demo.h" -o
"D:\104_1\demo.exe"
不過並沒有成功 希望版上的各位大大可以協助解決><
餵入的資料(Input):
C:\Dev-Cpp\MinGW64\bin\ld.exe "D:\104_1\demo.o" "D:\104_1\demo.h" -o
"D:\104_1\demo.exe"
預期的正確結果(Expected Output):
exe檔製作成功
錯誤結果(Wrong Output):
D:\104_1\demo.h: file not recognized: File format not recognized
程式碼(Code):(請善用置底文網頁, 記得排版)
參考此篇的code
http://pydoing.blogspot.tw/2013/02/cpp-header-file.html
補充說明(Supplement):
謝謝大家><
--
※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 163.25.118.40
※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1445527034.A.1AD.html
推
10/22 23:28, , 1F
10/22 23:28, 1F
推
10/22 23:34, , 2F
10/22 23:34, 2F
→
10/22 23:34, , 3F
10/22 23:34, 3F
→
10/22 23:36, , 4F
10/22 23:36, 4F
推
10/22 23:38, , 5F
10/22 23:38, 5F
→
10/22 23:41, , 6F
10/22 23:41, 6F
→
10/22 23:42, , 7F
10/22 23:42, 7F
→
10/22 23:44, , 8F
10/22 23:44, 8F
→
10/22 23:46, , 9F
10/22 23:46, 9F
→
10/22 23:47, , 10F
10/22 23:47, 10F
→
10/23 00:02, , 11F
10/23 00:02, 11F
推
10/23 00:09, , 12F
10/23 00:09, 12F
→
10/23 00:10, , 13F
10/23 00:10, 13F
→
10/23 00:39, , 14F
10/23 00:39, 14F
→
10/27 14:47, , 15F
10/27 14:47, 15F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
C_and_CPP 近期熱門文章
PTT數位生活區 即時熱門文章
-3
13