FIFE forums

Please login or register.

Login with username, password and session length
Advanced search  

News:

FIFE 0.4.0 has been released on 15th of January, 2017!

Pages: [1] 2

Author Topic: MSVC Project File [template]  (Read 9857 times)

Joshdan

  • Developer
  • Newbie
  • *
  • Posts: 46
    • View Profile
MSVC Project File [template]
« on: January 30, 2008, 03:57:29 am »

I would like to re-work the MSVC project files, as they've quickly become a frustration for me.  Some things I would like to adjust:

1. Remove project file from SVN.  Since it is created by scons, its only use in SVN is to create conflicts.  And this disaster is far too impatient to wait before happening.  Rather, it happens about once a day.

2.  Solution file has configurations for all of the project build options, which actually match semantically (e.g. Debug solution configuration should not build the Release version of the project).

3. A debug build that actually includes debugging symbols, and works without jumping through any hoops.

4. Debug build with island_demo as default run target, since that is our current debugging target.  This won't add any more overhead to debugging a different target than having a blank target by default.

6. Something clever so that you don't get that stupid reload project question every time.

So first off, I have a question: do we need the static builds?  I've looked over the project file and these seem designed to build a static version of the fife library (i.e. one which will be compiled into another C++ program).  Since the current project is designed around SWIG, I am not sure this makes sense.  Also, static builds don't seem to be included for any of other supported compilers.  Still, I am new to the project, and quite possibly totally confused.

Secondly, if anybody has any particular concerns / desires for the project or solution files, please let me know.
Logged

jasoka

  • Developer
  • Jr. Member
  • *
  • Posts: 51
    • View Profile
Re: MSVC Project File [template]
« Reply #1 on: January 31, 2008, 09:24:33 am »

For question no 1: in case we remove the file from svn, what's the plan for msvc users to update the project files after svn update? In case they run scons manually, don't they get the same conflicts for the file? Also in case two people are using msvc, how they would keep the project files synchronized?

Logged

jwt

  • Developer
  • Newbie
  • *
  • Posts: 26
    • View Profile
Re: MSVC Project File [template]
« Reply #2 on: January 31, 2008, 12:12:47 pm »

Joshdan, these all look like great changes. Improving the MSVC project files may also help us attract new developers and users in the windows world.
Logged

mvBarracuda

  • Administrator
  • Sr. Member
  • *
  • Posts: 411
    • View Profile
Re: MSVC Project File [template]
« Reply #3 on: January 31, 2008, 01:12:28 pm »

For question no 1: in case we remove the file from svn, what's the plan for msvc users to update the project files after svn update? In case they run scons manually, don't they get the same conflicts for the file? Also in case two people are using msvc, how they would keep the project files synchronized?
The MSVC users do need to manually run update_project_files.bat before compiling ATM anyway. The conflicts Joshdan is talking about are SVN merging issues so if the file is not versioned anymore, they will be gone :-) Keeping project files in sync would be done by editing build\win32\build_environments\visual_studio_8\engine_template.xml, that's already the proper way of handling it ATM.
Logged

jasoka

  • Developer
  • Jr. Member
  • *
  • Posts: 51
    • View Profile
Re: MSVC Project File [template]
« Reply #4 on: January 31, 2008, 03:54:30 pm »

ok, off it goes then  :)
Like jwt already mentioned, glad to see someone taking a look into msvc support side.

Btw, would it possible to just define some file scan path for msvc (so that files wouldn't be saved at all into project file). Works that way with KDevelop.
Logged

Joshdan

  • Developer
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: MSVC Project File [template]
« Reply #5 on: January 31, 2008, 11:29:11 pm »

I don't think it's possible to define it like that in the actual MSVC project file, but that is how scons builds the project file.  So in the simple case of adding a file, there should be no need for a non-MSVC user to do anything related to MSVC. 

If a new file is added to the scan path, when the pre-build event in MSVC runs "scons projectfilesonly=1", it will add this new file to the project file, and MSVC will reload the changes.  This is actually how it works presently, but with the snags I mentioned.

Adding a library or include path requires updating the engine_template.xml file that barra mentioned, as does adding a compile flag.
Logged

anxs

  • Newbie
  • Posts: 14
    • View Profile
Re: MSVC Project File [template]
« Reply #6 on: February 03, 2008, 08:41:04 am »

Hi Joshdan,

great ideas :)

AFAIK the fife lib has to be build as a static library, because we've no dll-export declarations in the code (The entry points of the methods, classes and so on are not defined in the lib). I already tried to use a dynamic msvc-compiled fife lib, but python doesn't accept this one as a module.

