Skip to content

Instantly share code, notes, and snippets.

View yossi-tahara's full-sized avatar

Yoshinori Tahara yossi-tahara

View GitHub Profile
@yossi-tahara
yossi-tahara / main-bigger.cpp
Created December 5, 2016 02:23
MinGW trouble shooting
#include <iostream>
template<int tInt>
struct Class0
{
int mInt0;
int mInt1;
int mInt2;
int mInt3;
Class0() : mInt0(tInt+0), mInt1(tInt+1), mInt2(tInt+2), mInt3(tInt+3) { }
@yossi-tahara
yossi-tahara / CMakeLists.txt
Last active December 6, 2016 08:36
C++形式の動的リンク・ライブラリの書き方(msvc編)の付録
project(Test)
add_library(sub SHARED sub.cpp dll.h)
add_executable(main main.cpp dll.h)
target_link_libraries(main sub)
@yossi-tahara
yossi-tahara / CMakeLists.txt
Last active December 7, 2016 08:36
C++形式の共有ライブラリの書き方(gcc編)の付録
cmake_minimum_required(VERSION 3.5.0)
# MSVCの通常使わないビルド・モードとZERO_CHECKプロジェクトの削除
set(CMAKE_CONFIGURATION_TYPES "Debug;Release" CACHE STRING "Configs" FORCE)
set(CMAKE_SUPPRESS_REGENERATION TRUE)
# プロジェクト設定
project(Test)
if(WIN32)
@yossi-tahara
yossi-tahara / CMakeLists.txt
Last active June 6, 2017 15:41
Theolizer技術解説(2016/09/01) 簡単な構造体を保存/回復する
#[[###########################################################################
Theolizer紹介用サンプルCMakeLists.txt
]]############################################################################
if("${CMAKE_VERSION}" STREQUAL "")
set(CMAKE_VERSION, 3.5.0)
endif()
cmake_minimum_required(VERSION ${CMAKE_VERSION})
message(STATUS "BOOST_ROOT=${BOOST_ROOT}")
@yossi-tahara
yossi-tahara / CMakeLists.txt
Last active July 29, 2018 14:45
第30回 可変長引数テンプレート応用編(C++版お手軽printf関数)
cmake_minimum_required(VERSION 3.5.1)
project(sample)
find_package(Boost)
include_directories("${Boost_INCLUDE_DIR}")
if(MSVC)
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} /W4 /EHsc")
else()
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Wall -std=c++11")
@yossi-tahara
yossi-tahara / MainWindow.cpp
Last active July 25, 2020 09:43
第4回 QMLで記述したウィンドウをC++から制御する
#include <QCoreApplication>
#include "MainWindow.h"
// ***************************************************************************
// コンストラクタ
// ***************************************************************************
MainWindow::MainWindow() :
WindowBase("qrc:/MainWindow.qml")
@yossi-tahara
yossi-tahara / Common.h
Last active October 31, 2020 12:56
第7回 Qtの重要な仕組みSignalとSlot(マルチスレッド編1)
#ifndef COMMON_H
#define COMMON_H
#include <QDebug>
#include <QDateTime>
#include <QThread>
inline void log(QString const& iMessage)
{
qDebug().noquote() << QDateTime::currentDateTime().toString("HH:mm:ss.zzz") << QThread::currentThreadId() << iMessage;