[C++]江添亮さんのC++入門を動かしてみた。コンパイル済みヘッダー(precompiled header)

すとんりぱーさんのすすめてた

https://ezoeryou.github.io/cpp-intro

江添亮さんのC++入門を動かしてみた。コンパイル済みヘッダー(precompiled header)

all.h

#include <cstddef>
#include <limits>
#include <climits>
#include <cfloat>
#include <cstdint>
#include <cstdlib>
#include <new>
#include <typeinfo>
#include <exception>
#include <initializer_list>
#include <cstdalign>
#include <stdexcept>
#include <cassert>
#include <cerrno>
#include <system_error>
#include <string>

#if __has_include(<string_view>)
#   include <string_view>
#endif

#include <array>
#include <deque>
#include <forward_list>
#include <list>
#include <vector>
#include <map>
#include <set>
#include <unordered_map>
#include <unordered_set>
#include <queue>
#include <stack>
#include <iterator>
#include <algorithm>
#include <cfenv>
#include <random>
#include <numeric>
#include <cmath>
#include <iosfwd>
#include <iostream>
#include <ios>
#include <streambuf>
#include <istream>
#include <ostream>
#include <iomanip>
#include <sstream>
#include <fstream>

#if __has_include(<filesystem>)
#   include <filesystem>
#endif

#include <cstdio>
#include <cinttypes>


#include <regex>
#include <atomic>
#include <thread>
#include <mutex>
#include <shared_mutex>
#include <condition_variable>
#include <future>

using namespace std::literals ;

main.cpp

#include <iostream>

int main()
{
    std::cout << "hello C++ World" ;
}

cd_use_compiled_header.cmd    timeでの時間計測は自分の環境ではうまくいかない。

cd %~dp0
dir
g++ -std=c++17 -Wall --pedantic-errors -x c++-header -o all.h.gch all.h
dir
g++ -std=c++17 -Wall --pedantic-errors -include all.h -o program.exe main.cpp

program.exe

cmd /k

結果


C:\samples\ehararyu_cpp_sample\cpp>cd C:\samples\ehararyu_cpp_sample\cpp\

C:\samples\ehararyu_cpp_sample\cpp>dir
 ドライブ C のボリューム ラベルがありません。
 ボリューム シリアル番号は 9699-BA6D です

 C:\samples\ehararyu_cpp_sample\cpp のディレクトリ

2024/09/22  05:45    <DIR>          .
2024/09/22  04:37    <DIR>          ..
2024/09/22  04:51             1,217 all.h
2024/09/22  05:14               195 cd_use_compiled_header.cmd
2024/09/22  04:41                79 main.cpp
2024/09/22  05:14    <DIR>          step1
2024/09/22  05:14    <DIR>          step2
2024/09/22  05:45    <DIR>          step3
               3 個のファイル               1,491 バイト
               5 個のディレクトリ  3,792,160,215,040 バイトの空き領域

C:\samples\ehararyu_cpp_sample\cpp>g++ -std=c++17 -Wall --pedantic-errors -x c++-header -o all.h.gch all.h

C:\samples\ehararyu_cpp_sample\cpp>dir
 ドライブ C のボリューム ラベルがありません。
 ボリューム シリアル番号は 9699-BA6D です

 C:\samples\ehararyu_cpp_sample\cpp のディレクトリ

2024/09/22  05:47    <DIR>          .
2024/09/22  04:37    <DIR>          ..
2024/09/22  04:51             1,217 all.h
2024/09/22  05:47        45,898,292 all.h.gch
2024/09/22  05:14               195 cd_use_compiled_header.cmd
2024/09/22  04:41                79 main.cpp
2024/09/22  05:14    <DIR>          step1
2024/09/22  05:14    <DIR>          step2
2024/09/22  05:45    <DIR>          step3
               4 個のファイル          45,899,783 バイト
               5 個のディレクトリ  3,792,114,200,576 バイトの空き領域

C:\samples\ehararyu_cpp_sample\cpp>g++ -std=c++17 -Wall --pedantic-errors -include all.h -o program.exe main.cpp

C:\samples\ehararyu_cpp_sample\cpp>program.exe
hello C++ World
C:\samples\ehararyu_cpp_sample\cpp>cmd /k
C:\samples\ehararyu_cpp_sample\cpp>




[VScode][C++] VScode でCodeRunnerのRun In Tarminalが出てこないの解決方法(MinGW)(64bit Windows11)

参考URL

この記事に基づいて書きます。

https://qiita.com/ochx/items/01449d09777187790ee4

CodeRunner の 拡張機能の設定 Run In Tarminalが出てこない のは 

配色テーマ でダークモダンを選ばないと出てきませんでした。ライトモダンじゃだめだった。

ちゃんちゃん。

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/source010203
$ make
makefile:2: *** missing separator. Stop.

はmakefile の改行のあとが space だから Tab にする。

program : source.cpp
    cat source.cpp > program

source : source01 source02 source03
    cat source01 source02 source03 > source

program : source
	cat source > program

source : source01 source02 source03
	cat source01 source02 source03 > source

[C++] 江添亮さんのC++Windowsで入門する方法(MinGW)(64bit Windows11) Make編 

https://ezoeryou.github.io/cpp-intro

に基づいて書いてます。

MinGWに付属する GNU make ですが、ファイル名が mingw32-make.exe となっていると思います。 このままでは使いにくいのでファイルをコピーして make.exe にリネームした方がよいでしょう。

windowsで、timeコマンド touchコマンドをつかうには gitbashが必要だ

(1) https://gitforwindows.org/ にアクセスしてください。

(2) [Download]をクリックしてください。

あとは適当にインストールで。C:\Program Files\Git\git-bash.exe

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/source010203
$ make
makefile:2: *** missing separator. Stop.

はmakefile の改行のあとが space だから Tab にする。

program : source.cpp
    cat source.cpp > program

source : source01 source02 source03
    cat source01 source02 source03 > source

program : source
	cat source > program

source : source01 source02 source03
	cat source01 source02 source03 > source

うまくいった。

GitBash実行結果


furcr@furcraea_built MINGW64 /
$ cd C:/samples/ehararyu_cpp_sample/cpp

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp
$ cd source010203

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/source010203
$ make
makefile:2: *** missing separator.  Stop.

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/source010203
$ ^C

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/source010203
$

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/source010203
$ make
cat source01 source02 source03 > source
cat source > program

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/source010203
$ make
make: 'program' is up to date.

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/source010203
$ make
cat source > program

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/source010203
$ make
make: 'program' is up to date.

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/source010203
$ make
make: 'program' is up to date.

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/source010203
$ program
bash: program: command not found

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/source010203
$




Makefile

D : A B C
	cat A B C > D

A : a
	cat a > A

B : b
	cat b > B

C : c
	cat c > C

GitBash

furcr@furcraea_built MINGW64 ~
$ cd C:\samples\ehararyu_cpp_sample\cpp~
bash: cd: C:samplesehararyu_cpp_samplecpp~: No such file or directory

furcr@furcraea_built MINGW64 ~
$ cd C:\samples\ehararyu_cpp_sample\cpp
bash: cd: C:samplesehararyu_cpp_samplecpp: No such file or directory

furcr@furcraea_built MINGW64 ~
$ cd C:/samples/ehararyu_cpp_sample/cpp

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp
$ touch source01 source02 source03

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp
$ make
makefile:2: *** missing separator.  Stop.

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp
$ make
makefile:2: *** missing separator.  Stop.

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp
$ make
makefile:2: *** missing separator.  Stop.

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp
$ cd abc

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/abc
$ touch a b c

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/abc
$ make
Makefile:2: *** missing separator.  Stop.

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/abc
$ make
cat A B C > D

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/abc
$ touch b

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/abc
$ make
cat A B C > D

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/abc
$ time make
make: 'D' is up to date.

real    0m0.080s
user    0m0.015s
sys     0m0.000s

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/abc
$

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/abc
$ ^C

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/abc
$

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/abc
$

furcr@furcraea_built MINGW64 /c/samples/ehararyu_cpp_sample/cpp/abc
$

