Jump to content
Sign in to follow this  
Harald_Kraft

Compiling Flylegacy

Recommended Posts

Hi ChrisI have downloaded the following librariesfreeglut-2.4.0al11sdkplib-1.8.4tiff-win32-3.6.1STLport-4.6.2Jpeg-6b-4Trying to compile Flylegacy I get an error in Flylegacy.h line 666 "missing Bracket".So first I want to check if the libraries mentioned above are exactly the same versions you are using to compile.thanksHarald

Share this post


Link to post
Share on other sites
Guest Chris Wallace

Harald,Are you using the MSVC6 environment or Dev-C++ and the mingw32 compiler? I have two different setups and I think there are differences in the libraries (STL for sure) between them...Chris WallaceOttawa, Canada

Share this post


Link to post
Share on other sites

Hi ChrisI am using the "Visual Studio Toolkit 2003" and the "Microsoft SDK" because they are free and up to date.To be honest a friend of mine who works as an software developer and has years of C++ expierience is helping me (As I told you I have no C++ knowledge and no compiler installed).We had no problem to create all the makefiles and compile the other libraries like Plib, freeglut and stlport.Harald

Share this post


Link to post
Share on other sites

Hi ChrisWe found the problem. Its in this section:enum EFileSearchLocation{ SEARCH_PODS = (1 << 0), SEARCH_DISK = (1 << 1), SEARCH_ALL = SEARCH_PODS | SEARCH_DISK};The MS SDK contains in WINIOCTL a #define for SEARCH_ALL.For verification we changed this section toenum EFileSearchLocation{ LOC_SEARCH_PODS = (1 << 0), LOC_SEARCH_DISK = (1 << 1), LOC_SEARCH_ALL = LOC_SEARCH_PODS | LOC_SEARCH_DISK};and the error disappeared.I still have some other compilation problems but in the end I hope to have a tutorial how to compile flylegacy with the "MS Visual toolkit 2003"regardsHarald

Share this post


Link to post
Share on other sites
Guest Chris Wallace

