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

Long linker times on Torque3D.dll (VS2010) #72

Closed
LuisAntonRebollo opened this issue Oct 7, 2012 · 10 comments
Closed

Long linker times on Torque3D.dll (VS2010) #72

LuisAntonRebollo opened this issue Oct 7, 2012 · 10 comments
Labels
Milestone

Comments

@LuisAntonRebollo
Copy link
Contributor

See this thread -> http://www.garagegames.com/community/forums/viewthread/120473/1

@DavidWyand-GG
Copy link
Member

@Luis-Anton do you have an actual solution for this? That forum thread points out an issue but doesn't have a concrete resolution.

@537mfb
Copy link

537mfb commented Oct 10, 2012

@DavidWyand-GG If you read Tom Spillman's coment on that thread he gives you the resolution

he says and i quote:
I think the problem is that how T3D is setup the game EXE and game DLL are named the same. This means you get some intermediate files that are named the same and i think it confuses the linker.

and then Devin Passage answers:
Changing the names did get rid of that warning message, seems faster now... have not actually tested the speed but its good enough for now, thank you!

So as you can see, Tom Spillman gave a resolution and Devin confirmed the Tom's resolution solved the issue

It's all in that thread

@dottools
Copy link

The problem is that the C/C++ -> Output Files: Program Database File Name and Linker -> Debugging: Generate Program Database File paths are the exact same for the App and DLL projects so they're fighting over the same debug database file. Currently they're being set to _$(OutDir)/$(ProjectName)DEBUG.pdb but instead could probably be set to _$(IntDir)/$(ProjectName)DEBUG.pdb to fix the long linking problem for debug builds..

@537mfb
Copy link

537mfb commented Oct 10, 2012

@dottools Something like that should work aswell - yes

@DavidWyand-GG
Copy link
Member

Hey Guys.

Sounds like a plan. So who will step up and submit a Pull Request for the fully tested fix?

@LuisAntonRebollo
Copy link
Contributor Author

Change "Program Database File" to IntDir don't work for me :(

I think the problem are "Incremental Link"(.ilk) files. It's not posible to change ouput dir (see this)

The only posible solution it's change name of dll for solve conflit with file ilk of exe.

@LuisAntonRebollo
Copy link
Contributor Author

A simple solution for VS2010:

 Tools/projectGenerator/templates/vc2010_dll_proj.tpl | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/Tools/projectGenerator/templates/vc2010_dll_proj.tpl b/Tools/projectGenerator/templates/vc2010_dll_proj.tpl
index a594615..9700eb6 100644
--- a/Tools/projectGenerator/templates/vc2010_dll_proj.tpl
+++ b/Tools/projectGenerator/templates/vc2010_dll_proj.tpl
@@ -50,15 +50,15 @@
     <OutDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">{$projectOffset}../../{$gameFolder}/</OutDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">{$projectOffset}../Link/VC2010.$(Configuration).$(PlatformName)/$(ProjectName)/</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">true</LinkIncremental>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">{$projOutName}_DEBUG</TargetName>
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">{$projOutName}_DEBUG_</TargetName>
     <OutDir Condition="'$(Configuration)|$(Platform)'=='Optimized Debug|Win32'">{$projectOffset}../../{$gameFolder}/</OutDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Optimized Debug|Win32'">{$projectOffset}../Link/VC2010.$(Configuration).$(PlatformName)/$(ProjectName)/</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Optimized Debug|Win32'">false</LinkIncremental>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='Optimized Debug|Win32'">{$projOutName}_OPTIMIZEDDEBUG</TargetName>
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Optimized Debug|Win32'">{$projOutName}_OPTIMIZEDDEBUG_</TargetName>
     <OutDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">{$projectOffset}../../{$gameFolder}/</OutDir>
     <IntDir Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">{$projectOffset}../Link/VC2010.$(Configuration).$(PlatformName)/$(ProjectName)/</IntDir>
     <LinkIncremental Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">false</LinkIncremental>
-    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">{$projOutName}</TargetName>
+    <TargetName Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">{$projOutName}_</TargetName>
   </PropertyGroup>
   <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
     <Midl>
@@ -96,7 +96,7 @@
     </ResourceCompile>
     <Link>
       <AdditionalDependencies>{foreach item=def from=$projLibs}{$def};{/foreach}%(AdditionalDependencies)</AdditionalDependencies>
-      <OutputFile>$(OutDir){$projOutName}_DEBUG.dll</OutputFile>
+      <OutputFile>$(OutDir)$(TargetName).dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>{foreach item=def from=$projLibDirs}{$def};{/foreach}{$projectOffset}../Link/VC2010.$(Configuration).$(PlatformName);$(DXSDK_DIR)/Lib/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <IgnoreSpecificDefaultLibraries>LIBC;LIBCD;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
@@ -148,7 +148,7 @@
     </ResourceCompile>
     <Link>
       <AdditionalDependencies>{foreach item=def from=$projLibs}{$def};{/foreach}%(AdditionalDependencies)</AdditionalDependencies>
-      <OutputFile>$(OutDir){$projOutName}_OPTIMIZEDDEBUG.dll</OutputFile>
+      <OutputFile>$(OutDir)$(TargetName).dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>{foreach item=def from=$projLibDirs}{$def};{/foreach}{$projectOffset}../Link/VC2010.$(Configuration).$(PlatformName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <IgnoreSpecificDefaultLibraries>LIBC;LIBCD;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
@@ -200,7 +200,7 @@
     </ResourceCompile>
     <Link>
       <AdditionalDependencies>{foreach item=def from=$projLibs}{$def};{/foreach}%(AdditionalDependencies)</AdditionalDependencies>
-      <OutputFile>$(OutDir){$projOutName}.dll</OutputFile>
+      <OutputFile>$(OutDir)$(TargetName).dll</OutputFile>
       <SuppressStartupBanner>true</SuppressStartupBanner>
       <AdditionalLibraryDirectories>{foreach item=def from=$projLibDirs}{$def};{/foreach}{$projectOffset}../Link/VC2010.$(Configuration).$(PlatformName);$(DXSDK_DIR)/Lib/x86;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
       <IgnoreSpecificDefaultLibraries>LIBC;LIBCD;%(IgnoreSpecificDefaultLibraries)</IgnoreSpecificDefaultLibraries>
 Engine/source/main/main.cpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/Engine/source/main/main.cpp b/Engine/source/main/main.cpp
index 86907b5..4c80a83 100644
--- a/Engine/source/main/main.cpp
+++ b/Engine/source/main/main.cpp
@@ -39,7 +39,7 @@ int PASCAL WinMain( HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpszCmdL

    GetModuleFileNameA(NULL, filename, 4096);
    filename[strlen(filename)-4] = 0;
-   sprintf(gameLib, "%s.dll", filename);
+   sprintf(gameLib, "%s_.dll", filename);

    HMODULE hGame = LoadLibraryA(gameLib);

Any one can test?

@LuisAntonRebollo
Copy link
Contributor Author

2 posible solutions. Works on VS2008/2010 (need test)

LuisAntonRebollo@18b1f4c

LuisAntonRebollo@76dc60d

@crabmusket
Copy link
Contributor

This is cool, I'll try to test it sometime.

@LuisAntonRebollo
Copy link
Contributor Author

We can close this issue, are handled on #698

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

No branches or pull requests

5 participants