Jump to content

AFX 3.8 Porting - Strange Build Errors


Steve_Yorkshire

Recommended Posts

I've been porting AFX from 3.6.3 to 3.8 and hit some strange build errors. There's a few "uses undefined struct" and "cannot convert" errors relating to 5 of the AFX files but the errors reference console.h rather than lines in the AFX code. I'm a bit confused and at a loss what to do.


Here's a pic (right click -> view) for full size

http://yorkshirerifles.com/random/afx_bugs1.jpg


And here's the output

1>------ Build started: Project: AFXtest DLL, Configuration: Release Win32 ------
1>  afxEA_AreaDamage.cpp
1>  afxEA_CollisionEvent.cpp
1>  afxEA_StaticShape.cpp
1>  afxGuiSubstitutionField.cpp
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(888): error C2079: 'callback' uses undefined struct '_EngineConsoleExecCallbackHelper'
1>          with
1>          [
1>              A=GameBaseData *
1>          ] (..\..\..\..\..\Engine\source\afx\ea\afxEA_AreaDamage.cpp)
1>          ..\..\..\..\..\Engine\source\afx\ea\afxEA_AreaDamage.cpp(212) : see reference to function template instantiation 'ConsoleValueRef Con::executef(A,B,C,D,E,F,G)' being compiled
1>          with
1>          [
1>              A=GameBaseData *
1>  ,            B=const char *
1>  ,            C=const char *
1>  ,            D=const char *
1>  ,            E=char *
1>  ,            F=const char *
1>  ,            G=char *
1>          ]
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(888): error C2440: 'initializing' : cannot convert from 'GameBaseData *' to 'int' (..\..\..\..\..\Engine\source\afx\ea\afxEA_AreaDamage.cpp)
1>          There is no context in which this conversion is possible
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(888): error C2059: syntax error : 'template' (..\..\..\..\..\Engine\source\afx\ea\afxEA_AreaDamage.cpp)
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(887): error C2079: 'callback' uses undefined struct '_EngineConsoleExecCallbackHelper'
1>          with
1>          [
1>              A=ShapeBase *
1>          ] (..\..\..\..\..\Engine\source\afx\ea\afxEA_AreaDamage.cpp)
1>          ..\..\..\..\..\Engine\source\afx\ea\afxEA_AreaDamage.cpp(227) : see reference to function template instantiation 'ConsoleValueRef Con::executef(A,B,C,D,E,F)' being compiled
1>          with
1>          [
1>              A=ShapeBase *
1>  ,            B=const char *
1>  ,            C=const char *
1>  ,            D=char *
1>  ,            E=char *
1>  ,            F=const char *
1>          ]
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(887): error C2440: 'initializing' : cannot convert from 'ShapeBase *' to 'int' (..\..\..\..\..\Engine\source\afx\ea\afxEA_AreaDamage.cpp)
1>          There is no context in which this conversion is possible
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(887): error C2059: syntax error : 'template' (..\..\..\..\..\Engine\source\afx\ea\afxEA_AreaDamage.cpp)
1>  afxStatusBox.cpp
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(885): error C2079: 'callback' uses undefined struct '_EngineConsoleExecCallbackHelper'
1>          with
1>          [
1>              A=StaticShapeData *
1>          ] (..\..\..\..\..\Engine\source\afx\ea\afxEA_StaticShape.cpp)
1>          ..\..\..\..\..\Engine\source\afx\ea\afxEA_StaticShape.cpp(158) : see reference to function template instantiation 'ConsoleValueRef Con::executef(A,B,C,D)' being compiled
1>          with
1>          [
1>              A=StaticShapeData *
1>  ,            B=const char *
1>  ,            C=const char *
1>  ,            D=StringTableEntry
1>          ]
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(885): error C2440: 'initializing' : cannot convert from 'StaticShapeData *' to 'int' (..\..\..\..\..\Engine\source\afx\ea\afxEA_StaticShape.cpp)
1>          There is no context in which this conversion is possible
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(885): error C2059: syntax error : 'template' (..\..\..\..\..\Engine\source\afx\ea\afxEA_StaticShape.cpp)
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(886): error C2079: 'callback' uses undefined struct '_EngineConsoleExecCallbackHelper'
1>          with
1>          [
1>              A=GuiInspector *
1>          ] (..\..\..\..\..\Engine\source\afx\ui\afxGuiSubstitutionField.cpp)
1>          ..\..\..\..\..\Engine\source\afx\ui\afxGuiSubstitutionField.cpp(202) : see reference to function template instantiation 'ConsoleValueRef Con::executef(A,B,C,D,E)' being compiled
1>          with
1>          [
1>              A=GuiInspector *
1>  ,            B=const char *
1>  ,            C=StringTableEntry
1>  ,            D=StringTableEntry
1>  ,            E=const char *
1>          ]
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(886): error C2440: 'initializing' : cannot convert from 'GuiInspector *' to 'int' (..\..\..\..\..\Engine\source\afx\ui\afxGuiSubstitutionField.cpp)
1>          There is no context in which this conversion is possible
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(886): error C2059: syntax error : 'template' (..\..\..\..\..\Engine\source\afx\ui\afxGuiSubstitutionField.cpp)
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(888): error C2079: 'callback' uses undefined struct '_EngineConsoleExecCallbackHelper'
1>          with
1>          [
1>              A=GameBaseData *
1>          ] (..\..\..\..\..\Engine\source\afx\ea\afxEA_CollisionEvent.cpp)
1>          ..\..\..\..\..\Engine\source\afx\ea\afxEA_CollisionEvent.cpp(179) : see reference to function template instantiation 'ConsoleValueRef Con::executef(A,B,C,D,E,F,G)' being compiled
1>          with
1>          [
1>              A=GameBaseData *
1>  ,            B=StringTableEntry
1>  ,            C=const char *
1>  ,            D=const char *
1>  ,            E=const char *
1>  ,            F=char *
1>  ,            G=StringTableEntry
1>          ]
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(888): error C2440: 'initializing' : cannot convert from 'GameBaseData *' to 'int' (..\..\..\..\..\Engine\source\afx\ea\afxEA_CollisionEvent.cpp)
1>          There is no context in which this conversion is possible
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(888): error C2059: syntax error : 'template' (..\..\..\..\..\Engine\source\afx\ea\afxEA_CollisionEvent.cpp)
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(883): error C2079: 'callback' uses undefined struct '_EngineConsoleExecCallbackHelper'
1>          with
1>          [
1>              A=afxStatusBox *
1>          ] (..\..\..\..\..\Engine\source\afx\ui\afxStatusBox.cpp)
1>          ..\..\..\..\..\Engine\source\afx\ui\afxStatusBox.cpp(44) : see reference to function template instantiation 'ConsoleValueRef Con::executef(A,B)' being compiled
1>          with
1>          [
1>              A=afxStatusBox *
1>  ,            B=const char *
1>          ]
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(883): error C2440: 'initializing' : cannot convert from 'afxStatusBox *' to 'int' (..\..\..\..\..\Engine\source\afx\ui\afxStatusBox.cpp)
1>          There is no context in which this conversion is possible
1>C:/Torque/Torque3D_38_Win/test_afx/Engine/source/console/console.h(883): error C2059: syntax error : 'template' (..\..\..\..\..\Engine\source\afx\ui\afxStatusBox.cpp)
2>------ Build started: Project: AFXtest, Configuration: Release Win32 ------
2>LINK : fatal error LNK1181: cannot open input file 'C:\Torque\Torque3D_38_Win\test_afx\My Projects\AFXtest\game\AFXtest DLL.lib'
========== Build: 0 succeeded, 2 failed, 15 up-to-date, 0 skipped ==========

 

