본문 바로가기

Programming123

C++ Multi Platform Issues Little Endian & Big Endianstruct 의 경우 variable의 bit order 변경 뿐 아니라 variable의 순서도 바뀌게 된다. 따라서 아래와 같이 little endian에서 작성된 struct는 big endian machine 에서 역순으로 기술되어야 한다. 1234567891011121314struct _MULTI_PLATFORM_STRUCT { #ifdef _IS_LITTLE_ENDIAN_ // _IS_LITTLE_ENDIAN_ is a custom definition to explain the variable order unsigned int pos : 20; unsigned int weight : 5; unsigned int field : 2; unsigned .. 2014. 7. 1.
Frequently used bash commands 자주 사용하는 Bash 명령어들을 정리해보았다.ArrayAssociative Array12345678910111213declare -A fullAddr # Create an associative array fullAddr[inc]=Incheon # Insert key,value to arrayfullAddr[sul]=Seoul # Insert key,value to array location=incecho "Address List : ${fullAddr[@]}"echo "Current Address : ${fullAddr[${location}]}" # export env by using the value of variable# (ex) export TEST_SRC=/home/myaccountprefix=.. 2014. 3. 31.
Comparing bash script / windows cmd script for loopbash 1234export CLASSPATH=$YOUR_PATH/test.jarfor file in $YOUR_PATH/lib/*.jar; do CLASSPATH=${CLASSPATH}:$file;done cmd 12345setlocal EnableDelayedExpansionset CLASSPATH=%YOUR_PATH%\test.jarfor /R %YOUR_PATH%\lib %%file in (*.jar) do ( set CLASSPATH=!CLASSPATH!;%%file ) Argument (args)bash 1echo "Your Arguments : $*" cmd 1echo "Your Arguments : %*" 2013. 11. 8.
Tips for C++ compiling Issues GCCFix LD_LIBRARY_PATH at compile time”-rpath ” or “-Wl,-rpath,” 1$ gcc -lstdc++ -lz -lpthread -o test test.o -Wl,-rpath,/sample/dynamic/library/path General TipsCheck the dependency of dynamic library ( .so file ) 1$ ldd sample.so 2013. 7. 31.