Dev-Cpp/Mingw32/GCC專欄

來源:互聯網
上載者:User

本目錄是 語言/工具介紹 的子檔案目錄。主要介紹Dev-Cpp/Mingw32 和 GCC相關的內容。

具體見連結地址:北鬥星君的專欄

http://blog.csdn.net/VisionCat/category/96409.aspx

今天用dev cpp使用lua的時候發生了一些問題,特此記錄下來,以便將來尋找

開啟dev cpp建立一控制台工程,輸入以下代碼

 

#include <stdio.h>
extern "C" {
#include "lua.h"
#include "lualib.h"
#include "lauxlib.h"
}

/* Lua解譯器指標 */
lua_State* L;
int main ( int argc, char *argv[] )
{
/* 初始化Lua */
L = lua_open();
/* 載入Lua基本庫 */
luaL_openlibs(L);
/* 運行指令碼 */
luaL_dofile(L, "test.lua");
/* 清除Lua */
lua_close(L);
/* 暫停 */
printf( "Press enter to exit…" );
getchar();
return 0;
}

編譯直接出錯,提示找不到標頭檔。

這個好辦,拷貝相關標頭檔到dev cpp include目錄,然後編譯,編譯成功!

繼續連結,很失望提示報錯。

上網搜尋了一下很多都是用vc編譯器的,也沒找到合適的解決辦法。

最後我仔細看了下,就連結靜態庫吧。

單擊工程選項,選擇參數

在連接器下方選擇添加正確的lib檔案。

連結通過,並產生的exe可以正確輸出。

 

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.