Crosscompiling (win->linux) libraries and -fno-rtti

Hello everyone, Im kinda stuck at the problem that comes with crosscompiling from windows to linux (clang 3.7) while using 3rd party libraries such as mysqlcppconn. Im not able to compile my project without getting these errors:

Severity	Code	Description	Project	File	Line	Suppression State
Error		cannot use typeid with -fno-rtti	ProjectName    ...\MySQLCPPConn\include\cppconn\Variant.h	78

Im not really a professional programmer so I could really need help on this, I searched on google for the problem for hours over a week now, but the only thing I could find is that I should (as the error also mentions) enable RTTI. Yeah well… I know! I tried! It doesnt work… ProjectName.build.cs bUseRTTI = true; no compile errors but also no effect.
I also set UEBuildConfiguration.bForceEnableExceptions = true; Because it solved the issue with the boost libs that are req. for the mysqlcppconn libs.
It works pretty fine on windows, no compile errors - no problems, but as I switch to linux / dev server - 10 seconds after i build it, I can cancel it due to the error spam.

I never worked with libs nor crosscompile toolchains before, not talking about combining them with the UBT. Thats a little bit out of my scope and trying to get knowledge about it out of the internet couldnt really help me due to the specific topic.
IIRC I dont have to use the linux libs → .so .a if im compiling from win → linux with a toolchain to get it work, right?

using UnrealBuildTool;


public class ProjectName: ModuleRules
{
	public ProjectName(TargetInfo Target)
	{
        bUseRTTI = true;
...
  • Thats how my ProjectName.build.cs looks like.
  • Clang 3.7
  • UE4.13
  • VS15
  • no compile errors on win
  • enabling RTTI “doesnt work”

And on top of that, Im using the dynamic libs, so if I would be able to compile the project for linux, and im transfering it on my linux server, the only thing i have to do is swap the .dll at the binaries location with the .so, hopefully thats the correct way, otherwise im stuck with a new problem, that leads to switching away from the mysqlcppconn lib completely.

Hi @, did you solve your problem?

I’m having the same problem and I have no idea about how to solve it. I spent a whole week on this topic with 0% progress…

If the answer is yes, how did you solve it?

Sadly - no, even after searching around for weeks.
I didnt tested it on the newer git releases though.

For the database stuff:
I’m going to switch to php for the database connection, Afaik there are good plugins already set up for that.