[UE5.3.2]パッケージ化エラーcompiling-cusers-username-appdata-local-temp-uatf-programfiles-epicgames-ue_5-3-rules-uat-rules-39638434eaa19de5f144482d776d2f34-dll-assembly-does-not-existの解決方法

Project contains multiple Game targets (UE53PuciCo2024G2, UE53PuciCo22G3) but no DefaultGameTarget is set in the [/Script/BuildSettings.BuildSettings] section of DefaultEngine.ini
UATHelper: パッケージ化 (Windows): (see C:\Users\notsuka\AppData\Roaming\Unreal Engine\AutomationTool\Logs\F+Program+Files+Epic+Games+UE_5.3\Log.txt for full exception trace)

Compiling C:\Users\UserName\AppData\Local\Temp\UAT\F+Program+Files+Epic+Games+UE_5.3\Rules\UATRules-39638434eaa19de5f144482d776d2f34.dll: Assembly does not exist

AIによると

  • アセンブリの問題 エラー「UATRules-39638434eaa19de5f144482d776d2f34.dll: Assembly does not exist」は、指定されたアセンブリが見つからない場合に発生します。この問題は、特に異なるプラットフォーム間でのビルド時に一般的です。source
  • 📋 確認すべき点 まず、DLLファイルがプロジェクトに正しく参照されているか、または適切な場所に存在するか確認してください。また、リモートビルド時には、WindowsとMac間でファイルが同期されているかも重要です。source
  • 💡 解決策 一部のユーザーは、必要なDLLを再インポートし、ライブラリフォルダーを手動で削除することで問題を解決しました。このプロセスで、ビルドキャッシュをクリアすることが役立つ場合があります。source

UE5のパッケージメニューの下の強制的 SDK 更新をする。

UE再起動 するもだめで

https://zenn.dev/posita33/books/ue5_starter_cpp_and_bp_001/viewer/chap_01_vs2022_setup

でwindows11SDKが入ってないことに気づいた

ファイル>からZIP圧縮したプロジェクトを

これだけの状態から開いたらクックが走るようになった!

パッケージ化完了

[UE5.3.2] LANDSCAPE: 1 ACTOR WITH PHYSICAL MATERIALS NEEDS TO BE REBUILTの解決

https://forums.unrealengine.com/t/ue5-landscape-physical-material-needs-to-be-rebuilt/484614

みなさん、こんにちは。私も同じ問題に遭遇しました。Build>Build All Landscape に移動すると、「物理マテリアルを再構築する必要があります」というエラーを解決できることが分かりました。 
[Landscape] ワールド構築がうまくいくことを祈っています。

解決しませんでした。

Landscapeを消しました。エラーは出ない

LandScapeをつくりなおしました。エラーが出る。

[UE5] メリーゴーランドに座らした人の制御なかなかうまくいかないです。

ControlRigシーンで作ったFBXはそのままは使えない pelvisがずれてました DCCツールで直してモーションは完成

座らせて固定するのは、座っているアニメーションをAnimMontageで指定しながら、コリジョンを無効化した状態でAttachActorToActor(or Component)を使用すれば可能です。

[UE5][UQ]アンリアルクエストのセーブゲームが存在するのに存在しないって言われるのなんでしたっけ? ちなみにプロジェクト内でゲームモードをUQのBP_GameModeにすれば動くが新たに作ったゲームモードだと動かない。解答

解答

SaveName変数のデフォルト値「RankingData」が入ってるか?
SaveNameのデフォルト値が Get SaveNameで使われてるか?

リファレンスの検索で最後に出てくる

WBP_Rankingで Cast して自分のゲームモードを読んでるか?

できた

[UE5.3.2]PostProcess Material で夕焼けを動的に変更したい。Dynamic Materialのように変更したいけどうまくいかないのでMaterialParameterCollectionで解決

MaterialParameterCollectionのファイル作って

ポストプロセスマテリアルの中身で参照させて

Set Vector param 呼び出すだけ

変更したいけどうまくいかないの状態

https://forums.unrealengine.com/t/change-post-process-material/448103/9

で解決の状態

https://dev.epicgames.com/documentation/en-us/unreal-engine/using-material-parameter-collections-in-unreal-engine?application_version=5.1