顯示具有 程式 標籤的文章。 顯示所有文章
顯示具有 程式 標籤的文章。 顯示所有文章

2021年8月23日 星期一

vscode csharp setting

先下載新版 mono 和 dotnet 先安裝好

再到 vscode user setting json 設定

"omnisharp.useGlobalMono": "always",
"omnisharp.monoPath": "/Library/Frameworks/Mono.framework/Versions/Current"

2017年12月6日 星期三

Setting up an OpenGL development environment in Ubuntu Linux

Setting up an OpenGL development environment in Ubuntu Linux

  • sudo apt-get install mesa-common-dev
  • sudo apt-get install freeglut3-dev

#include "GL/freeglut.h"
#include "GL/gl.h"

void renderFunction()
{
    glClearColor(0.0, 0.0, 0.0, 0.0);
    glClear(GL_COLOR_BUFFER_BIT);
    glColor3f(1.0, 1.0, 1.0);
    glOrtho(-1.0, 1.0, -1.0, 1.0, -1.0, 1.0);
    glBegin(GL_POLYGON);
        glVertex2f(-0.5, -0.5);
        glVertex2f(-0.5, 0.5);
        glVertex2f(0.5, 0.5);
        glVertex2f(0.5, -0.5);
    glEnd();
    glFlush();
}

int main(int argc, char** argv)
{
    glutInit(&argc, argv);
    glutInitDisplayMode(GLUT_SINGLE);
    glutInitWindowSize(500,500);
    glutInitWindowPosition(100,100);
    glutCreateWindow("OpenGL - First window demo");
    glutDisplayFunc(renderFunction);
    glutMainLoop();    
    return 0;
}
 
 
g++ gltest.cc -lglut -lGL -o go 

 

2015年11月17日 星期二

openssl compiler for 1.0.2d

OpenSSL

Before starting: Make sure you have the necessary folders and permissions — get more information.


Links: Homepage | Downloads
Dependencies: None
Version: 
The OpenSSL Project is a collaborative effort to develop a robust, commercial-grade, full-featured, and Open Source toolkit implementing the Secure Sockets Layer (SSL v2/v3) and Transport Layer Security (TLS v1) protocols as well as a full-strength general purpose cryptography library.

Get the Code

Switch to /usr/local/src and download the source package.
cd /usr/local/src
curl --remote-name http://www.openssl.org/source/openssl-1.0.2d.tar.gz
Extract the archive and move into the folder.
tar -xzvf openssl-1.0.2d.tar.gz
cd openssl-1.0.2d

Compile and Install

Configure, compile and install into /usr/local/openssl-1.0.2d.
./configure darwin64-x86_64-cc --prefix=/usr/local/openssl-1.0.2d
make
make install
Create a symbolic link that points /usr/local/openssl to /usr/local/openssl-1.0.2d.
ln -s openssl-1.0.2d /usr/local/openssl

Shell

Execute the following lines to update your Bash startup script.
echo 'export PATH=/usr/local/openssl/bin:$PATH' >> ~/.bash_profile
echo 'export MANPATH=/usr/local/openssl/ssl/man:$MANPATH' >> ~/.bash_profile
Load the new shell configurations.
source ~/.bash_profile

Certificates

Execute the following lines to install the certificates.
security find-certificate -a -p /Library/Keychains/System.keychain > /usr/local/openssl/ssl/cert.pem
security find-certificate -a -p /System/Library/Keychains/SystemRootCertificates.keychain >> /usr/local/openssl/ssl/cert.pem

Verify the Installation

Verify that you have successfully installed OpenSSL.
openssl version -a

2015年10月16日 星期五

osx 10.11 install wxwidgets + codeblock + gdb

首先下載安裝 Command_Line_Tools_OS_X_10.11_for_Xcode_7.dmg

下載  wxWidgets-3.0.2 source code 在 mac 上解開後
為了方編開始進行 wxwidgets 編譯前的參數寫成一個 script 檔 c.sh
設定如下, 若要改安裝目錄則改 prefix 設定

