ValveSoftware / halflife

Half-Life 1 engine based games
Other
3.65k stars 617 forks source link

client.dll warning when building with vs 2008 #1624

Closed tschumann closed 8 years ago

tschumann commented 9 years ago

I'm trying to build client.dll with Visual Studio 2008 and it compiles without issue but I get the following warning: cl_dll : warning PRJ0042 : The 'Outputs' property for the custom build step for file 'game_controls.lib' is not set. The custom build step will be skipped. Anyone else come across this or know how to properly deal with it?

JoelTroch commented 9 years ago

I need to get my hands on VS2008 or it's compilers and I'll see if I can dig something

tschumann commented 9 years ago

Is game_controls.lib meant to be linked with client.dll?

JoelTroch commented 9 years ago

By default, the client project is set to use game_controls.lib

JoelTroch commented 9 years ago

How did you managed to compile the source code with VS2008 ? I tried to downgrade the projects/solution but it fails

tschumann commented 9 years ago

I upgraded the Visual C++ 6 project file. I guess I should probably download a newer version of Visual Studio but that'll probably take a multiple hours.

JoelTroch commented 9 years ago

Yesterday, I managed to compile under VS2008 after upgrading from VC++ 6 projects, I had the warnings I mentioned in issue #1622 and I had a linker warning saying that LIBCMT is conflicting and I should use /NODEFAULTLIB, however, using /NODEFAULTLIB will result in linker errors. I haven't tested if the compiled binaries work, but I didn't had the "game_controls.lib" warning you mentioned.

tschumann commented 9 years ago

Hm, odd. Can you send me your .sln and .vcproj files? Mine don't run from memory (it crashes somewhere strange).

JoelTroch commented 9 years ago

I made a dedicated branch for Visual Studio 2008 on my fork, branch's name is vs2008.

Here's the link: https://github.com/JoelTroch/halflife/commits/vs2008

dtugend commented 9 years ago

@tschumann what keeps you from using Microsoft Visual Studio 2010 Express, it's free and can do everything that is required to build Half-Life? Plus there are already project files in this repository for 2010, which are fine, except that I could address a few compiler warnings properly (but I don't see a point in doing this work as long as they don't merge a few of the pull requests).

JoelTroch commented 9 years ago

@ripieces I was also thinking about fixing those warnings too ^_^

malortie commented 9 years ago

@tschumann

Here is a potential alternative solution to Visual Studio 2008, using the 2015 community edition.

Here is a potential alternative solution to Visual Studio 2008, using the 2010 express edition.

@JoelTroch ... I was also thinking about fixing those warnings ...

Here is a link to my current branch, which includes source code fixes for POSIX warnings or other notifications when building the current master source code. The solution uses VS2010 express.

Hope it helps.

tschumann commented 8 years ago

And now that I've had time to look at this a bit more I've figured out that the compiler warning seems to be nothing and the real problem seems to be that client.dll fails to process commandmenu.txt and crashes.

The stack trace is: CommandButton::AddSubMenu -> this is where it crashes TeamFortressViewport::CreateSubMenu TeamFortressViewport::CreateCommandMenu TeamFortressViewport::TeamFortressViewport VGui_Startup HUD_VidInit

So, is anyone else using commandmenu.txt in their mod? The one I'm using is straight from Team Fortress Classic.

JoelTroch commented 8 years ago

Never happened with any of the HL1 projects I've worked on, will investigate later.

tschumann commented 8 years ago

It never happened for me with the old SDK code, and I wouldn't have thought that any of that code would have changed.

JoelTroch commented 8 years ago

Just checked out with one of my projects (ARRANGEMENT), +commandmenu and -commandmenu are working fine and no problems to report, we are using VS 2013 compilers.

Have you tried cleaning and building the whole solution again? It might help (or not), in the meantime, I'll test on a clean HL SDK with VS 2010 compilers.

UPDATE: Looks like it's a VS 2008 problem, everything is fine with VS 2010 and VS 2013 compilers.

tschumann commented 8 years ago

I tried rebuilding and tried both Debug and Release but it still happened - I was using the clean SDK too.

Hm, if it's a Visual Studio 2008 problem that's annoying - I might poke around and see what's happening. If all else fails I guess I'll upgrade.

Thanks for checking by the way.

tschumann commented 8 years ago

Okay, I worked out what the problem was - the problem seems to happen when using Team Fortress Classic's commandmenu.txt - it chokes when it gets to

    // SPY
    CUSTOM  "7" "SPY"   "!SPY"
    {
        CUSTOM  "1" "DISGUISE"              "!DISGUISE"

        CUSTOM  "1" "ENEMY DISGUISE"        "!DISGUISEENEMY"
        CUSTOM  "2" "FRIENDLY DISGUISE"     "!DISGUISEFRIENDLY"

        CUSTOM  "3" "FEIGN DEATH"           "!FEIGN"
        CUSTOM  "4" "FEIGN SILENTLY"        "!FEIGNSILENT"
        CUSTOM  "3" "STOP FEIGNING"         "!FEIGNSTOP"
    }

The commandmenu.txt parsing seems to be partially dependant on some Team Fortress Classic-specific code (which is macroed out). The result is that a button ends up being NULL because the Team Fortress Classic-specific code isn't called and of course the game crashes when it tries to use the uninitialised button.

And back to my initial post, if you delete game_controls.lib from the solution then re-add it the warning disappears.