Win64 compilation issues
WARNING! You do not have to make a specific build for SOFA on Windows 64.
The standard 32bit SOFA works fine on a 64bit system! If, however, you want to exploit the full capabilities of you 64bit system with SOFA, here is a list of lib and dll you need to change :
1. Glew (1.6.0)
http://glew.sourceforge.net/ 64bit binary code
$(SOFADIR)/include/GL: glew.h, glexew.h, wglew.h $(SOFADIR)/lib/win32/common: glew32.lib $(SOFADIR)/bin: glew32.dll
2. Glut (3.7.6)
$(SOFADIR)/lib/win32/common: glut32.lib $(SOFADIR)/bin: glut32.dll
3. ZLib (1.2.3)
Compile the “static library”, by choosing from “configuration manager”.
Modify one macro in zconf.h to “if 0”, when there are some error.
$(SOFADIR)/include/: zlib.h, zconf.h $(SOFADIR)/lib/win32/Release: zlib.lib (rename the file name if needed by SOFA configuration) $(SOFADIR)/bin: zlibWAPI.dll
4. libPng (1.4.0)
Directly download the binaries from GTK website
Replace: png.h, pngconf.h, libpng.lib needed files:
$(SOFADIR)/include/: png.h, pngconf.h $(SOFADIR)/lib/win32/Release: libpng.lib $(SOFADIR)/bin: libpng14-14.dll
5. QT (4.7.3)
a) Unzip the file to $(QTDIR), which folder must contains configure.exe.
b) Modify the file of $(QTDIR)/configure, change the value of item “QT_DEFAULT_BUILD_PARTS” to “lib tools translation” , that can save compiling time and disk space.
c) Run “Visual Studio 2008 x64 Win64 Command Prompt”. Chang the directory to QT’s configure.exe.
d) Run “configure -release” for release version or “configure” for debug version.
e) Run “nmake”.
f) Copy some generated folders under $(QTDIR) to $(SOFADIR)/tools/qt4win, the folder names includes: “bin”, “include”, “lib”, "mkspecs", "plugins" and “translation”.
g) Copy the *.dll files in $(QTDIR)/bin to $(SOFADIR)/bin
6. SOFA (for VC9)
a) The original configured sofa solution (by run "Project VC9.bat") is made for win32 platform, so we need change it to x64 platform. Which can be done like this: in the Configuration Manager of VC9, Create a new solution platform for x64, whose settings can copy from win32 platform.
b) if not using qt 4.5.x, open the file $(SOFADIR)\extlibs\qwt-5.2.0\src\qwt_valuelist.h, change the line of "#if QT_VERSION < 0x040X00" to a higher version than your current qt version. Just like in this document, current qt version is 4.7.3, so change "#if QT_VERSION < 0x040700" to "#if QT_VERSION < 0x040800", this can avoid the bug of 'qhash' when building qwt in sofa.
c) Correct some text errors in "DistanceOnGrid.inl", "Distances.inl" and "MechanicalObject.inl", VC9 will recognize some quotation marks as question marks. Of course you can do this as you meet these errors during compiling SOFA.
d) maybe you will be asked to add "/bigobj" to the project compiling configuration for "sofa_base_mechanics_1_0", which tells VC9 to support big object files with more than 65535 sections.
e) maybe you will need to remove "Generated Files/OBJ/release/sofa.res" from the project of "runsofa" and "Modeler" in VC9 solution explorer.