New Module Compilation Problems
Posted: 18 Nov 2011, 15:39
Hi,
I'm trying to create a new application module for BCI2000. I used the NewBCI2000Module.exe utility and created a solution file for Microsoft Visual Studio 2010. Right after I create it it compiles with no problems. However, when I add blank .cpp and .h files to my project, it fails to compile. The compiler out puts an error "c:\users\juan\documents\bci2000\src\shared\modules\CoreModule.h(99): fatal error C1189: #error : Unknown MODTYPE value"
The only thing I've done besides add the blank files is modify the CMakeLists.txt so cmake can create a solution later on.
Does anyone have any idea on what could be going on?
Here is the only code I have, which was mostly generated by NewBCI2000Module.exe
Here is my Cmake file, which I copied and modified from the Operator module, to make sure I wasn't doing anything wrong.
I'm trying to create a new application module for BCI2000. I used the NewBCI2000Module.exe utility and created a solution file for Microsoft Visual Studio 2010. Right after I create it it compiles with no problems. However, when I add blank .cpp and .h files to my project, it fails to compile. The compiler out puts an error "c:\users\juan\documents\bci2000\src\shared\modules\CoreModule.h(99): fatal error C1189: #error : Unknown MODTYPE value"
The only thing I've done besides add the blank files is modify the CMakeLists.txt so cmake can create a solution later on.
Does anyone have any idea on what could be going on?
Here is the only code I have, which was mostly generated by NewBCI2000Module.exe
Code: Select all
#include "PCHIncludes.h"
#pragma hdrstop
#ifdef __BORLANDC__
#include <vcl.h>
#include "CoreModuleVCL.h"
#else // __BORLANDC__
// Not using borland, we'll use QT instead
#include "CoreModuleQT.h"
#include <QApplication>
#endif // __BORLANDC__
#define APP_TITLE "ClinicalDAQ"
#ifdef _WIN32
int WINAPI
WinMain( HINSTANCE, HINSTANCE, LPSTR, int )
{
#ifdef __BORLANDC__
try
{
Application->Initialize();
Application->Title = APP_TITLE;
CoreModuleVCL().Run( _argc, _argv );
}
catch (Exception &exception)
{
Application->ShowException(&exception);
}
return 0;
#else // __BORLANDC__
QApplication::setApplicationName( APP_TITLE );
bool success = CoreModuleQT().Run( __argc, __argv );
return success ? 0 : -1;
#endif // __BORLANDC__
}
#else // _WIN32
int main( int argc, char *argv[] )
{
QApplication::setApplicationName( APP_TITLE );
bool success = CoreModuleQT().Run( argc, argv );
return success ? 0 : -1;
}
#endif // _WIN32
Code: Select all
# Set the executable name
SET( EXECUTABLE_NAME ClinicalDAQ )
# DEBUG
MESSAGE( "-- Adding Project: ${EXECUTABLE_NAME}" )
# Set the project specific sources
SET( SRC_PROJECT
main.cpp # You probably will not need to edit this file
MainWindow.cpp
GraphicsScene.cpp
Marker.cpp
# MyNewCustomFilter.cpp # but you should add new filters to specify the module's behaviour
)
SET( HDR_PROJECT
MainWindow.h
GraphicsScene.h
Marker.h
# MyNewCustomFilter.cpp # but you should add new filters to specify the module's behaviour
)
# Use the BCI2000_INCLUDE macro if you need to link with frameworks from /src/extlib:
# BCI2000_INCLUDE( "3DAPI" )
BCI2000_INCLUDE( "MATH" )
# Wrap the Qt files
QT4_WRAP_UI( GENERATED_UI
MainWindow.ui
)
QT4_WRAP_CPP( GENERATED_MOC
MainWindow.h
GraphicsScene.h
Marker.h
)
SET( GENERATED
${GENERATED_UI}
${GENERATED_MOC}
)
# Tell the macro to link against the math libraries in extlib
BCI2000_INCLUDE( "MATH" )
# Generate the required framework
INCLUDE( ${BCI2000_CMAKE_DIR}/frameworks/Core.cmake )
# Add missing framework files
SET( SRC_BCI2000_FRAMEWORK
${SRC_BCI2000_FRAMEWORK}
${BCI2000_SRC_DIR}/shared/bcistream/BCIError_guiapp.cpp
${BCI2000_SRC_DIR}/shared/utils/DisplayFilter.cpp
${BCI2000_SRC_DIR}/shared/utils/DecimationFilter.cpp
${BCI2000_SRC_DIR}/shared/utils/Settings.cpp
${BCI2000_SRC_DIR}/shared/gui/SignalDisplay.cpp
${BCI2000_SRC_DIR}/shared/gui/AboutBox.cpp
${BCI2000_SRC_DIR}/shared/gui/ColorListChooser.cpp
)
SET( HDR_BCI2000_FRAMEWORK
${HDR_BCI2000_FRAMEWORK}
${BCI2000_SRC_DIR}/shared/utils/DisplayFilter.h
${BCI2000_SRC_DIR}/shared/utils/DecimationFilter.h
${BCI2000_SRC_DIR}/shared/utils/Settings.h
${BCI2000_SRC_DIR}/shared/gui/SignalDisplay.h
${BCI2000_SRC_DIR}/shared/gui/AboutBox.h
${BCI2000_SRC_DIR}/shared/gui/ColorListChooser.h
)
SOURCE_GROUP( Source\\BCI2000_Framework\\shared\\bcistream FILES
${BCI2000_SRC_DIR}/shared/bcistream/BCIError_guiapp.cpp
)
SOURCE_GROUP( Source\\BCI2000_Framework\\shared\\utils FILES
${BCI2000_SRC_DIR}/shared/utils/DisplayFilter.cpp
${BCI2000_SRC_DIR}/shared/utils/DecimationFilter.cpp
${BCI2000_SRC_DIR}/shared/utils/Settings.cpp
)
SOURCE_GROUP( Source\\BCI2000_Framework\\shared\\gui FILES
${BCI2000_SRC_DIR}/shared/gui/SignalDisplay.cpp
${BCI2000_SRC_DIR}/shared/gui/AboutBox.cpp
${BCI2000_SRC_DIR}/shared/gui/ColorListChooser.cpp
)
SOURCE_GROUP( Headers\\BCI2000_Framework\\shared\\utils FILES
${BCI2000_SRC_DIR}/shared/utils/DisplayFilter.h
${BCI2000_SRC_DIR}/shared/utils/DecimationFilter.h
${BCI2000_SRC_DIR}/shared/utils/Settings.h
)
SOURCE_GROUP( Headers\\BCI2000_Framework\\shared\\gui FILES
${BCI2000_SRC_DIR}/shared/gui/SignalDisplay.h
${BCI2000_SRC_DIR}/shared/gui/AboutBox.h
${BCI2000_SRC_DIR}/shared/gui/ColorListChooser.h
)
# Set the Project Source Groups
SOURCE_GROUP( Source\\Project FILES ${SRC_PROJECT} )
SOURCE_GROUP( Headers\\Project FILES ${HDR_PROJECT} )
# Set Generated Source Groups
SOURCE_GROUP( Generated FILES ${GENERATED} )
# Setup Extlib Dependencies
BCI2000_SETUP_EXTLIB_DEPENDENCIES( SRC_BCI2000_FRAMEWORK HDR_BCI2000_FRAMEWORK LIBS FAILED )
# Setup GUI Imports
BCI2000_SETUP_GUI_IMPORTS( SRC_BCI2000_FRAMEWORK HDR_BCI2000_FRAMEWORK )
IF( NOT FAILED )
BCI2000_ADD_TO_INVENTORY( Operator ${EXECUTABLE_NAME} )
# Add the executable to the project
ADD_EXECUTABLE(
${EXECUTABLE_NAME}
WIN32
${SRC_BCI2000_FRAMEWORK} ${HDR_BCI2000_FRAMEWORK}
${SRC_PROJECT} ${HDR_PROJECT}
${GENERATED}
)
# Add Pre-processor defines
SET_PROPERTY( TARGET ${EXECUTABLE_NAME} APPEND PROPERTY COMPILE_FLAGS "-DUSE_QT" )
TARGET_LINK_LIBRARIES( ${EXECUTABLE_NAME} )
# Link against the Qt Libraries and other dependencies
TARGET_LINK_LIBRARIES( ${EXECUTABLE_NAME} ${QT_LIBRARIES} ${LIBS} )
ENDIF( NOT FAILED )