Any help appreciated. :?

Link to comment
Share on other sites

my guess would be that you have to add an extra include since there where api changes introduced in the latest versions of T3D,


therefore include console/engineAPI.h/console.h in the files causing/having those errors,

this might solve most warnings but probably not all, i had the same issue when i tried to port gmk/verve (where i have to admit that i gave that endeavour up)..

Link to comment
Share on other sites

Adding engineAPI.h to arcaneFX.h threw up 122 "unresolved external symbols" relating to "onStaticModified".


Adding engineAPI.h individually to the 5 error files stopped the original errors, until all 5 files had it, then it threw the above 122 errors again.


Adding console/console.h had no effect on original errors.


I mostly code gameplay and new classes so this bit of the engine is rather baffling.


Also I notice Jeff had missed a few code comments so shockWaveData wasn't covered in his port, but it was easy to fix those errors.

Link to comment
Share on other sites

https://github.com/faustlogic/Torque3D-plus-AFX/pull/1 make no promises other than it compiles.


Had your earlier 3.7 version working fine - this one does compile but crashes here:

 

GFXD3D9Shader::_compileShader - Error compiling shader: E_FAIL: An undetermined error occurred (80004005)
  C:/Torque/Torque3D-afx_plus_3.8/My Projects/test38/game/shaders/common/lighting/advanced/vectorLightP.hlsl(70,27): error X3004: undeclared identifier 'prepassUncondition'
Failed to initialize material 'AL_VectorLightMaterial'
c:\torque\torque3d-afx_plus_3.8\engine\source\materials\matinstance.cpp(525,0): {Fatal} - Not init'ed!

 

any ideas?

Link to comment
Share on other sites

https://github.com/Azaezel/Torque3D/blob/afx_plus_3.8/Templates/Full_AFX/game/shaders/common/lighting/advanced/vectorLightP.hlsl#L70


Not offhand, but then, I've stuck to the regular full directory most times and thrown AFX bits in per-project... could be a script ref change... will poke as time allows... Which directory did you try as your baseline?

Link to comment
Share on other sites

Ahhh, found it, the 'Full_AFX' template hadn't been updated with newest shader stuff - diffing it with 'Full' made it work...


I'll bash away on it some more this eve, see if I can break anything else ;P

 

Good to see you around :D I kind of thought you had left us as you never answered any of my mails or forums posts :o

 

Update: I've tinkered with stock AFX and then added my own set of mods, which include many of AZ's, Acasters, Visad's and my own, and have so far not seen any other issues than I'm seeing with stock 3.8. just random crashes in the editors while in OpenGL. Anyone else out there using Az's port?


@DK: got a job :mrgreen:

Link to comment
Share on other sites

  • 1 month later...
:mrgreen: I took all the shader files from the full template and dropped them in my own compile demo project under commen etc. It seems to work now. So the shader files are not added when creating the project. Not a big issue for Torquers :mrgreen:


Edit:

Seems that the dynamic shadows when the Torque orc is moving is lagging/ha ha hacking in both DX9 and DX11.


Otherwise the effects seems very well(AFX). I will have to port project and do some more testings.

 

That'll be the new shadowcaching system. would go to the materials and flip on castsdynamicshadows.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...