Jump to content

Oh, this again - conflict over "StringTable" between T3D and PhysX


chriscalef

Recommended Posts

I know I've been here before, but long story short: how I got here was, because of temporary lack of the Project Manager, trying to manually add the physx3 code and include + lib directories to my new 3.9 build, using VS2015. My solution last time I saw this problem was terrible (actually changing the name of Torque's StringTable, everywhere it appeared :-P ) but I think the right answer just boiled down to switching the order of some includes, or something equivalent.


My error output is this:

 

1>f:\physx-3.3.1\include\physxvisualdebuggersdk/PvdObjectModelMetaData.h(227): error C2059: syntax error: ')'
1>f:\physx-3.3.1\include\physxvisualdebuggersdk/PvdObjectModelMetaData.h(228): error C2143: syntax error: missing ';' before '{'
1>f:\physx-3.3.1\include\physxvisualdebuggersdk/PvdObjectModelMetaData.h(228): error C2447: '{': missing function header (old-style formal list?)
1>f:\physx-3.3.1\include\physxvisualdebuggersdk/PvdObjectModelMetaData.h(331): error C2059: syntax error: ')'
1>f:\physx-3.3.1\include\physxvisualdebuggersdk/PvdObjectModelMetaData.h(331): error C2238: unexpected token(s) preceding ';'

 

But when you go to that file, you see that it breaks on the following code:

 

	class StringTable
{
protected:
	virtual ~StringTable(){}
public:
	...
	}

 

When I added the physx3 code, I also added the include and lib directories to the end of their respective lists in the project properties, and that was all I did. I wonder if I could add them earlier in the lists or something? Or is it a matter of where to call the actual physx include files?

Link to comment
Share on other sites

  • Replies 59
  • Created
  • Last Reply

Top Posters In This Topic

Yeah @chriscalef it is the order of inlcudes. I have a physx3 cmake module here https://github.com/rextimmy/Torque3D/commit/1770ed01ce45affc76e6ae48278153d93fda58bc ... To use it just grab the physx source and compile it yourself and than make sure TORQUE_PHYSX3_PATH points to /somepath/PhysX-3.3/PhysXSDK and away you go. I do have a version of that cmake file floating around that adds linux support too.

Link to comment
Share on other sites

  • 4 months later...

Hey, @Timmy, I'm bumping up against this StringTable conflict again with a new system I just built, win10, VS2015. I've been staring at your CMake file for a while now but I still don't really understand what's going on. (Sorry, been using it for years but I still don't really get CMake.) Any chance I could get a breakdown of exactly what include or lib ordering needs to be changed in a project in order to fix this conflict?

Link to comment
Share on other sites

@chriscalef Are you running the bog standard physx3 plugin or ya got some of your own stuff in there? Last time i tested it worked out of the box with vs2015. The StringTable is hidden away in the physx namespace, so just double check in any of ya own code if you are doing the whole using physx thing. Let us know how ya go.


Oh yeah on another note, i have a new branch with support for physx 3.4 (still in beta testing) https://github.com/rextimmy/Torque3D/tree/physx_34, i got cmake file in there for it to, works on windows/mac and linux.

Link to comment
Share on other sites

Huh, this is step one of copying my work to a new project, so I'm starting with just the stock contents of the physx3 directory, was planning on copying in my own work after I got the stock implementation running. I'm still unclear on the "right way" to build a stock physx install, however - in the CMake setup options I see a way to click for bullet physics, etc., but there does not appear to be a physx3 setup option. I'm trying to use the same physx-3.3.1 libs I had running before on my old box (because 3.3.2 never ran for me) but if you've got 3.4 running maybe I should just switch to that.


My methodology so far has been: build the project as a blank vanilla T3D, with no physx at all, then go through and add includes and libs pointing at my physx 3.3.1 directory, and add the physx3 source code to the project. That's all I've done so far. Lemme check your links up there and see if they point me in the right direction...

Link to comment
Share on other sites

You gotta save this file https://raw.githubusercontent.com/rextimmy/Torque3D/1770ed01ce45affc76e6ae48278153d93fda58bc/Tools/CMake/modules/module_physx3.cmake and place it in T3DFolder/Tools/Cmake/Modules . There is no official physx cmake file. Than just follow the steps in this post

 

To use it just grab the physx source and compile it yourself and than make sure TORQUE_PHYSX3_PATH points to /somepath/PhysX-3.3/PhysXSDK and away you go.

Link to comment
Share on other sites

Hm, okay, trying to follow along but not working yet. I still have a few questions:


1) What is pvd/PxPvd.h? That hung me up on my last iteration, it was called from px.h in T3D physics code. I have only one header file in that directory, PxVisualDebugger.h, in either of my physx versions. Did I miss a separate visual debugger SDK install or something?


