configure --enable-debug - no debug messages
Posted: 26.09.2011, 08:40
Hello,
I was testing celestia Qt4 GUI with different config files and for debugging I did a configure --with-qt --enable-debug. I realized that if the config file didn't exists / wasn't readable, I only got the "Error reading configuration file" message box and after clicking ok, celestia exited with an segmentation fault.
No output of further messages because the DEBUG symbol was only defined in config.h
The following patch solves this:
HAVE_CONFIG_H is only defined if you use configure to create the makefiles,
so you can do the same with debug.cpp
The side effect of this patch is you don't have to create an empty config.h file if you use qmake on Linux.
Until now I can't fix the segmentation fault . Needs further testing.
See you
refsteff
I was testing celestia Qt4 GUI with different config files and for debugging I did a configure --with-qt --enable-debug. I realized that if the config file didn't exists / wasn't readable, I only got the "Error reading configuration file" message box and after clicking ok, celestia exited with an segmentation fault.
No output of further messages because the DEBUG symbol was only defined in config.h
The following patch solves this:
Code: Select all
diff -urN celestia.org/src/celutil/debug.h celestia/src/celutil/debug.h
--- celestia.org/src/celutil/debug.h 2011-08-19 16:05:07.000000000 +0200
+++ celestia/src/celutil/debug.h 2011-09-25 21:23:34.683220842 +0200
@@ -10,6 +10,10 @@
#ifndef _DEBUG_H_
#define _DEBUG_H_
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif /* HAVE_CONFIG_H */
+
// Define the DPRINTF macro; g++ supports macros with variable
// length arguments, so we'll use those when we can.
#ifndef DPRINTF
HAVE_CONFIG_H is only defined if you use configure to create the makefiles,
so you can do the same with debug.cpp
Code: Select all
diff -urN celestia.org/src/celutil/debug.cpp celestia/src/celutil/debug.cpp
--- celestia.org/src/celutil/debug.cpp 2011-08-19 16:05:07.000000000 +0200
+++ celestia/src/celutil/debug.cpp 2011-09-25 21:23:10.993219030 +0200
@@ -13,11 +13,9 @@
#include <stdio.h>
#include <cstdarg>
-#ifndef _WIN32
-#ifndef TARGET_OS_MAC
+#ifdef HAVE_CONFIG_H
#include <config.h>
-#endif /* TARGET_OS_MAC */
-#endif /* _WIN32 */
+#endif /* HAVE_CONFIG_H */
static int debugVerbosity = 0;
The side effect of this patch is you don't have to create an empty config.h file if you use qmake on Linux.
Until now I can't fix the segmentation fault . Needs further testing.
See you
refsteff