OSXSDK_PATH=/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk

./configure --prefix=/Users/Shared/workspace/3partysdk \
--with-osx_cocoa \
--without-subdirs \
--enable-debug \
--disable-shared \
--enable-unicode \
--enable-monolithic \
--disable-dependency_tracking \
--disable-universal \
--enable-universal-binary=x86_64 \
--with-macosx-version-min=10.11 \
--with-macosx-sdk=${OSXSDK_PATH} \
CXXFLAGS="-stdlib=libc++ -std=c++11 -I${OSXSDK_PATH}/usr/include/c++/4.2.1 -arch x86_64" \
OBJCXXFLAGS="-stdlib=libc++ -std=c++11 -arch x86_64" \
CPPFLAGS="-stdlib=libc++ -I${OSXSDK_PATH}/usr/include/c++/4.2.1 -arch x86_64" \
LDFLAGS="-stdlib=libc++" \
CXX=clang++ CXXCPP="clang++ -E" CC=clang CPP="clang -E"


在終端機 command 下  sh c.sh 執行參數設定後
再執行 make -j8; make install 


接下來下載 codeblock 進行安裝
安裝後用 codeblock 開啟一個新的 wxwidgets 專案
進行 gcc 編譯參數設定如下

Build Option -> Selected compiler
選擇  GUN GCC Compiler

wxWidgets 本身會出現的 warning 不是普通的多, 所以我通通關掉
Build Option -> Compiler settings -> Others options
-mmacosx-version-min=10.5
-Wunused-parameter
-Wno-ctor-dtor-privacy
-Woverloaded-virtual
-Wno-deprecated-declarations
-Wno-potentially-evaluated-expression
-Wno-unused-parameter
-Wno-invalid-source-encoding
-fno-strict-aliasing
-fno-common
-Wno-old-style-cast
-Wno-c++11-long-long
-Wno-reserved-id-macro
-Wno-duplicate-enum
-Wno-variadic-macros
-Wno-padded
-Wno-sign-conversion
-Wno-weak-vtables
-Wno-float-equal
-Wno-exit-time-destructors
-Wno-global-constructors
-Wno-documentation-unknown-command
-Wno-documentation
-Wno-exit-time-destructors
-Wno-float-conversion
-Wno-shorten-64-to-32
-Wno-missing-prototypes

Build Option -> Compiler settings -> #define
__WXOSX_COCOA__
_FILE_OFFSET_BITS=64
WX_PRECOMP
NDEBUG

Build Option -> Linker settings -> Other linker options:
-mmacosx-version-min=10.5
-framework IOKit
-framework Carbon
-framework Cocoa
-framework AudioToolbox
-framework System
-framework OpenGL
-framework WebKit
-lwx_osx_cocoau_aui-3.0
-lwx_osx_cocoau_html-3.0
-lwx_osx_cocoau_adv-3.0
-lwx_osx_cocoau_core-3.0
-lwx_baseu_xml-3.0
-lexpat
-lwx_baseu-3.0
-lwxtiff-3.0
-lwxjpeg-3.0
-lwxpng-3.0
-lwxregexu-3.0
-lz
-lpthread
-liconv
-llzma

Build Option -> Search directories -> Compiler
../../../../../Shared/workspace/3partysdk/include/wx-3.0
../../../../../Shared/workspace/3partysdk/lib/wx/include/osx_cocoa-unicode-static-3.0

Build Option -> Search directories -> Linker
/Users/Shared/workspace/wxWidgets-3.0.2/lib

Build Option ->Pre/Post Build steps ->post-build steps 
Rez 預設路徑是錯的, 把路徑拿掉如下即可

Rez -d __DARWIN__ -t APPL Carbon.r -o $(TARGET_OUTPUT_FILE)

Debugger settings -> CDG/CDB debugger->Executable path:
/usr/local/Cellar/gdb/7.10/bin/gdb


設定完即可開始進行 compiler 了