Harald,I'm glad that you're trying to get it built with the free MS toolkit...that was something I have wanted to do ever since that was released. I can commit the nmake-file generated by Visual Studio if that would help.That enum is defined in the original Fly SDK header, so there is some risk in changing it if any pre-existing DLLs make use of it (they won't be source code compatible with Fly! Legacy). Do you (or your friend) know whether winioctl.h is supposed to be excluded when WIN32_LEAN_AND_MEAN is defined? This is defined in FlyLegacy.h but it's strange that I don't get the same error in either my MSVC or mingw32 configurations. So I wonder if there is something in your makefile that is causing winioctl.h to be processed?Chris WallaceOttawa, Canada

Share this post


Link to post
Share on other sites

Hi Chris!We use the MS SDK for XP SP2. Maybe this is the difference?How can I exclude this header ? (My friend is not available till monday) I append the makefiles for flylegacy, plib and freeglut I used to compile (My friend converted them with Visual Studio 2003). For stlport I used the vc71.mak-file that came with the package.We also had to copyc the files from plib-1.8.4srcssg to flylegacysourceplib to avoid an error with path-resolution. And we had to add a lot of SET INCLUDE-commands for our environment.SET INCLUDE=.;....libjpeginclude;....freeglut-2.4.0include;....plib-1.8.4srcutil;....plib-1.8.4srcsg;.;....plib-1.8.4srcssg;%INCLUDE%I now just started with the SET LIB-commandsI will keep you informedHarald

Share this post


Link to post
Share on other sites
Guest Chris Wallace

>We use the MS SDK for XP SP2. Maybe this is the difference?>>How can I exclude this header ? (My friend is not available>till monday) Not sure...if there are not too many instances like this one then you will be OK just to rename the offending symbols in FlyLegacy until we can get to the bottom of it. I don't know of any way to ensure the header is excluded without mucking about in the windows headers. I am using a very old version of the MS platform SDK (the one that came with MSVC6 several years ago). I don't know if the problem would be due to the XP SP2 release, but I wouldn't think so. I'll look into it and let you know if I find anything.>We also had to copyc the files from plib-1.8.4srcssg to>flylegacysourceplib to avoid an error with path-resolution.Not sure what you mean here...which files did you have to copy?>And we had to add a lot of SET INCLUDE-commands for our>environment.Once I built the plib libraries, I just copied all of the headers into a subdir from my main Include folder. Same with the libraries. This way I only had to specify one folder in each of the Includes and Libs options.Chris WallaceOttawa, Canada

Share this post


Link to post
Share on other sites
Guest Chris Wallace

Harald,I just confirmed that winioctl.h does not get included when I build with MSVC6. Immediately after including the windows header in FlyLegacy.h:#ifdef _WIN32#define WIN32_LEAN_AND_MEAN#include #endifI put in a temporary check for the _WINIOCTL_ macro which is defined in winioctl.h:#ifdef _WINIOCTL_#error _WINIOCTL_ is defined.#endifAnd the compilation still passes...it would fail if winioctl.h was being included. And the version of winioctl.h that I have does define the SEARCH_ALL macro so there is no difference between your headers and mine in that respect. Unfortunately I can't tell you yet why the header is being included in your setup but not mine...maybe WIN32_LEAN_AND_MEAN behaviour has changed across the SDK versions?Chris WallaceOttawa, Canada

Share this post


Link to post
Share on other sites

On the VS7.1 complier you can use the /showIncludes switch to list what include files are being pulled in, indented for nested #includes.I tested with VS7.1 and VS8Beta2, and the "bundled" Platform SDK. In both cases, winioctl.h was not pulled in if WIN32_LEAN_AND_MEAN was #defined. The best way to deal with this might be to add a bit of self-defense to flylegacy.h:

#ifdef SEARCH_ALL#undef SEARCH_ALL#endif[/code ]This would avoid the conflict with winioctl.h while keeping source compatibility with Fly headers.  -Frank

Share this post


Link to post
Share on other sites

Hi Frankthank you for your hint, I will give it a try. Because I am not an developer I had to install a lot of software (MS SDK, Toolkit, WINCVS, Phyton) and I am still trying to get it all running. But with the help of my friend I am making progress (slowly but steady).RegardsHarald

Share this post


Link to post
Share on other sites
Guest Chris Wallace

Hi Frank,Thanks for that tip, it doesn't work for MSVC6 but Harald is using the 2003 toolkit which is VS7? or 8? so it should help in his case.I would be OK with that solution if this were completely unavoidable for some reason, but since there is clearly something unique about Harald's build environment it's best if he can get it sorted out. IMO, the risk of adding #undef's, as a general rule, is that it can mask "real" problems if somebody were to add a duplicate symbol name somewhere else in the FlyLegacy code...I'd rather see the compile error flag it as a conflict, instead of having it masked and resulting in code bugs when a symbol did not have the expected value.Anyway I'm sure Harald will get the #include problem sorted out soon so this issue should disappear.Chris WallaceOttawa, Canada

Share this post


Link to post
Share on other sites

Hi ChrisI am not so sure about this (due to my limited knowledge) but anyway this project is for me a wonderful opportunity to learn C++. (When I learned programming in the 70s we used PASCAL, FORTRAN and COBOL);-)In the meantime I am learning a lot about .mak and .dep files and how to prepare the environment for compiling such a project.I hope watching my efforts can motivate some more people to give it a try.regardsHarald

Share this post


Link to post
Share on other sites

Hi ChrisTo solve the Search_all problem I had to add the switch /D "NOCRYPT" in my makefile. My friend looked it up in the SDK. So this problem is solvedthanksHarald

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

  • Tom Allensworth,
    Founder of AVSIM Online


  • Flight Simulation's Premier Resource!

    AVSIM is a free service to the flight simulation community. AVSIM is staffed completely by volunteers and all funds donated to AVSIM go directly back to supporting the community. Your donation here helps to pay our bandwidth costs, emergency funding, and other general costs that crop up from time to time. Thank you for your support!

    Click here for more information and to see all donations year to date.
×
×
  • Create New...