Skip to Content.
Sympa Menu

cgal-discuss - [cgal-discuss] Get error when I try to make a wrapper for CGAL

Subject: CGAL users discussion list

List archive

[cgal-discuss] Get error when I try to make a wrapper for CGAL


Chronological Thread 
  • From: Mumu <>
  • To: cgal-discuss <>
  • Subject: [cgal-discuss] Get error when I try to make a wrapper for CGAL
  • Date: Mon, 19 Oct 2009 17:28:28 +0800 (CST)

Hi everone!
I tried to make a wrapper of the Polygon_2, which could be used in c# project. But I got
" unhandled System.BadImageFormatException"
  Message=" not a valid Win32 application。 (exception form HRESULT:0x800700C1)"
  Source="testConsole"
  StackTrace:
        testConsole.Program.Main(String[] args)
        System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
        System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
        Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
        System.Threading.ThreadHelper.ThreadStart_Context(Object state)
        System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
        System.Threading.ThreadHelper.ThreadStart()
I work on Windows and use vs2005.
What should I do?
code of the wrapper:(managed c++ library project, use shared MFC in dll)
// Wrapper_CGAL.h
#using <mscorlib.dll>
#include "Stdafx.h"
#include <CGAL/Boolean_set_operations_2.h>
using namespace System;
using namespace System::Collections::Generic;
using namespace VisualSpace::HostCommon;
namespace VisualSpace {
 namespace Wrapper_CGAL{
  public __gc class Polygon
  {
  public:
   Polygon(void){};
   ~Polygon(){}
   void Clear(void){};
  };
 }
}
 
code of the c# program:(already add the former dll to the references)
using System;
using System.Collections.Generic;
using System.Text;
using VisualSpace.Wrapper_CGAL;
namespace testConsole
{
    class Program
    {
        static void Main(string[] args)
        {
           Polygon g = new Polygon();
        }
    }
}

Thanks in advance
Dalin



网易历六年耗亿资打造,3D国韵网游《天下贰》,免费领光盘


  • [cgal-discuss] Get error when I try to make a wrapper for CGAL, Mumu, 10/19/2009

Archive powered by MHonArc 2.6.16.

Top of Page