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

fixes for Windows - MinGW gcc 4.4.0 compiler #12216

Closed
qgib opened this issue Nov 27, 2009 · 1 comment
Closed

fixes for Windows - MinGW gcc 4.4.0 compiler #12216

qgib opened this issue Nov 27, 2009 · 1 comment
Labels
Build/Install Related to compiling or installing QGIS Feature Request
Milestone

Comments

@qgib
Copy link
Contributor

qgib commented Nov 27, 2009

Author Name: Steven Mizuno (Steven Mizuno)
Original Redmine Issue: 2156

Redmine category:build/install
Assignee: nobody -


I have tried compiling QGIS using [[MinGW]] with its now current gcc 4.4.0 compiler. There were 2 errors about undefined types and 1 warning that occurred when using gcc 4.4.0.

files affected:

src/core/pal/pal.h:
The error is caused by a missing time.h that is included by cwchar in the earlier version of the standard C++ headers and isn't included by the current version. I in noticed in pal.h that there is a test for _MSC_VER which includes the standard C header time.h.

Using this header allowed [[MinGW]] to compile OK. However, I realized that the C++ header is what should be included, not the underlying C header, so my patch removes the test for _MSC_VER and just includes the C++ header ctime. There should not be a problem if ctime has been included previously.

src/core/qgssearchstringparser.yy:
The error in this file is caused by missing stdlib.h for similar reasons as in pal.h (bits/stl_algobase.h used to include cstdlib). I have added a line to include the C++ standard header cstdlib.

src/app/main.cpp:
A warning about _fmode redeclared without dllimport attribute:... occurs in this file. This is because _fmode is being declared and initialized in the module. It is already declared extern in a header so just need to set its value. The proper way is to set _fmode in main() as is done (with _set_fmode() ) when MSVC is the compiler.

Also, the logic for whether MSVC or other (MinGW) is the compiler is somewhat confusing, so I have changed the #ifndef _MSC_VER near the top to #else to be part of the preceding #ifdef _MSC_VER. And the #undef _fmode isn't necessary with [[MinGW]], as far as I can tell, so that was removed. I also added an enclosing #ifdef WIN32 in main() for the MSVC/MinGW statements. The statements used with MSVC were not changed.

I have tested these changes with [[MinGW]]/gcc 3.4.5 as well and found no issues.


@qgib
Copy link
Contributor Author

qgib commented Dec 3, 2009

Author Name: Marco Hugentobler (@mhugent)


Applied in ca3d00a (SVN r12326). Thanks!


  • resolution was changed from to fixed
  • status_id was changed from Open to Closed

@qgib qgib added Feature Request Build/Install Related to compiling or installing QGIS labels May 24, 2019
@qgib qgib added this to the Version 1.4.0 milestone May 24, 2019
@qgib qgib closed this as completed May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Build/Install Related to compiling or installing QGIS Feature Request
Projects
None yet
Development

No branches or pull requests

1 participant