I guess we would have to use the dll-export statements in the code, but I'm not sure if it's worth the effort. (as all other compilers don't seem to need them) I remember that there is the possibility to write these statements in an extra file, but it's still a lot of work. (As this file has to be kept up to date all the time)

Greetings,
Anxs
Logged

Joshdan

  • Developer
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: MSVC Project File [template]
« Reply #7 on: February 04, 2008, 02:05:30 am »

I've committed changes that should take care of 1, 2, 3, and 4.  Due to my "creative" enumeration, that leaves just #6.

As my commit log mentions, the debug build is basically the release build with optimizations off and symbols on.  Using debug libraries or pre-processor definitions seemed to trigger some bugs.  These may be worth looking into (e.g. Guichan Container copy constructor errors if the debug version of the library is used), but that should not interfere with the regular process of debugging all the other parts of FIFE.
Logged

mvBarracuda

  • Administrator
  • Sr. Member
  • *
  • Posts: 411
    • View Profile
Re: MSVC Project File [template]
« Reply #8 on: February 04, 2008, 09:31:16 pm »

Mortiz had some build issues after the MSVC project file changes. Quote from IRC:
Quote
<mortiz> "The oridinal 67 could not be located in the dynamic link library zlib1.dll"
<mortiz> i assume so, the error seems to have been caused by the build settings behind changed, the debug_static and release_static configurations were removed

In case you were not able to resolve the problem mortiz please create a trac ticket for it so we can try to track down this issue.
Logged

Joshdan

  • Developer
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: MSVC Project File [template]
« Reply #9 on: February 05, 2008, 01:01:02 am »

Sorry about that.  I forgot I worked around this issue a while back.  I am pretty sure the problem is that the zlib lib and dll are mismatched.  When I replace them with the latest from http://sourceforge.net/project/showfiles.php?group_id=5624&package_id=14274, everything seems to work fine.

To resolve the problem, you can use the "Release" setting, or uncompress http://members.fifengine.net/joshdan/zlib_fix.zip into your build\win32 directory.

Barra, can you please apply these changes to the Windows SDK?  Also, the C:\FIFE_SDK\static_libs\msvc2005\zdll.lib is not used, and can be removed.
Logged

mortiz

  • Newbie
  • Posts: 3
    • View Profile
Re: MSVC Project File [template]
« Reply #10 on: February 05, 2008, 06:34:39 pm »

Seems I'm still having trouble running the FIFE clients on Windows Vista since the 2112 revision. Building seems to go as normal but when I run any of the clients I intermittently get the following error message produced by the C Runtime (at other times it won't produce an error message at all, simply crash to desktop or warn me that the program has stopped responding)



Which Microsoft defines as

Quote
C Run-Time Error R6016

not enough space for thread data

The program did not receive enough memory from the operating system to complete a _beginthread call.

When a new thread is started, the library must create an internal database for the thread. If the database cannot be expanded with memory provided by the operating system, the thread will not begin and the calling process will stop.


I've made sure i've run scons, updated the dlls etc etc before building but it doesn't seem to make a difference. I've also made no changes to my system (like I say, all clients in revs before 2112 still run). It might be helpful if Joshdan details the exact changes he made to the build process either here or in IRC so we can figure out what the problem may be.

It should be noted that I am using the new SDK (which includes the updated libraries), though this problem existed before I switched. I've debugged the application after it crashes but this yields no useful information.

Anyother information you need you can request here
Logged

mvBarracuda

  • Administrator
  • Sr. Member
  • *
  • Posts: 411
    • View Profile
Re: MSVC Project File [template]
« Reply #11 on: February 05, 2008, 06:46:49 pm »

The new compile SDK mortiz was refering to was released today and contains the following changes compared to the old 2007.2-r4 SDK:
- Joshdan's zlib fix for MSVC 2005
- SWIG upgraded to 1.3.33
- libSDL upgraded to 1.2.13

You can find more information about the new SDK here:
http://wiki.fifengine.net/index.php?title=Win32_compile_SDK

Download URL (temporary, we'll move the SDK to sourceforge once the build problems are resolved):
http://members.fifengine.net/bin/FIFE_2008.0_win32_SDK.exe
Logged

Joshdan

  • Developer
  • Newbie
  • *
  • Posts: 46
    • View Profile
Re: MSVC Project File [template]
« Reply #12 on: February 05, 2008, 11:16:02 pm »

Hi Mortiz,

Were you ever able to use breakpoints before?  If not, I suspect you were always running the Release build.  This is more likely than it seems, as both the "Debug" and "Release" settings in the toolbar (i.e. Solution configuration) used the Release version of the project.

My changes in detail were
1. Removed the project file from SVN
2. Added a .vcproj.user file to SVN which contained a default mapping to use the island_demo as the debug target.  I think this will only affect new users of the SDK, as the generic user file seems to be just a template for the user-specific .vcproj.user file which is automatically created when the project is closed the first time.
3. Added some line breaks to the project file template. Deleted the so-called "static release" and "static debug" configurations.  Copied the release settings over to the debug version of the project.  For debug I then disabled optimization, enabled debugging symbols, and enabled minimum rebuild.
4. Fixed the solution file so that the "Debug" configuration used the Debug version of the project instead of the Release.

I have double-checked the project template, and confirmed that I made absolutely no changes to the Release version of the project other than adding whitespace. 
Logged

mvBarracuda

  • Administrator
  • Sr. Member
  • *
  • Posts: 411
    • View Profile
Re: MSVC Project File [template]
« Reply #13 on: February 06, 2008, 03:41:04 am »

Maybe mortiz was using the release_static & debug_static versions before and he didn't encounter the problem as he didn't try the non-static builds?

Could you please do the following mortiz and report back how it worked:
1. Build FIFE with the current project file in release and debug mode and let us know which version worked (one of them doesn't seem to work but what about the other?)
2. Just update your build\win32\build_environments\visual_studio_8 directory via TortoiseSVN to the old revision 2111. There should be four build options available now (release, debug, release_static, debug_static). Please test all of them and let us know which one(s) worked for you.

EDIT #2: Just found out that the static build options that were in place are necessary for building the FIFE unit tests with MSVC. I tried to merge them back into the project file template but as I have no chance to test it here I would rather leave the task to you Joshdan :-) Could you please bring back the static release and debug build options?
« Last Edit: February 06, 2008, 09:48:49 am by mvBarracuda »
Logged

mortiz

  • Newbie
  • Posts: 3
    • View Profile
Re: MSVC Project File [template]
« Reply #14 on: February 06, 2008, 09:36:13 am »

OK, i have it compiling in release mode, debug mode still seems to be broken for some reason.

Another issue I've encountered is that when you build the FIFE project in MSVC the configuration settings are switched back to "Debug", even if you originally built in Release. This is more of an inconvenience that a problem because it requires that the configuration be set back to release after every build.
Logged
Pages: [1] 2