2) I have two versions of your module_physx3.cmake file now - the one you linked me to in this thread, which says at the top "module Physx 3.x", and the one I got with your 3.4 branch, which is longer and specifies "module Physx 3.4". I've been using the second one as it seems more specific and more complete, but should I use the first one?


3) Are "/PhysX-3.3/PhysXSDK" literal? I have my 3.4 stuff in a directory called "f:/physx-3.3.4/", to which I appended another directory called "PhysX_3.4" because that appeared to be hard coded in your cmake file (?), but I assumed the rest of the path was optional. I can point visual studio to my include and lib directories without much apparent problem, but I still have to do this manually - is CMake supposed to be setting these up for me if I get the config right?


4) If I do it right, will the physx3 folder exist in the project or do I have to add those files manually?


Thanks again for all your help! Project setup, always interesting times... :-p

Link to comment
Share on other sites

With physx 3.4 don't worry about that for now, it was more just a casual comment, physx 3.4 is still in closed beta, you gotta ask their licensing department for a copy for testing. So we will stick with 3.3 which is publicly released.


Step 1) clone this repository https://github.com/NVIDIAGameWorks/PhysX-3.3 - if you don't have access see https://developer.nvidia.com/physx-source-github


Step 2) compile the above physx using whatever version of VS you will use in T3D (don't forget both debug and release if you plan on using both in t3d). Currently the cmake file only supports VS 2013/15 32 or 64bit. Go into /where_you_cloned_physx_above/PhysXSDK/source/compiler for the visual studio solution files.


Step 3) make an environment variable called TORQUE_PHYSX3_PATH that points to /where_you_cloned_physx_above/PhysXSDK/ You may need to reboot for this to take affect depending on how you do it.


Step 4) place the physx 3.3 cmake file into T3DFolder/Tools/Cmake/Modules and run cmake and obviously select physx.


Step 5) Open cmake generated solution file and happy days, no more to do but compile and run. It will copy the required dll files etc automagically for ya and also place the physx stuff in the project.


When physx 3.4 is finally publicly released i have made changes to the cmake file that makes this a bit easier, till than you gotta follow the above steps.


PVD is the visual debugger for physx.


Also nvidia told me they will never again release physx in compiled form, from here on out it is github source code only. Unfortunately for licensing reasons we can't ship T3D with the physx source, hence why you gotta manually grab it and compile yourself. In case you are wondering, the physx sdk source code contains PhysX sdk, APEX sdk and PVD source code.

Link to comment
Share on other sites

