[vtkusers] Activiz with VTK6.3 compile error CS1577

chenjianyyzz chenjianyyzz at 163.com
Fri Sep 2 05:34:58 EDT 2016


Hi Maogui,

thank you very much for your so detail building steps. with your help, I built 6.2 successfully.
now I am facing some exception while using the built lib, such as :


1.  引发的异常:“System.AccessViolationException”类型的未经处理的异常在Kitware.VTK.dll 中发生

2.  引发的异常:“System.Exception”(位于 Kitware.mummy.Runtime.dll 中)




but I think that's no-related to the building of Activiz.
BTW: have you successfully build the Activiz with VTK7.0?

Thanks again.
Best Regards
James




在 2016-08-30 14:39:10,"maogui.hu" <maogui.hu at gmail.com> 写道:

Hi James,
Here was my main build process, for your reference.


Object: ActiViz.NET 6.3 for .net 4.0.


1. A new installed Win7 32-bit professional system in a vmware virtural machine. The building process was done in the virtual machine.


2.  Install vs2008 trial,  and vs2010 trial for .net framework 4.0 (maybe vs2010 is unnecessary if .net frame 4.0 runtime is available).


3. Install cmake-2.8.8-win32-x86.exe


4. Download CVS from http://ftp.gnu.org/non-gnu/cvs/binary/stable/x86-woe/cvs-1-11-22.zip, unzipped and copy cvs.exe to C:\Windows\System32. Make sure the virtual machine can connet the network because it will download mummyExternalSourceTrees later.


5. Download the patched activiz.net and mummy source (thanks to Mark DeArman)
https://onedrive.live.com/redir?resid=C21891647818579A!108957&authkey=!ADS9VLyqTef24FY&ithint=folder%2c 
Unzip the Kitware_Source.7z, you'll get activizdotnet, gccxml, mummy, and VTK-6.2.0 folders. Replace the VTK-6.2.0 with VTK-6.3 from http://www.vtk.org/download/.
Folder tree, for example,
    C:\VTK\activizdotnet
    C:\VTK\gccxml
    C:\VTK\mummy
    C:\VTK\VTK-6.3.0


The following configure and build process can be found from  http://www.vtk.org/Wiki/VTK/CSharp/ActiViz/Build#Visual_Studio_2005_or_2008_.28gccxml_does_not_yet_work_with_Visual_Studio_2010.29


6. Build gccxml
(1) Configure gccxml, select Visual Studio 9 2008 compiler;
(2) Build the generated gccxml.sln with VS 2008 (release ) and INSTALL it.
(3) Run the gccxml_vcconfig.bat (can be found in the gccxml installation directory 'C:/Program Files/gccxml') in Visual Studio 2008 Command Prompt as adminstrator.


7. Build mummy
(1) in Visual Studio 2008 Command Prompt or Visual Studio Command Prompt (2010), run the command:
sn -k C:\VTK\mummy\Runtime\HUMG.mummy.Runtime.snk


