DXアーカイブファイルを使うの場合は"画像ファイルがありません"のエラーが起きしました。

フォーラム(掲示板)ルール
フォーラム(掲示板)ルールはこちら  ※コードを貼り付ける場合は [code][/code] で囲って下さい。詳しくはこちら
アバター
WIWO井遠
記事: 2
登録日時: 1年前

DXアーカイブファイルを使うの場合は"画像ファイルがありません"のエラーが起きしました。

#1

投稿記事 by WIWO井遠 » 1年前

如题,本人的操作系统是windows10,编译环境为visual studio 2010,dxlib的版本为3.24b。当我使用dxEncode将游戏数据打包成为dxa之后,我的代码告诉我文件不存在。(注:dxa包已经和exe文件放在一起)。
我的读取文件代码如下:

コード:

int Title = LoadGraph("data\\Title.png");
我已经尝试修改文件路径的写法为"\""/""//"了,但是这不起任何作用,但是以前我在win7电脑使用同样的vs2010版本以及同样的dxlib版本时,打包成dxa文件就没有出现无法读取的问题,我也试着把以前在win7电脑上做的那个项目的数据文件在win10的环境下打包成dxa,但是也是会出现同样无法读取dxa内部文件的问题,我在想是不是操作系统的问题,或者是编译器的问题?

私は中国人、日本語書くが苦手ご見諒します。
I'm from china.please forgive I'm not so good at explain my question in japanese.So I write it in chinese.
添付ファイル
屏幕截图 2022-11-03 110101.png
屏幕截图 2022-11-03 110101.png (22.76 KiB) 閲覧数: 5462 回
屏幕截图 2022-11-03 110038.png

アバター
みけCAT
記事: 6734
登録日時: 13年前
住所: 千葉県
連絡を取る:

Re: DXアーカイブファイルを使うの場合は"画像ファイルがありません"のエラーが起きしました。

#2

投稿記事 by みけCAT » 1年前

とりあえずDeepL翻訳した結果を置いておきますね。
WIWO井遠 さんが書きました:
1年前
質問ですが、OSはwindows10、コンパイル環境はvisual studio2010、dxlibのバージョンは3.24bです。 dxEncodeを使ってゲームデータをdxaとしてパッケージ化すると、コードがファイルが存在しないと表示されます。 (注:dxaパッケージはexeファイルと一緒にまとめられています)。
ファイルを読み込むための私のコードは以下の通りです。

コード:

int Title = LoadGraph("data\\Title.png");
しかし、以前、同じvs2010のバージョンと同じdxlibのバージョンを使って、win7のコンピュータでdxaファイルにパッキングすることに問題はありませんでした。また、以前win7コンピュータで行ったプロジェクトのデータファイルを、win10のコンピュータでdxaファイルにパッキングしてみました。 また、Win7で進めていたプロジェクトのデータファイルをWin10でdxaにパッケージングしてみましたが、dxaの内部ファイルが読めないという同じ問題が発生し、OSの問題なのかコンパイラの問題なのか、気になるところです。
Windows 10、g++ (GCC) 4.8.1 でアーカイブからの読み込みができました。
バイナリを用意したので、読み込みができるか試してみてください。
test.zip (添付に失敗したので、外部のサイトに置きました)

プログラムはエクスプローラから直接起動していますか?それともVisual Studioからですか?
Visual Studioから起動した場合、カレントディレクトリがexeファイルがあるディレクトリとは別のディレクトリになり、
読み込み失敗の原因になるかもしれません。

パスに一部の文字コードで表現できない文字が含まれると、読み込み失敗につながるかもしれません。
半角英数字のみからなるパスに置いて試してみてください。

I succeeded to read a file from an archive file using Windows 10 and g++ (GCC) 4.8.1.
Please try this binary to check if the read succeeds in your environment.
test.zip (I put this on an external site because attaching this file failed)

Are you launching your program directly from Explorer, or from Visual Studio?
When launched from Visual Studio, the working directory may differ from wher the exe file is located,
and it may lead to failure of loading.

Using characters that cannot be represented in some character code in the file path may lead to failure of loading.
Please try placing your program and data in a path that contains only half-width English alphabets and digits.
添付ファイル
hoge.zip
original file for archive
(1.96 KiB) ダウンロード数: 71 回
複雑な問題?マシンの性能を上げてOpenMPで殴ればいい!(死亡フラグ)

