64 bit compilation fails for SVN revision 3604 (+quick fix)
Posted: 16 Oct 2011, 19:27
Heya!
Just recently tried to get the latest SVN version of BCI2000 up and running, SVN Revision 3604. While the VS 2008 project files are generated perfectly and the compile succeeds, the project files generated by the "Visual Studio 2008 win64" batch file fail to link at the last step. Compiling the g.USBampADC project succeeds in the 32 bit version, but fails during the linking stage with the following errors:
[Note: I'm compiling against 64-bit gUSBAmp & 64 bit Qt libraries]
It seems this has to do with the new BCIRegistry.h file that I'm assuming was introduced with the refactoring into BCI2000Framework[Core/SigSrc/SigProc/App]Module libraries. Specifically, the following lines:
Attempts to work arounded it included:
- Changing CMAKE versions has no effect (was present in 2.8.6, 2.8.2)
- Visual studio vcproj files are identical when diff'd, save for compiler /machine: type
- Preprocessed files (compile with /P ) for the above line are identical
- Generating the 32 bit project files and switching the linker's machine type from "/MACHINE:X86" to "/MACHINE:X64" generates the same linker error
The only workaround that I've found is commenting out the _pragma line to remove the linker flag "/include:_gUSBAmpADCRegistrar1". I'm guessing that linker flag is there to make sure that a reference to the registrar gets into the exports for the statically compiled libraries (from the export_registry), so this could break things down the line if removed. But it compiles and appears to run correctly.
Is this reproducible? I just checked out a clean version of the SVN 3604 and ran the "Make VS2008 Win64 Project Files.bat" using cmake version 2.8.2 (or 2.8.6).
-Tim
Just recently tried to get the latest SVN version of BCI2000 up and running, SVN Revision 3604. While the VS 2008 project files are generated perfectly and the compile succeeds, the project files generated by the "Visual Studio 2008 win64" batch file fail to link at the last step. Compiling the g.USBampADC project succeeds in the 32 bit version, but fails during the linking stage with the following errors:
Code: Select all
LINK : error LNK2001: unresolved external symbol _SigSrcRegistry
gUSBampADC.obj : error LNK2001: unresolved external symbol _gUSBampADCRegistrar1It seems this has to do with the new BCIRegistry.h file that I'm assuming was introduced with the refactoring into BCI2000Framework[Core/SigSrc/SigProc/App]Module libraries. Specifically, the following lines:
Code: Select all
# define RegisterExtension_( x ) \
extern "C" int ExtensionObjectName_( x ) = (int)EnvironmentExtension::AutoDelete( new x ); \
__pragma( comment( linker, "/include:_" #x "Instance" )- Changing CMAKE versions has no effect (was present in 2.8.6, 2.8.2)
- Visual studio vcproj files are identical when diff'd, save for compiler /machine: type
- Preprocessed files (compile with /P ) for the above line are identical
- Generating the 32 bit project files and switching the linker's machine type from "/MACHINE:X86" to "/MACHINE:X64" generates the same linker error
The only workaround that I've found is commenting out the _pragma line to remove the linker flag "/include:_gUSBAmpADCRegistrar1". I'm guessing that linker flag is there to make sure that a reference to the registrar gets into the exports for the statically compiled libraries (from the export_registry), so this could break things down the line if removed. But it compiles and appears to run correctly.
Is this reproducible? I just checked out a clean version of the SVN 3604 and ran the "Make VS2008 Win64 Project Files.bat" using cmake version 2.8.2 (or 2.8.6).
-Tim