看板 C_and_CPP 關於我們 聯絡資訊
開發平台(Platform): (Ex: Win10, Linux, ...) window10 編譯器(Ex: GCC, clang, VC++...)+目標環境(跟開發平台不同的話需列出) code blocks GCC 額外使用到的函數庫(Library Used): (Ex: OpenGL, ...) winmm,pthread 問題(Question): 我目前在作一個小音樂遊戲可是出現很多問題 PlaySound函式沒有反應,沒有出現error,可是也沒有聲音,另外我是參考 http://goo.gl/1JndPK 寫的,我的程式碼在下方。 另外pthread方面,在用學校電腦打時,可以直接#include<phread>跑程式,可是回家時卻 出現error[fatal error :phread.h :no such file or directory],我以為是檔案 遺失,下載了dll丟進去還是一樣出現error。 另外我想請教大大,我想寫多執行緒,用這個合適嗎?多執行緒目的只是用來跑一個 迴圈變動boolen值(音樂遊戲打點判定) 感謝各位! 餵入的資料(Input): 預期的正確結果(Expected Output): 錯誤結果(Wrong Output): 程式碼(Code):(請善用置底文網頁, 記得排版) PlaySound(TEXT("music.wav"),NULL, SND_SYNC); 補充說明(Supplement): -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 123.194.114.181 ※ 文章網址: https://www.ptt.cc/bbs/C_and_CPP/M.1515781071.A.FC9.html
Ikaros1110: 補充一下我也改成過PlaySound("C:\\...")直接取路徑 01/13 02:21
Ikaros1110: 一樣會有這問題 01/13 02:21
※ 編輯: Ikaros1110 (123.194.114.181), 01/13/2018 02:25:35
iFEELing: 為什麼它抱怨找不到phread.h然後你是丟DLL進去??? 01/13 03:43
eye5002003: pthread不是標準庫,建議使用std::thread 01/14 19:22
ACMANIAC: 是 pthread 不是 phread... 當然會no such file or dir 01/16 05:48
Hazukashiine: 推樓上好眼力 XDDDDDD 01/16 13:21
eye5002003: VisualStudio本來就找不到pthread,MinGW倒是有可能 01/16 18:05
Ikaros1110: 謝謝A大,是我87 01/20 23:32