http://sourceforge.net/p/stlport/code/ci/STLport-5.2/tree/
去抓最新版,有cmake
裡面的靜態記得要 _STLP_USE_DYNAMIC_LIB 的定義喔~
編完後~
如果想用 stlport 取代掉 目前預設的 stl 就取代就好
現在要講的是如何兩套 stl 並存
我會假設看的人都會設程式庫路徑跟標頭檔路徑
先定義這兩行別的 stlport 跟內建的 stl 衝突
#define _STLP_USE_OWN_NAMESPACE 1
#define _STLP_DONT_REDEFINE_STD 1
加入 include 檔
#include <stlport/vector>
讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(42)

請參考:http://www.codeproject.com/Articles/16206/Call-C-code-from-C-and-read-an-array-of-struct-whi
我補個重點就好,
輸出那邊要勾 "註冊 COM Interop" 才會有tlb檔
*.tli 跟 *.tlh 都是不需要的
只有dll 可以用 http://msdn.microsoft.com/en-us/library/tzat5yw6.aspx
來產生 tlb 檔。
讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(63)
比如說我編譯 jpeg 這個 library
在 msvc 裡
動態的
jpeg.lib & jpeg.dll
靜態的
libjpeg.lib
讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(120)
獻給同是用C++做數值分析的研究生們!^^ 科科?
程式庫載點:http://ppt.cc/ENG9
程式載點:http://ppt.cc/ZVT-
從下面的結果可以看到一般 double 所不能做的運算,mpfr都能輕易做到。
計算
讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(121)
因為是近似的可能有誤差,我沒證明。
數學原理:
一.假設出上下兩面四邊形八個點
二.先把上下兩個面點的高平均
三.用海龍公式求出四邊形等於兩個三角形加起來
四.梯形公式上底加下底乘高把體積算出來
讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(149)
參考:http://www.cnblogs.com/oomusou/archive/2009/05/09/c_split.html
wstrings split(const wchar_t *str, const wchar_t *del )
{
int len = wcslen(str);
std::vector<wchar_t> tstr;
tstr.resize(len+1);
wcscpy(&tstr[0], str);
wstrings strs;
wchar_t *s = wcstok(&tstr[0], del);
while(s != NULL) {
strs.push_back(s);
s = wcstok(NULL, del);
}
return strs;
}
strings split(const char *str, const char *del )
{
int len = strlen(str);
std::vector<char> tstr;
tstr.resize(len+1);
strcpy(&tstr[0], str);
strings strs;
char *s = strtok(&tstr[0], del);
while(s != NULL) {
strs.push_back(s);
s = strtok(NULL, del);
}
return strs;
}
讓地獄深紅的天亮 發表在 痞客邦 留言(1) 人氣(124)
#include <windows.h>
#include <mmsystem.h>
#pragma comment(lib,"winmm.lib")
void PlayBGM(std::wstring path)
{
wchar_t buf[128];
//use mciSendString()
mciSendString((L"play "+ path).c_str(), buf, sizeof(buf),NULL);
mciSendString((L"setaudio " + path + L" volume to 200").c_str(), buf,sizeof(buf),NULL);
}
void StopBGN(std::wstring path)
{
wchar_t buf[128];
mciSendString((L"stop " + path).c_str(), buf, sizeof(buf),NULL);
}
讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(43)
變數使用:
__device__ 變數就算看的到也吃不到,真是機車的關鍵字。
__global__ 函數要使用的值如果不是用參數方式傳入,就要是__constant__或是texture memory才行,
也就是說__global__ 函數看的到__device__ 變數,但不能使用,一般cuda的__global__變數可以用參數的方式被使用。
重點就是__global__ 函數要傳很多參數進去...,不會變的參數最好用__constant__變數的方式傳入,可以省暫存器。
讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(166)
http://dslweb.nwnexus.com/~ast/dload/guicon.htm
備份一下,很多網頁常常死。
#include <windows.h>
#include <iostream>
#include <fstream>
#include <stdio.h>
#include <fcntl.h>
#include <io.h>
讓地獄深紅的天亮 發表在 痞客邦 留言(0) 人氣(283)
std::string ss;
scanf("%s",&ss);
printf("%s",&ss);
isok on vc9 真是嚇死我了。
讓地獄深紅的天亮 發表在 痞客邦 留言(5) 人氣(336)