アバター
usao
記事: 1887
登録日時: 11年前

Re: DXアーカイブファイルを使うの場合は"画像ファイルがありません"のエラーが起きしました。

#3

投稿記事 by usao » 1年前

オフトピック
Hello.

I want to recommend to write in English instead of in Chinese.
This is because most Japanese have no experience using Chinese, but have some experience learning English at school.

アバター
WIWO井遠
記事: 2
登録日時: 1年前

Re: DXアーカイブファイルを使うの場合は"画像ファイルがありません"のエラーが起きしました。

#4

投稿記事 by WIWO井遠 » 1年前

みけCAT さんが書きました:
1年前
とりあえずDeepL翻訳した結果を置いておきますね。
WIWO井遠 さんが書きました:
1年前
質問ですが、OSはwindows10、コンパイル環境はvisual studio2010、dxlibのバージョンは3.24bです。 dxEncodeを使ってゲームデータをdxaとしてパッケージ化すると、コードがファイルが存在しないと表示されます。 (注:dxaパッケージはexeファイルと一緒にまとめられています)。
ファイルを読み込むための私のコードは以下の通りです。

コード:

int Title = LoadGraph("data\\Title.png");
しかし、以前、同じvs2010のバージョンと同じdxlibのバージョンを使って、win7のコンピュータでdxaファイルにパッキングすることに問題はありませんでした。また、以前win7コンピュータで行ったプロジェクトのデータファイルを、win10のコンピュータでdxaファイルにパッキングしてみました。 また、Win7で進めていたプロジェクトのデータファイルをWin10でdxaにパッケージングしてみましたが、dxaの内部ファイルが読めないという同じ問題が発生し、OSの問題なのかコンパイラの問題なのか、気になるところです。
Windows 10、g++ (GCC) 4.8.1 でアーカイブからの読み込みができました。
バイナリを用意したので、読み込みができるか試してみてください。
test.zip (添付に失敗したので、外部のサイトに置きました)

プログラムはエクスプローラから直接起動していますか?それともVisual Studioからですか?
Visual Studioから起動した場合、カレントディレクトリがexeファイルがあるディレクトリとは別のディレクトリになり、
読み込み失敗の原因になるかもしれません。

パスに一部の文字コードで表現できない文字が含まれると、読み込み失敗につながるかもしれません。
半角英数字のみからなるパスに置いて試してみてください。

I succeeded to read a file from an archive file using Windows 10 and g++ (GCC) 4.8.1.
Please try this binary to check if the read succeeds in your environment.
test.zip (I put this on an external site because attaching this file failed)

Are you launching your program directly from Explorer, or from Visual Studio?
When launched from Visual Studio, the working directory may differ from wher the exe file is located,
and it may lead to failure of loading.

Using characters that cannot be represented in some character code in the file path may lead to failure of loading.
Please try placing your program and data in a path that contains only half-width English alphabets and digits.
I have downlaoded your test file , but an error occured while I'm trying to open the exe file(error picture is below),it means libstdc++.dll and libgcc_s_dw2-1.dll was not found. This question may relate to the lack of gcc compiler or just it's my computer's problem?

In addition ,I have launched my program both from Explorer and Compiler,but both it dose not work.
添付ファイル
屏幕截图 2022-11-07 164008.png
屏幕截图 2022-11-07 164008.png (17.21 KiB) 閲覧数: 5357 回
屏幕截图 2022-11-07 163940.png
屏幕截图 2022-11-07 163940.png (16.84 KiB) 閲覧数: 5357 回

アバター
みけCAT
記事: 6734
登録日時: 13年前
住所: 千葉県
連絡を取る:

Re: DXアーカイブファイルを使うの場合は"画像ファイルがありません"のエラーが起きしました。

#5

投稿記事 by みけCAT » 1年前

WIWO井遠 さんが書きました:
1年前
I have downlaoded your test file , but an error occured while I'm trying to open the exe file(error picture is below),it means libstdc++.dll and libgcc_s_dw2-1.dll was not found. This question may relate to the lack of gcc compiler or just it's my computer's problem?
Oops.
I added static link option, so this version should work.
test_static.zip
複雑な問題?マシンの性能を上げてOpenMPで殴ればいい!(死亡フラグ)

返信

“C言語何でも質問掲示板” へ戻る