跳到主要內容

發表文章

目前顯示的是 1月, 2017的文章

live code in blog

KLIPSE 是一個可以產生互動式程式碼的網頁套件,換言之,在網頁上顯示你的程式碼,可以讓觀賞者修改並且輸出程式碼的結果。與其他顯示原始程式碼的 javascript 套件不同之處在於 live 與 interactive,live 的功能可以即時顯示程式碼的結果,interactive 讓使用者可以修改,因此,使用者可以在網頁、部落格上面修改程式碼,並且即時顯示修改後的結果。實際安裝測試,確實可以達到上面所提到的效果。 在 KLIPSE 文件有一段話: In order to integrate the klipse plugin on a blog, library documentation or any other web page, add the following javascript tag at the end of the page body according to the language of the code snippets: 必須要安裝在網頁 body 標籤底部,實際測試時,只需將下列這一段程式碼放到最後:   < script src = " https://storage.googleapis.com/app.klipse.tech/plugin_prod/js/klipse_plugin.min.js " ></ script > 另外兩個重要連結為: < link rel = " stylesheet " type = " text/css " href = " https://storage.googleapis.com/app.klipse.tech/css/codemirror.css " > < script > window . klipse_settings = { selector_eval_js : ' .language-klipse-cpp ' , // css selector for the html elements you want to klipsify }; </

Using Clang++ in CMD

LLVM Project 的 Clang++ 無法使用 GCC 的 c++ standard library,在 Johannes Peter 的 Installing clang++ to compile and link on Windows : Part 2 文章介紹如何在 command line 中可以 include <iostream> 來 compile C++ 程式碼,主要是要使用文章所提及的 clang 3.7.0 (release candidate 3) 64 bit 這個版本,這個版本的 clang++ 是 Target: x86_64-w64-windows-gnu,注意:不是目前3.9 for windows-msvc 版,因此,下載時需要注意版本。依照文章的設定步驟,可以在 cmd 中編譯 C++ 程式,在 stackOverflow 的問題 ,是相同的問題,如果需要更新的版本,可以選擇使用 clang-cl 或者 msys 環境下的設定方式。 設定的注意事項: 需要下載 文章內連結的 mingw64 版本,放置在 c:\ 中 如果不需要編譯 win32 版本的程式,不需要下鮺 mingw32 版本 需要下載 clang 3.7.0 (release candidate 3) 64 bit 這個版本 設定所有的環境變數 執行 setgcc64.bat 檔 切換到 workspace 執行 clang++ main.cpp -o main.exe -std=c++14