c++

Profil

c++

-lProfilPackages -lProfil -lBias -llr

autoconf automake

c++

automake は,バージョンの違いに敏感. ここでは version 1.9 についてメモしておく. # automake --version automake (GNU automake) 1.9.4

文字列読み込み 数値変換

c++

%e で double を読み込むとエラー %le を使うこと%*s の*は,その token を無視する(代入先を設定しない)という意味. 読みとばすからといって,適当な型を指定してはいけない.(全読み込みがパーになる.) #include <string> int main(){ std::string line = "</string>…

ublas 粗行列 sparse matrix

c++

http://www.boost.org/libs/numeric/ublas/doc/ boost::numeric::ublas::mapped_matrix sp_mt(10, 10); ↓これはできない. boost::numeric::ublas::sparse_matrix sp_mt(10, 10); ↓こんなエラーがでる. Clotho.cc:38: error: ‘sparse_matrix’ is not a memb…

undefined reference to Hoge::meso()

c++

なるエラーが include しているから見えてるはずなのにでてくる.原因 inline 関数を .h で宣言,.cpp で定義という風にしてたのが原因?inline 書き忘れてただけ?ヘッダーファイル .h 内で inline で 定義したら消えた. .h で非 inline で定義したやつは…

undefined reference to

c++

http://www.ecoop.net/coop/tips/cpp.htmltypeinfo virtual 宣言したものを,=0 つけてない or 実装してない.

OpenGL 描画面を画像として保存する

c++

glReadPixels() でピクセル情報とってきて,他のライブラリにまわすっきゃない? 簡単な方法を調べ中.下はメモ.JPEGで保存のサンプルプログラム http://www.asahi-net.or.jp/~yw3t-trns/opengl/samples/imgsavejpeg/index.htm mkOpenGLJPEGImage (シェア…

旧 GLUI インストール

c++

以下は,以前書いたインストールのまとめ.glui のバージョンも古い.version 2.2

GLUI インストール

c++

新たなバージョンは, http://sourceforge.net/projects/glui 等で手に入る.glui_2.35 について glui-2.35.zip をダウンロード [downloads]# unzip glui-2.35.zip [downloads]# mv glui-2.35 /usr/local/share [downloads]# cd /usr/local/share/glui-2.35/…

わけわからんエラーがでたら gcc のバージョンを下げてみる

c++

Fedora Core 5 にしたら,gcc のバージョンアップが原因で動かなくなったプログラムあり. gcc のバージョン確認 $gcc -v gcc バージョン 4.1.1 20060525 config ファイルや Makefile で "gcc" を,"gcc32" に, "g++" を "g++32" に書き換える. これで動き…

hsb to rgb

c++

from http://nuttybar.drama.uga.edu/pipermail/dirgames-l/2001-March/006061.html

文字列と数値の変換

c++

sscanf を使うとよい. http://d.hatena.ne.jp/uniker/20070509 おまけ文字列を double に string str = "0.1"; atof(str->c_str());http://cham.ne.jp/piro/cpp_sample.html#itos int を 文字列に int n = 3; stringstream str_stream; str_stream << n; re…