アプリケーションの.exeを実行しようとすると、この問題が発生します。「デバッグアサーションに失敗しました!、式が無効なnullポインタです」
少しグーグルした後、私は問題がどこにあるかを知っていると思いますが、それを解決する方法がわかりません。
以下は、関連するコードです。
size_t idx;
// create the initial texture
atlases.push_back(new TextureAtlas( image_names.size()));
// load the texture
for (idx = 0; idx < image_names.size(); ++idx) {
//load the image
TextureInformation *ti = new TextureInformation (idx, folder_location_str, image_names[idx]);
tiが初期化され、ローカルタブ(ms visual c ++ 2008)で値が宣言された行でコードを実行すると、次のようになります。
ti TextureInformation *
idx CXX0030: Error: expression cannot be evaluated
image_path {npos=4294967295 _Bx={...} _Mysize=??? ...} std::basic_string<char,std::char_traits<char>,std::allocator<char> >
image_name {npos=4294967295 _Bx={...} _Mysize=??? ...} std::basic_string<char,std::char_traits<char>,std::allocator<char> >
image CXX0017: Error: symbol "" not found
何らかの理由で:idxとimageはここでエラーを示し、これはforループの最初の反復中にのみ発生します。以下は、2回目の反復中のtiの内容です。
idx 0 unsigned int
+ image_path ".....Related\PNG\" std::basic_string<char,std::char_traits<char>,std::allocator<char> >
+ image_name "basn0g01.png" std::basic_string<char,std::char_traits<char>,std::allocator<char> >
+ image 0x00812830 {m_info={...} m_pixbuf={...} } png::image<png::basic_rgba_pixel<unsigned char> > *
これは私のTextualInformationがどのように見えるかです
class TextureInformation
{
public:
TextureInformation(size_t index, std::string path, std::string name)
: idx(index), image_path(path), image_name(name)
{
image = new png::image<png::rgba_pixel>(image_path + image_name,
png::convert_color_space<png::rgba_pixel>());
}
~TextureInformation(void)
{
delete image;
}
....
....
private:
size_t idx;
std::string image_path;
std::string image_name;
png::image<png::rgba_pixel>* image;
};
その他の詳細が必要な場合は教えてください。ありがとう