[問題] 請問Winmain的設定與C files轉檔

看板C_and_CPP作者 (凱凱)時間15年前 (2010/06/19 16:12), 編輯推噓0(001)
留言1則, 1人參與, 最新討論串1/1
各位大大好,小弟不懂C語言;只是一般終端的使用者 最近在用Matlab上的一個軟體來分析影像,他需要呼叫一些.c files; 對各位高手而言應當不是困難的問題,但小弟一直搞不定;還請大家幫忙! 小弟是用Windows XP (SP3),Matlab 7.8.0 R2009a 要呼叫的程式是來自http://bishopw.loni.ucla.edu/air5/index.html 根據其安裝說明http://bishopw.loni.ucla.edu/air5/config.html Using your PC C compiler, compile all of the files in the src subdirctory into a library 下面還有 Using your PC C compiler, compile each of the programs in the main AIR directory. For example, compile the file 'alignlinear.c' to generate the executable file 'alignlinear.exe'. You will need to link in the library compiled in the previous step. 目前是用Pelles C來轉http://www.christian-heffner.de/ 把src下的檔案全部轉成test.lib檔後 再去執行轉檔(已經在project option中之linker,加入test.lib;而且將test.lib加到 folder所有之檔案夾中 ),以alignlinear.c為例: 若選擇Win32 Console program type,出現如下訊息: Building alignlinear.obj. Building alignlinear.exe. POLINK: error: Unresolved external symbol '_AIR_parse_long'. POLINK: error: Unresolved external symbol '_AIR_parse_float'. POLINK: error: Unresolved external symbol '_AIR_parse_uint'. POLINK: error: Unresolved external symbol '_AIR_do_alignlinear'. POLINK: error: Unresolved external symbol '_AIR_report_error'. POLINK: fatal error: 5 unresolved external(s). *** Error code: 1 *** Done. 若選擇Win32 program type,出現如下訊息: Building alignlinear.obj. E:\005 Academic\AIR5.2.6\AIR5.2.6\alignlinear.c(34): warning #2203: Function 'main' can't be __stdcall, changed to __cdecl. Building alignlinear.exe. POLINK: error: Unresolved external symbol '_WinMain@16'. POLINK: fatal error: 1 unresolved external(s). *** Error code: 1 *** Done. 查了一下是要設定entry為WinMain,請問這該如何設定呢? 是在轉成test.lib時就要設定? 或是Pelles C本身環境的設定? 這個問題已經試了很多天還是無解,感謝各位的幫忙! 如果有其他更適合的軟體來做這件事,也請推薦與指導! -- ※ 發信站: 批踢踢實業坊(ptt.cc) ◆ From: 114.37.193.175

06/19 16:46, , 1F
VC 好像可以設定WinMain
06/19 16:46, 1F
文章代碼(AID): #1C77lxDZ (C_and_CPP)