(2) open C:\VTK\mummy\Runtime\CMakeLists.txt, search "IF(NOT Mummy_SNKEYFILE)", and insert the following sentence above it.
GET_FILENAME_COMPONENT(Mummy_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/HUMG.mummy.Runtime.snk" ABSOLUTE)


(3) open C:\VTK\mummy\CMakeLists.txt, insert the following block below the first line "CMAKE_MINIMUM_REQUIRED(VERSION 2.8.3 FATAL_ERROR)":


SET(gccxml_compiler "${CMAKE_CXX_COMPILER}")
IF(MSVC80)
    SET(gccxml_compiler "msvc8")
ENDIF(MSVC80)
IF(MSVC90)
    SET(gccxml_compiler "msvc9")
ENDIF(MSVC90)
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")


(4) open C:\VTK\mummy\Examples\Vehicles\wrappers\csharpmummy\CMakeLists.txt, find the block (near line 82)
    ADD_CUSTOM_COMMAND(
        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml 
        COMMAND ${gccxml_EXECUTABLE} 
        ARGS 
            -fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml 
            -fxml-start=_cable_ 
            ${gccxml_include_args} -DCABLE_CONFIGURATION 
            --gccxml-compiler ${CMAKE_CXX_COMPILER} 
            ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx 
        DEPENDS 
            ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx 
            ${header_fullpath} 
            ${gccxml_EXECUTABLE}


replace it with the following block:
    ADD_CUSTOM_COMMAND(
        OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml 
        COMMAND ${gccxml_EXECUTABLE} 
        ARGS 
            -fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml 
            -fxml-start=_cable_ 
            ${gccxml_include_args} -DCABLE_CONFIGURATION 
            --gccxml-compiler ${gccxml_compiler} 
            ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx 
            -D${GCCXML_EXTRA_D_ARGS} 
        DEPENDS 
            ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx 
            ${header_fullpath} 
            ${gccxml_EXECUTABLE} 
        )


(5) Configure the mummy in CMake with Visual Studio 9 2008
Change options:
    gccxml_EXECUTABLE='C:/Program Files/gccxml/bin/gccxml.exe'
    csc_EXECUTABLE='C:/Windows/Microsoft.NET/Framework/v4.0.30319/csc.exe'


(6) Build the Mummy.sln and INSTALL it.
An error might occur when build the INSTALL project:
    1> file INSTALL cannot find "C:/VTK/mummy/build/bin/x64/Release/Kitware.mummy.Runtime.dll".
My solution is: copy all files from C:/VTK/mummy/build/bin/Release to C:/VTK/mummy/build/bin/x64/Release, and INSTALL again. Then delete the C:/VTK/mummy/build/bin/x64/Release.


8. Build VTK-6.3.0 with default.


9. Build activizdotnet
(1) in Visual Studio 2008 Command Prompt or Visual Studio Command Prompt (2010), run the command:
sn -k C:\VTK\activizdotnet\HUMG.VTK.snk


(2) open C:\VTK\activizdotnet\CMakeLists.txt, search "if(AVDN_SNKEYFILE STREQUAL "")", and insert the following sentence above it.
GET_FILENAME_COMPONENT(AVDN_SNKEYFILE "${CMAKE_CURRENT_SOURCE_DIR}/HUMG.VTK.snk" ABSOLUTE)


(3) search the block
set(gccxml_compiler "${CMAKE_CXX_COMPILER}")
if(MSVC80)
    set(gccxml_compiler "msvc8")
endif()
if(MSVC90)
    set(gccxml_compiler "msvc9")
endif()


Insert the line below the block:
SET (GCCXML_EXTRA_D_ARGS "_HAS_TR1=0")


(4) search the block :
      add_custom_command(
        OUTPUT ${ActiVizDotNet_BINARY_DIR}/xml/${cxxclass}.xml 
        COMMAND ${gccxml_EXECUTABLE} 
            -fxml=${ActiVizDotNet_BINARY_DIR}/xml/${cxxclass}.xml 
            -fxml-start=_cable_ 
            ${gccxml_include_args} -DCABLE_CONFIGURATION 
            --gccxml-compiler ${gccxml_compiler} 
            ${ActiVizDotNet_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx 
        DEPENDS 
            ${ActiVizDotNet_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx 
            ${header} 
            ${gccxml_EXECUTABLE} 
        )


Replace it with:
        ADD_CUSTOM_COMMAND(
            OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml 
            COMMAND ${gccxml_EXECUTABLE} 
            ARGS 
                -fxml=${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}.xml 
                -fxml-start=_cable_ 
                ${gccxml_include_args} -DCABLE_CONFIGURATION 
                --gccxml-compiler ${gccxml_compiler} 
                ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx 
                -D${GCCXML_EXTRA_D_ARGS} 
            DEPENDS 
                ${CMAKE_CURRENT_BINARY_DIR}/xml/${cxxclass}_gccxml.cxx 
                ${header} 
                ${gccxml_EXECUTABLE} 
            )


(5) search "vtkRenderingFreeTypeOpenGL", delete it. (The library is removed from VTK 6.3)


(6) Configure the activizdotnet with CMake with Visual Studio 9 2008
Change options:
    gccxml_EXECUTABLE='C:/Program Files/gccxml/bin/gccxml.exe'
    csc_EXECUTABLE='C:/Windows/Microsoft.NET/Framework/v4.0.30319/csc.exe'
    AVDN_SNKEYFILE='C:/VTK/activizdotnet/HUMG.VTK.snk'
    AVDN_BUILD_CSHARP_DEBUG=OFF


(7) Open the generated ActiVizDotNet.sln in VS 2008, changed to release mode. ALL_BUILD, then INSTALL.
Some errors:
1) the following error occur for some projects:
    error LNK2019: unresolved external symbol "void __cdecl vtkRenderingContextOpenGL_AutoInit_Construct(void)
    SOLUTION:  add "C:\VTK\VTK-6.3.0\build\lib\Release\vtkRenderingContextOpenGL-6.3.lib" to the project's C++ link list


2) "vtkOpenGLFreeTypeTextMapper" not found, double click the error to found the error position, then just comment out the sentences:
      using (Kitware.VTK.vtkOpenGLFreeTypeTextMapper o = Kitware.VTK.vtkOpenGLFreeTypeTextMapper.New())
        { 
            s = o.ToString(); 
        }


3) vtkCommonEL_dll, vtkGraphicsEL_dll not found. Replace them with vtkCommonCoreEL_dll, vtkFiltersProgrammableEL_dll, respectively.




That's ALL. If you use the VTK-6.2.0 instead of VTK-6.3.0, there might be less build errors.


Good luck!


Maogui Hu, Ph.D.
State Key Laboratory of Resources and Environmental Information System
Institute of Geographic Sciences and Natural Resources Research
Chinese Academy of Sciences
A11, Datun Road
Beijing 100101, China
Tel: +86 10-64889055
Fax: +86 10-64889630
Email: humg at Lreis.ac.cn

 
发件人: chenjianyyzz
发送时间: 2016-08-30 12:14
收件人: maogui.hu
抄送: vtkusers
主题: Re:Re: [vtkusers] Activiz with VTK6.3 compile error CS1577
Hi Miaogui,

thank you very much for your reply. using the link from your mail, I try to compile the mummy,
but I meet the error as:

3>error CS1577: 程序集生成失败 -- 不可知程序集不能有处理器特定模块“Kitware.mummy.Runtime.Unmanaged.dll”


I think it's the problem of "strong name signed" .NET Framework binaries, but I cannot figure how to handle it.

I have generated my own SNK and name it the same as the default one "Kitware.mummy.Runtime.pub.snk", and replace the default oone under the folder "mummy\Runtime", then I use cmake to generate the mummy solution, and compile it, then I got the error above.

I spent quite a lot of time searching online but cannot figure it out, will you please be kind helping me how to handle this problem?

Thanks
James




At 2016-08-28 15:29:34, "maogui.hu" <maogui.hu at gmail.com> wrote:

James,
I don't know the reason of your errors since it's incomplete. 
However, from my painful experience, a right CMake version might be one of the important thing in building ActiViz.. You must choose an older version rather than the newest!  For example, CMake 2.8.8 works well for me.


If you compile ActiViz.Net with .NET 4.0, the patched ActiViz.net and mummy source by Mark DeArman is suggested. They can be downloaded from:
https://onedrive.live.com/redir?resid=C21891647818579A!108957&authkey=!ADS9VLyqTef24FY&ithint=folder%2c




Maogui Hu, Ph.D.
State Key Laboratory of Resources and Environmental Information System
Institute of Geographic Sciences and Natural Resources Research
Chinese Academy of Sciences
A11, Datun Road
Beijing 100101, China
Tel: +86 10-64889055
Fax: +86 10-64889630
Email: humg at Lreis.ac.cn

 
发件人: chenjianyyzz
发送时间: 2016-08-27 23:38
收件人: vtkusers
主题: [vtkusers] Activiz with VTK6.3 compile error CS1577
Hello,

I try to compile Activiz with VTK6.3, using the activizdotnet from zamirkhan in GIt, unfortunately I meet the error of error CS1577, attached please see the screenshot, unfortunately some Chinese character insided, but from where you still can see what the error is. actually I have already generate myself snk, and I check  the "Kitware.VTK.CscArgs.txt", where I am sure the snk file path is correct.
can anyone help me to figure it out what's the problem and how to solve it?

Thanks in advance.
James







 





 
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20160902/e827e915/attachment-0001.html>


More information about the vtkusers mailing list