lucabaldini / xpedaq

Data acquisition software for the X-ray polarimetry explorers
GNU General Public License v2.0
0 stars 0 forks source link

Compilation issue under Windows #90

Closed lucabaldini closed 8 years ago

lucabaldini commented 8 years ago

This has been reported by Fabio in Rome, and the exact error is

C:\Users\GPD\DAQ\xpedaq-0.8.2>qmake

C:\Users\GPD\DAQ\xpedaq-0.8.2>make
cd xpedaq\ && mingw32-make -f Makefile
mingw32-make[1]: Entering directory 'C:/Users/GPD/DAQ/xpedaq-0.8.2/xpedaq'
g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -fexceptions  -mthreads -Wall -
Wextra -DUNICODE -DQT_THREAD_SUPPORT -DQT_DLL -DQT_GUI_LIB  -DQT_NETWORK_LIB -DQT
_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2  -I"c:\Qt\4
.8.6\include\QtCore" -I"c:\Qt\4.8.6\include\QtNetwork"  -I"c:\Qt\4.8.6\include\Qt
Gui" -I"c:\Qt\4.8.6\include" -I".." -I"..\gui" -I"..\daq" -I"..\utils"  -I"..\qcu
stomplot" -I"..\quickusb-2.15.2" -I"c:\Qt\4.8.6\include\ActiveQt"  -I"moc" -I"c:\
Qt\4.8.6\mkspecs\default" -o build\xpedaqos.o ..\utils\xpedaqos.cpp
In file included from C:/mingw32/i686-w64-mingw32/include/c++/cstdlib:72:0,
                 from ..\utils\xpedaqos.h:28,
                 from ..\utils\xpedaqos.cpp:23:
..\utils\xpedaqos.cpp:35:23: error: expected unqualified-id before '(' token
 std::string xpedaqos::environ(std::string name)
                       ^
Makefile:623: recipe for target 'build/xpedaqos.o' failed
mingw32-make[1]: *** [build/xpedaqos.o] Error 1
mingw32-make[1]: Leaving directory 'C:/Users/GPD/DAQ/xpedaq-0.8.2/xpedaq'
Makefile:41: recipe for target 'sub-xpedaq-make_default' failed
mingw32-make: *** [sub-xpedaq-make_default] Error 2

C:\Users\GPD\DAQ\xpedaq-0.8.2>
lucabaldini commented 8 years ago

Interestingly enough, changing the function name from "environ" to "envvar" seem to fix the issue.

And, actually, now we have another error

mingw32-make[1]: Entering directory 'D:/xpe/xpedaq-0.8.2/xpepeds'
g++ -c -pipe -fno-keep-inline-dllexport -g -frtti -fexceptions -mthreads -Wall -
Wextra -DUNICODE -DQT_THREAD_SUPPORT -DQT_DLL -DQT_GUI_LIB -DQT_NETWORK_LIB -DQT
_CORE_LIB -DQT_HAVE_MMX -DQT_HAVE_SSE -DQT_HAVE_MMXEXT -DQT_HAVE_SSE2 -I"c:\Qt\4
.8.6\include\QtCore" -I"c:\Qt\4.8.6\include\QtNetwork" -I"c:\Qt\4.8.6\include\Qt
Gui" -I"c:\Qt\4.8.6\include" -I".." -I"..\gui" -I"..\daq" -I"..\utils" -I"..\qcu
stomplot" -I"..\quickusb-2.15.2" -I"c:\Qt\4.8.6\include\ActiveQt" -I"moc" -I"c:\
Qt\4.8.6\mkspecs\default" -o build\xpepedsWindow.o xpepedsWindow.cpp
In file included from xpepedsWindow.h:27:0,
                 from xpepedsWindow.cpp:23:
..\gui/pDisplayWindow.h:9:26: fatal error: pedestalsMap.h: No such file or direc
tory
 #include "pedestalsMap.h"
                          ^
compilation terminated.
Makefile:926: recipe for target 'build/xpepedsWindow.o' failed
mingw32-make[1]: *** [build/xpepedsWindow.o] Error 1
mingw32-make[1]: Leaving directory 'D:/xpe/xpedaq-0.8.2/xpepeds'
Makefile:63: recipe for target 'sub-xpepeds-make_default' failed
mingw32-make: *** [sub-xpepeds-make_default] Error 2
lucabaldini commented 8 years ago

Ok, apparently Windows does need an explicit

INCLUDEPATH += .

in xpepeds\xpepeds.h

lucabaldini commented 8 years ago

I am pushing this in

diff --git a/utils/xpedaqos.cpp b/utils/xpedaqos.cpp
index a097ff5..470687b 100644
--- a/utils/xpedaqos.cpp
+++ b/utils/xpedaqos.cpp
@@ -32,7 +32,7 @@ std::string xpedaqos::kSeparator = "/";

 /*!
  */
-std::string xpedaqos::environ(std::string name)
+std::string xpedaqos::environmentalVariable(std::string name)
 {
   char *path = std::getenv(name.c_str());
   if (path == NULL) {
@@ -83,7 +83,7 @@ std::string xpedaqos::join(std::string p1, std::string p2, std
  */
 std::string xpedaqos::rjoin(std::string p1)
 {
-  return xpedaqos::join(xpedaqos::environ("XPEDAQ_ROOT"), p1);
+  return xpedaqos::join(xpedaqos::environmentalVariable("XPEDAQ_ROOT"), p1);
 }

diff --git a/utils/xpedaqos.h b/utils/xpedaqos.h
index acc317f..5e31a55 100644
--- a/utils/xpedaqos.h
+++ b/utils/xpedaqos.h
@@ -33,7 +33,7 @@ with this program; if not, write to the Free Software Foundati

 namespace xpedaqos{
   extern std::string kSeparator;
-  extern std::string environ(std::string name);
+  extern std::string environmentalVariable(std::string name);
   extern std::string join(std::string p1, std::string p2);
   extern std::string join(std::string p1, std::string p2, std::string p3);
   extern std::string join(std::string p1, std::string p2, std::string p3,
diff --git a/xpepeds/xpepeds.pro b/xpepeds/xpepeds.pro
index c3b9dc9..73b7662 100644
--- a/xpepeds/xpepeds.pro
+++ b/xpepeds/xpepeds.pro
@@ -17,6 +17,7 @@ equals(QT_MAJOR_VERSION, 5) {
   QT += network opengl
   }

+INCLUDEPATH += .
 INCLUDEPATH += ..
 INCLUDEPATH += ../gui
 INCLUDEPATH += ../daq
lucabaldini commented 8 years ago

And this seems to be working under Windows---closing the issue.