Page 1 of 2
GCC-4.2 and Unreal public headers
Posted: Fri Feb 13, 2009 2:03 pm
by qduaty
I'm going to replace the original lighting model in UTGLR with a parallax mapping shader. GL is better than DX since it also works on linux.
I started to build UTGLR, but it seems the Unreal headers 224 are too old (or MSVC-specific) and linux gcc 4.2 does not want to compile them. I got no idea how to make it working. Any advice?
Re: GCC-4.2 and Unreal public headers
Posted: Fri Feb 13, 2009 5:37 pm
by []KAOS[]Casey
I've only gotten them to work on visual studio 6.0, smirf will know more about converting them.. and you might want to use gold headers, but if its for your own use do whatever..

Re: GCC-4.2 and Unreal public headers
Posted: Fri Feb 13, 2009 7:02 pm
by Smirftsch
well - to be honest- no chance for you alone.
You'd need the lib files to link against, which are not available for Linux anyway. Not even the UT sources contain them. The complete code (neither 224 nor ugold or UT's) is not compatible with gcc4. UT's public header could be compiled with gcc 2.93 but still the public sources contain only the windows .lib files, not the necessary .o files for Linux.
Aside this, only Unreal 227 is having a Linux port.
I made the code compilable with gcc 3.x and 4.x but I'm not allowed to release anything from it and epic doesn't answer me currently any mails, guess Unreal is really not important anymore for them to bother with it.
There is only 1 chance, you make it with Windows, and I'm gonna compile it for Linux then.
Re: GCC-4.2 and Unreal public headers
Posted: Sat Feb 14, 2009 4:07 am
by qduaty
I compiled UTGLR against the 224 headers with VS2008. The original import library, Core.lib, is too old for your 227 patch. It is pre-2003, which means all wchar_t are represented by unsigned short. So, my linker links it correctly, but when I start Unreal, it says there is no entry point for UObject::StaticConfigName().
Re: GCC-4.2 and Unreal public headers
Posted: Sat Feb 14, 2009 6:08 am
by Smirftsch
the latest version I used to compile 224 public headers were the one after vc6 - no idea, vc7 called internally- was it 2003?
For 227 you can use UGold headers or maybe UT's to have it a bit closer, but unless I am allowed to release some of my work....
Re: GCC-4.2 and Unreal public headers
Posted: Sat Feb 14, 2009 12:57 pm
by Raven
So If I'll develop working native mod for UT It's no possibility to compile it for Linux ? It sucks

