Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Temporary pointer compile error on MacOS Sonoma with XCode 15.0 #33

Open
morotsgurka opened this issue Oct 14, 2023 · 4 comments
Open

Comments

@morotsgurka
Copy link
Contributor

When using the plugin with Unreal Engine 5.3.1 on MacOS Sonoma 14.0 and XCode 15.0, i get a compile issue in StringUtils.cpp.
The error is line 7:
const char* originalStr = TCHAR_TO_ANSI(*str);
where i get the following error: temporary whose address is used as value of local variable 'originalStr' will be destroyed at the end of the full-expression [-Werror,-Wdangling]

@Toernblom
Copy link

Same error here, Ubuntu 22.04 , UE 5.3.1

@Toernblom
Copy link

Toernblom commented Nov 22, 2023

Fixed by building https://github.com/eclipse/mosquitto from source.

Need to change a few things,

first in StringUtils.cpp from the plugin

auto convertedStr = StringCast<ANSICHAR>(*str);
const char* originalStr = convertedStr.Get();

In mosquitto src CMakeLists.txt

option(WITH_STATIC_LIBRARIES "Build static versions of the libmosquitto/pp libraries?" ON)
option(WITH_PIC "Build the static library with PIC (Position Independent Code) enabled archives?" ON)

in config.mk

WITH_STATIC_LIBRARIES:=yes

Then "make"

Move the outputs libmosquitto.so , libmosquittopp.so and _static to the thirdParty/linux/ appropiate folders.

i also added these lines to the build.cs of the plugin.

PublicAdditionalLibraries.Add("/usr/lib/x86_64-linux-gnu/libssl.a");
PublicAdditionalLibraries.Add("/usr/lib/x86_64-linux-gnu/libcrypto.a");

@YasserNezzari
Copy link

@Toernblom I had the same issue when packaging for android, your solution worked for me, thank you !

@morotsgurka
Copy link
Contributor Author

@Toernblom I've followed your steps and updated our fork of the plugin with the changes. One problem I have is that when building for shipping i get a lot of build errors because there exists 2 libssl.a,
Example:

"ld.lld: error: duplicate symbol: SSL_CTX_set_purpose"
"ld.lld: error: duplicate symbol: SSL_add1_host"

The definitions are:

  • /usr/lib/x86_64-linux-gnu/libssl.a (the one included in .Build.cs)
  • /dirToEngine/Engine/Source/ThirdParty/OpenSSL/1.1.1t/lib/Unix/x86_64-unknown-linux-gnu/libssl.a (Unreal's included OpenSSL)

I've tried to link to the engine provided libs but that does not seem to work (or I'm doing something wrong).
Found this on integrating third-party libraries into Unreal and tried to make the path relative to the Engine path (so it would work for more people than just my Unreal path).

OS: Ubuntu 22.04.4 LTS
Unreal Engine 5.3.2 (Linux)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants