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

Fix build issues #46

Closed
wants to merge 1 commit into from
Closed

Conversation

codesmythe
Copy link
Contributor

src/backend/sql/gnc-transaction-sql.cpp:
Move inclusion of escape.h out of extern "C" block since
escape.h is now C++ code.

src/backend/xml/gnc-backend-xml.cpp:
Move inclusion of gnc-pref.h in to extern "C" block since
gnc-pref.c is still plain C code.

src/backend/sql/gnc-transaction-sql.cpp:
   Move inclusion of escape.h out of extern "C" block since
   escape.h is now C++ code.

src/backend/xml/gnc-backend-xml.cpp:
   Move inclusion of gnc-pref.s out of extern "C" block since
   gnc-pref.c is still plain C code.
@codesmythe
Copy link
Contributor Author

There is another build issue on Windows, but I don't know how you guys want to fix it. The file src/backend/xml/io-gncxml-v2.cpp fails to find _fdopen() on Windows. After the conversion to C++, this file is now compiled using -std=c++11. This apparently turns on __STRICT_ANSI__, which causes stdio.h to forget about _fdopen. A discussion here suggests using either -std=gnu++11 or using -U__STRICT_ANSI__ to undefine the symbol. Neither option seems very palatable, so leaving to you.

@gjanssens
Copy link
Member

Thanks for the patches. I have cherry-picked them onto master (rather than merging).

As for the second issue you mention, I don't know enough about the build system to be able to choose the best solution. I'll leave this to John. I'll keep this pull request open until he has responded.

@jralls
Copy link
Member

jralls commented Dec 3, 2015

I've been working on a local, temporary, solution of unsetting __STRICT_ANSI__ for the includes. Once I got past the error in io-gncxml-v2.cpp I encountered a similar one in gnc-backend-dbi.cpp (strdup this time). The right solution is to rewrite the relevant functions in C++ to avoid using the POSIX calls at all since mingw doesn't like them, but that will take a while and we don't want the windows build broken in the meantime. I'll push it as soon as I get it to compile all the way.

@jralls
Copy link
Member

jralls commented Dec 3, 2015

__STRICT_ANSI__ changes pushed, closing.

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