Re: GCC-4.2 and Unreal public headers
Posted: Sat Feb 14, 2009 11:33 pm
by qduaty
Edit: utglr can be built and works with ut 432 headers; though it's necessary to extract Core.lib from 227 Core.dll. The same way, I compiled the Chris Dohnal's dx9 renderer.
Now I have black screen on both. They don't complain in log files, they just display black screen. I got no idea what's going on, but it's certainly something with the engine. What can I do with it?
Re: GCC-4.2 and Unreal public headers
Posted: Sun Feb 15, 2009 8:13 am
by []KAOS[]Casey
if you manage to extract the lib from core and engine on 227 and it compiles, drop me a PM.. ;p
Re: GCC-4.2 and Unreal public headers
Posted: Sun Feb 15, 2009 3:18 pm
by qduaty
[]KAOS[]Casey:
It's not a secret lol; easy thing, basically. I'll put it here, so that others could make use of it.
Mingw32 (a GCC package for windows) has a tool to extract symbols:
They say if you have a .def file, you can link your programs with it, but I'm not so clever, so I used the Microsoft tool from VS2008:
Code: Select all
lib /DEF:Engine.def /OUT:Engine.lib
This also works with UT 432. UT has pre-2003 binaries, so the generated .lib should be comparable to theirs, and indeed, I compiled both drivers with it and they work.
227 libraries use native wchar_t, so you have to enable it as well. In VS2008, it is in Project options -> C++ -> Language. Otherwise, you will have unsigned short everywhere, not wchar_t, and it won't link.
Smirftsch, I still have a black screen on both GL and DX9. Please help. (edit) They certainly work; the same GL renderer, which works in UT, with 227 changes my display gamma and turns it back when I exit Unreal. It just doesn't render anything.
Re: GCC-4.2 and Unreal public headers
Posted: Sun Feb 15, 2009 4:07 pm
by []KAOS[]Casey
all the utilities i've tried have just fubared when trying to link
edit: holy shit I dont even know how to start this, RTFM is engaging
edit2: oh wow the auto installer doesnt set paths, Durrrrrrrr, also you need to install ming utils for anyone who might be installing this too
Re: GCC-4.2 and Unreal public headers
Posted: Sun Feb 15, 2009 4:35 pm
by []KAOS[]Casey
the .def file doesn't have nearly as much links as it should, and alot of functions are missing, which might be why you get your black screen.. ;p
edit: disregard that, theres garbage data{probably NOT garbage lol} at the top of regular libs which accounts for the extra stuff. I wonder how i use the .def in vs 6.0?.. {googles}
edit2: apparently I need the .objs that i'd have to create from .cpps, which I only have the .h obviously.. that would take an enormous amount of time to modify..
Re: GCC-4.2 and Unreal public headers
Posted: Sun Feb 15, 2009 6:29 pm
by []KAOS[]Casey
ok apparently VS2008's lib.exe is better than VS2003, it created the objs, but I get a few linker errors.. a few are obviously from deprecation/removal/change of functions/variables such as GSecondsPerCycle
Code: Select all
NotePad.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: __thiscall UClass::UClass(enum ENativeConstructor,unsigned long,unsigned long,class UClass *,class UClass *,class FGuid,unsigned short const *,unsigned short cons
t *,unsigned short const *,unsigned long,void (__cdecl*)(void *),void (__thiscall UObject::*)(void))" (__imp_??0UClass@@QAE@W4ENativeConstructor@@KKPAV0@1VFGuid@@PBG33KP6AXPAX@ZP8UObject@@AEXXZ@Z)
NotePad.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) unsigned char __cdecl GRegisterNative(int,void *)" (__imp_?GRegisterNative@@YAEHPAX@Z)
NotePad.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) public: unsigned short const * __thiscall UObject::GetFullName(unsigned short *)const " (__imp_?GetFullName@UObject@@QBEPBGPAG@Z)
NotePad.obj : error LNK2001: unresolved external symbol "__declspec(dllimport) void __cdecl appUnwindf(unsigned short const *,...)" (__imp_?appUnwindf@@YAXPBGZZ)
..\..\227System/Test.dll : fatal error LNK1120: 4 unresolved externals
.. I cant remove appunwindf since apparently thats a macro for unguardexec, and the others I obviously can't remove either, so i have to fix them.. somehow.
edit: if it matters the .. code thing is different in the .DEF than what it's looking for in the linker.
?appUnwindf@@YAXPB_WZZ
edit2: got it to compile by changing the .. code things after the errors to the compiler error. Probably BS hack mode engage but hey.. lets see if it works.
edit3: nope, just exploded in my face. I guess i need to redefine those functions?.. or steal them from UT?.. moar testing!
Re: GCC-4.2 and Unreal public headers
Posted: Sun Feb 15, 2009 7:21 pm
by []KAOS[]Casey
stealing from UT doesnt do a damn thing, they're the same. I guess the .DEF file is bad for some reason. not sure if the problem is with VS6.0, but I can't get it to compile in VS2008 without a ton of errors with CONST CHAR and things. google moar time..
edit: fixed the CONST errors with new #includes. now I believe I just have to update the convention on the Template T to whatever VS2008 uses.
Re: GCC-4.2 and Unreal public headers
Posted: Sun Feb 15, 2009 9:19 pm
by qduaty
Here are my fixed UT headers: http://francetelecom.freehost.pl/files/ut432pubsrc.7z. They work with VS2008 and you can compile your Unreal stuff with them.
Re: GCC-4.2 and Unreal public headers
Posted: Sun Feb 15, 2009 10:03 pm
by []KAOS[]Casey
Ahhh thank you sir. Smirf was going to find his old revisions somewhere tomorrow but you beat him. I will mirror this on my website if you don't mind
Re: GCC-4.2 and Unreal public headers
Posted: Sun Feb 15, 2009 10:14 pm
by []KAOS[]Casey
Code: Select all
NotePad.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall UObject::ScriptConsoleExec(wchar_t const *,class FOutputDevice &,class UObject *)" (?ScriptConsoleExec@UObject@@UAEHPB_WAAVFOutputDevice@@PAV1@@Z)
NotePad.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: wchar_t const * __thiscall UObject::GetFullName(wchar_t *)const " (__imp_?GetFullName@UObject@@QBEPB_WPA_W@Z) referenced in function __catch$?execClock@ANotePad@@QAEXAAUFFrame@@QAX@Z$0
NotePad.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) void __cdecl appUnwindf(wchar_t const *,...)" (__imp_?appUnwindf@@YAXPB_WZZ) referenced in function __catch$?execClock@ANotePad@@QAEXAAUFFrame@@QAX@Z$0
NotePad.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: __thiscall UClass::UClass(enum ENativeConstructor,unsigned long,unsigned long,class UClass *,class UClass *,class FGuid,wchar_t const *,wchar_t const *,wchar_t const *,unsigned long,void (__cdecl*)(void *),void (__thiscall UObject::*)(void))" (__imp_??0UClass@@QAE@W4ENativeConstructor@@KKPAV0@1VFGuid@@PB_W33KP6AXPAX@ZP8UObject@@AEXXZ@Z) referenced in function "void __cdecl `dynamic initializer for 'private: static class UClass ANotePad::PrivateStaticClass''(void)" (??__E?PrivateStaticClass@ANotePad@@0VUClass@@A@@YAXXZ)
NotePad.obj : error LNK2019: unresolved external symbol "__declspec(dllimport) public: static wchar_t const * __cdecl UObject::StaticConfigName(void)" (__imp_?StaticConfigName@UObject@@SAPB_WXZ) referenced in function "void __cdecl `dynamic initializer for 'private: static class UClass ANotePad::PrivateStaticClass''(void)" (??__E?PrivateStaticClass@ANotePad@@0VUClass@@A@@YAXXZ)
bah! I cant make the lib correctly for 227f_17. I'll try 227e..
edit: Interesting.. I got a different set of bad linkers. This time i'm sure I can compile for it though when I remove the bad functions..
Re: GCC-4.2 and Unreal public headers
Posted: Sun Feb 15, 2009 11:02 pm
by []KAOS[]Casey
Sweet mother of god it works, I commented out, compiled and my native mod worked.
This just in : Unreal 227e is at least 2-3 times faster than Unreal Gold in execution speed with uscript, I normally got .003xxxx in this huge sample size of code, where in 227e its .001xxxx, and even faster with better computers. 0.002355 was the lowest when my friend tested it
Re: GCC-4.2 and Unreal public headers
Posted: Sun Feb 15, 2009 11:04 pm
by qduaty
If you still need these functions, try to rebuild the .libs. I might leave the original UT432 versions.
There is a script in one of the directories. Copy a dll to that directory, launch the script, then rename new.lib to either Core.lib or Engine.lib, depending what dll you are extracting.
BTW. I'm still using 227d.
Re: GCC-4.2 and Unreal public headers
Posted: Sun Feb 15, 2009 11:15 pm
by []KAOS[]Casey
Nah they're garbage functions i'll never call or compile on. Rebuilding the lib does nothing, its the def file that is incorrect, using an older version of the pexports program also generates the same file. So who knows..
Re: GCC-4.2 and Unreal public headers
Posted: Mon Feb 16, 2009 12:02 am
by qduaty
I see all those symbols you listed, in a .def generated from 227d Core.dll, with pexports 0.43.
Re: GCC-4.2 and Unreal public headers
Posted: Mon Feb 16, 2009 12:05 am
by []KAOS[]Casey
i'm using 227e not d, and I just checked both .def to be sure, since those are supposed to all be in actor{engine.def}... either way the fact that it works is amazing.. thanks
Re: GCC-4.2 and Unreal public headers
Posted: Mon Feb 16, 2009 12:22 am
by qduaty
Lol I find the 227e patch in my unreal directory. Core.dll is smaller but these exports are still there in the new .def.
So, feel free to mirror these UT headers, of course don't forget to credit me.
Re: GCC-4.2 and Unreal public headers
Posted: Mon Feb 16, 2009 12:31 am
by []KAOS[]Casey
hmm thats odd, wonder why it doesn't export for me. I was also running this disassembler program and they are also missing, maybe my CPU is unable to read it or something completely strange?.. no idea.
Re: GCC-4.2 and Unreal public headers
Posted: Mon Feb 16, 2009 1:11 am
by qduaty
This is one of your exports (beautiful, they all look like this): ?ScriptConsoleExec@UObject@@UAEHPB_WAAVFOutputDevice@@PAV1@@Z
I found it in my Core.def (not Engine, it's Core), and you should as well.
BTW. what kind of a shader would you like to use in ur mods? Actually all this mess is caused by my idea to add some programmability to the OpenGL renderer. And since GL shaders are text strings, they can even be attached to models or levels. But I'm not actually a modder and I got no idea what they could do in a game, other than parallax mapping or similar stuff.
Re: GCC-4.2 and Unreal public headers
Posted: Mon Feb 16, 2009 1:36 am
by []KAOS[]Casey
I'm not really a big fan of changing the game visuals other than how they were meant to be seen, but there is something that could be useful, some kind of "distance fog" that stops rendering after a certain point to prevent FPS loss from a huge amount of BSP being rendered, the engine really is weak at that, even the most powerful computers get huge fps hits from large rooms. Maybe someone else could suggest something as well.
Also, that list I had was from 227f_17 links. Those are in the .def file, but they have random underscores in them for some reason. like part of the data is missing.
error list from 227e is..
Code: Select all
NotePad.obj : error LNK2001: unresolved external symbol "public: virtual int * __thiscall AActor::GetOptimizedRepList(unsigned char *,struct FPropertyRetirement *,int *,class UPackageMap *,int)" (?GetOptimizedRepList@AActor@@UAEPAHPAEPAUFPropertyRetirement@@PAHPAVUPackageMap@@H@Z)
NotePad.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall AActor::ShouldDoScriptReplication(void)" (?ShouldDoScriptReplication@AActor@@UAEHXZ)
NotePad.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall AActor::NoVariablesToReplicate(class AActor *)" (?NoVariablesToReplicate@AActor@@UAEHPAV1@@Z)
NotePad.obj : error LNK2001: unresolved external symbol "public: virtual int __thiscall AActor::CheckRecentChanges(void)" (?CheckRecentChanges@AActor@@UAEHXZ)
NotePad.obj : error LNK2001: unresolved external symbol "public: virtual float __thiscall AActor::UpdateFrequency(class AActor *,class FVector &,class FVector &)" (?UpdateFrequency@AActor@@UAEMPAV1@AAVFVector@@1@Z)
edit: I noticed some of the ailed links are identical in the .defs in 227e and 227f, but they fail to link anyway. I wonder what could cause this?