This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
* V4L2 video capture example | |
* | |
* This program can be used and distributed without restrictions. | |
* | |
* This program is provided with the V4L2 API | |
* see http://linuxtv.org/docs.php for more information | |
*/ | |
#include <stdio.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
add:LIBCMTD.lib under the setting->linker->input->Ignore specific library->LIBCMTD.lib |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// WTL cpp | |
//////////////////////////////////////////////////////////////////////////////////////// | |
#include <atlframe.h> | |
#include <atlsplit.h> | |
#include <atlctrls.h> | |
#include <atlctrlw.h> | |
#include <atlctrlx.h> | |
#include <atlddx.h> | |
#include "resource.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int popcnt(unsigned int v) | |
{ | |
v = v - ((v >> 1) & 0x55555555); // reuse input as temporary | |
v = (v & 0x33333333) + ((v >> 2) & 0x33333333); // temp | |
return (((v + (v >> 4) & 0xF0F0F0F) * 0x1010101) >> 24); // count | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
g++ -L/my/dir/path/ -Wl,-rpath=/my/dir/path/ -l:foo.so -l:bar.so |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TARGET ?= a.out | |
SRC_DIRS ?= ./src | |
INC_DIRS ?= ./include | |
SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *.s) | |
OBJS := $(addsuffix .o,$(basename $(SRCS))) | |
DEPS := $(OBJS:.o=.d) | |
LDLIBS := -Wl,-rpath=/foo/lib/ -l:libbar.so -L/usr/lib -lstdc++ -L./lib -lbar |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TARGET ?= libbar.so | |
SRC_DIRS ?= ./src | |
INC_DIRS ?= ./include | |
SRCS := $(shell find $(SRC_DIRS) -name *.cpp -or -name *.c -or -name *.s) | |
OBJS := $(addsuffix .o,$(basename $(SRCS))) | |
DEPS := $(OBJS:.o=.d) | |
LDLIBS := -L/usr/lib -lstdc++ -lm -shared -Wl,-soname,$(TARGET) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
la $r2, 0x98C40000 | |
li $r1, 0x38 | |
swi $r1, [$r2] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Make sure you grab the latest version | |
curl -OL https://github.com/google/protobuf/releases/download/v3.2.0/protoc-3.2.0-linux-x86_64.zip | |
# Unzip | |
unzip protoc-3.2.0-linux-x86_64.zip -d protoc3 | |
# Move protoc to /usr/local/bin/ | |
sudo mv protoc3/bin/* /usr/local/bin/ | |
# Move protoc3/include to /usr/local/include/ |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://wiki.videolan.org/Win32Compile/ | |
## some hints: | |
git clone https://git.code.sf.net/p/mingw-w64/mingw-w64 | |
sudo cp -a ./mingw-w64/mingw-w64-headers/include/* /usr/i686-w64-mingw32/include/ | |
../configure --host=i686-w64-mingw32 --build=x86_64-linux-gnu --disable-chromecast # protoc compiler version error |