Ah, I see. I actually did get approved already and downloaded and built the 3.4 project (after one hiccup which I found fixed on the forums, here: https://devtalk.nvidia.com/default/topic/977012/?offset=3#5037883).


But if 3.3 is the stable version, sure, let's go with that!


One more question though, if I'm building a 32 bit T3D build do I need to build 32 bit PhysX as well?

Link to comment
Share on other sites

oh if ya got 3.4 than go for it, you need the other changes too from that branch, there are interface changes with 3.4. Yep if building t3d 32bit you gotta build physx 32 bit. If using 3.4, the cmake file for that does not require that environment variable set and you must point cmake to /where_you_cloned_physx (not the sub-directory called PhysXSDK)


Do note i haven't enabled any of the gpu rigid body stuff in physx 3.4 branch, i don't have an nvidia card to test it on.

Link to comment
Share on other sites

Okay, cool, I'll make sure I have the 32 bit version of 3.4 and give it another shot, that was probably the source of the last round of errors I got then.


Back on that file though, yeah I know about PVD in general, but where did pvd/PxPvd.h come from? Maybe it'll pop up on this round of 3.4 clones but so far I can't haven't seen that particular file in any version of physx.

Link to comment
Share on other sites

EDIT: Chris is moving too fast and failing to read all the instructions: my path problems were all solved by step 3 of Timmy's instructions: make an environment variable called TORQUE_PHYSX3_PATH and point it at your PhysicsSDK directory. Still unknown why I can't clone the NVidia repos directly, but that doesn't seem to be my problem.

 

Huh, weird. Tried to eliminate all the variables, by building my 32 bit version right in my main tree for the PhysX download, but I'm still getting a whole list of physx libraries not found, which I assume is related to the problem of my projects not being set up pointing at the include and lib folders. What my install looks like is:


F:/PhysX/PhysX-3.3-master/PhysXSDK, APEXSDK, etc.


I'm assuming that master directory is what I want to point at, right above APEXSDK and PhysXSDK?


For some reason I can't clone the NVidia repos, they always report as not existing, even though I have my user.name and .email set up to match the github account that they allowed into their program. Don't know what's up with that, but I was able to download the zipped version so I'm running with that.


(EDIT: also, back on the path variables, I have seen PHYSX3_BASE_PATH as well as TORQUE_PHYSX_PATH, do I still need either or both of them? Setting them both to that master directory, but no love yet.)

Edited by chriscalef
Link to comment
Share on other sites

Ah, right, derp! I was still missing step 3, comes under RTFM at that point. :-P Still compiling, but things are going much better now! Got all my libs and include directories, got all my physx3 code.


Thanks again for sticking with me, you're a lifesaver!


EDIT: oh, except, on compile, we're back to that PxPvd.h file. Nothing like that anywhere in my PhysX master download tree. I have a visual debugger install file in there, which I ran, but do I need to separately check out the git repo for it or something?

Link to comment
Share on other sites

I'm on 3.4 now.


I get the following error:

 

	Cannot open include file: 'pvd/PxPvd.h': No such file or directory (compiling source file F:\T3D\rextimmy\Engine\source\T3D\physics\physx3\px3Collision.cpp)	MegaMotion	F:\T3D\rextimmy\Engine\source\T3D\physics\physx3\px3.h

 

When I look in pvd folder, sure enough, nothing like that, either in 3.3.1, 3.3.2, or my new 3.3.4 build. Which otherwise seemed to build and install fine.

Edited by chriscalef
Link to comment
Share on other sites

Well, damn! I thought I was on to it there, when I realized in my thrashing around before I overwrote your 3.4 "module_physx3.cmake" file with the one you were pointing at earlier (first notable difference being the 3.4 version specifies 3.4 at the top, the other one says 3.x).


But when I revert to the one directly from your repo, I get back to the issue of it asking for a PHYSX3_BASE_PATH variable, and whether I point that at the master repo directory or the PhysXSDK directory, it once again fails to find any of my libraries, so I'm a step back. Checking into the cmake file to see if it changed the name of the environment variable it was looking for...

Link to comment
Share on other sites

Okay, now we're getting somewhere... in that 3.4 version of your cmake file, it looks like you hardcoded the name PhysX_34 where I wanted PhysXSDK, so I fixed that. And then, in the libs section, you're looking for Foundation, Task, and PVD in a directory called PxShared, which I don't have. Tried to set that back to the main lib directory, but so far no luck.


Re: the physx-3.3-master, yeah, you know, that might be the thing. I thought I had reason to believe I was getting the most recent physX repo, and all down the main repo page are labels that read simply "PhysX-3.3.4", so I've been telling myself that the NVidia guys must have gotten lazy and kept doing development in their 3.3 repo without changing the name. But it may well be that I'm not actually in the 3.4 approved group, and am merely in the main group of 3.3 plebians, and what I'm seeing is just a comment that they've updated 3.3 to be compatible with 3.4, or something.


So I guess it's worth jumping back to the main T3D development branch and trying this all over again as if I was on 3.3.

Link to comment
Share on other sites

Okay, now we're getting somewhere... in that 3.4 version of your cmake file, it looks like you hardcoded the name PhysX_34 where I wanted PhysXSDK, so I fixed that. And then, in the libs section, you're looking for Foundation, Task, and PVD in a directory called PxShared, which I don't have. Tried to set that back to the main lib directory, but so far no luck.

 

If those directories are not there you have the wrong physx version, the physx cmake file works without modification if pointed to the correct folder. It needs that PhysX_34 hard coded, check here https://github.com/NVIDIAGameWorks/PhysX-3.4/

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...