|
|
|
![]() |
|
Strumenti |
![]() |
#1 |
Member
Iscritto dal: Jul 2005
Messaggi: 291
|
[C#/OpenGl] errore con il Tao Framework
Salve, per una tesina che dovrei fare per l'uni mi serve usare l'OpenGl.
Visto che, essendo abituato a Java, mi sembra piu facile passare al C# invece che al C++ ho scaricato il Tao Framework. Con questo programma di prova Codice:
using System; using System.Collections.Generic; using System.Linq; using System.Text; using Tao.OpenGl; using Tao.FreeGlut; namespace FirstOpenGLTest { class OpenGlTest { public static void Main(string[] args) { int width = 800; int eight = 600; Glut.glutInit(); Glut.glutInitDisplayMode(Glut.GLUT_DOUBLE | Glut.GLUT_RGB | Glut.GLUT_DEPTH); Glut.glutInitWindowSize(width, eight); Glut.glutInitWindowPosition(100, 100); Glut.glutCreateWindow("Perspective's GLUT Template"); } } } Codice:
'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_64\mscorlib\2.0.0.0__b77a5c561934e089\mscorlib.dll' 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities\9.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.dll' 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Windows.Forms\2.0.0.0__b77a5c561934e089\System.Windows.Forms.dll' 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System\2.0.0.0__b77a5c561934e089\System.dll' 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Drawing\2.0.0.0__b03f5f7f11d50a3a\System.Drawing.dll' 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.HostingProcess.Utilities.Sync\9.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.HostingProcess.Utilities.Sync.dll' 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\Microsoft.VisualStudio.Debugger.Runtime\9.0.0.0__b03f5f7f11d50a3a\Microsoft.VisualStudio.Debugger.Runtime.dll' 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Users\Evangelist\Documents\Visual Studio 2008\Projects\FirstOpenGLTest\FirstOpenGLTest\bin\Debug\FirstOpenGLTest.vshost.exe' 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\mscorlib.resources\2.0.0.0_it_b77a5c561934e089\mscorlib.resources.dll' 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Core\3.5.0.0__b77a5c561934e089\System.Core.dll' 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Xml.Linq\3.5.0.0__b77a5c561934e089\System.Xml.Linq.dll' 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Data.DataSetExtensions\3.5.0.0__b77a5c561934e089\System.Data.DataSetExtensions.dll' 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_64\System.Data\2.0.0.0__b77a5c561934e089\System.Data.dll' 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Xml\2.0.0.0__b77a5c561934e089\System.Xml.dll' The thread 0x1730 has exited with code 0 (0x0). The thread 0x1504 has exited with code 0 (0x0). The thread 0xed4 has exited with code 0 (0x0). 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Users\Evangelist\Documents\Visual Studio 2008\Projects\FirstOpenGLTest\FirstOpenGLTest\bin\Debug\FirstOpenGLTest.exe', Symbols loaded. 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Users\Evangelist\Documents\Visual Studio 2008\Projects\FirstOpenGLTest\FirstOpenGLTest\bin\Debug\Tao.FreeGlut.dll' A first chance exception of type 'System.BadImageFormatException' occurred in FirstOpenGLTest.exe An unhandled exception of type 'System.BadImageFormatException' occurred in FirstOpenGLTest.exe Additional information: Tentativo di caricare un programma con un formato non corretto. (Eccezione da HRESULT: 0x8007000B) 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Windows\assembly\GAC_MSIL\System.Configuration\2.0.0.0__b03f5f7f11d50a3a\System.Configuration.dll' The thread 'vshost.RunParkingWindow' (0x17f8) has exited with code 0 (0x0). The program '[4972] FirstOpenGLTest.vshost.exe: Managed' has exited with code -532459699 (0xe0434f4d). |
![]() |
![]() |
![]() |
#2 |
Member
Iscritto dal: Jul 2005
Messaggi: 291
|
hey, nessuno sa niente??? fek, PGI nessuno???
__________________
CPU: Intel Core 2 Quad Q6600 - Mobo: Asus P5E - RAM:4x2GB DDR2 - sk video: Power Color ATI Radeon HD3870 - HD:Western Digital 750GB |
![]() |
![]() |
![]() |
#3 |
Senior Member
Iscritto dal: Oct 2007
Città: Padova
Messaggi: 4131
|
Provo ad aiutarti:
intanto guarda la spiegazione di questo "System.BadImageFormatException" se già non l'hai fatto. Citando le prime righe dal link: Codice:
A BadImageFormatException exception is thrown when the file image of a DLL or executable program is not valid. Codice:
'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Users\Evangelist\Documents\Visual Studio 2008\Projects\FirstOpenGLTest\FirstOpenGLTest\bin\Debug\FirstOpenGLTest.exe', Symbols loaded. 'FirstOpenGLTest.vshost.exe' (Managed): Loaded 'C:\Users\Evangelist\Documents\Visual Studio 2008\Projects\FirstOpenGLTest\FirstOpenGLTest\bin\Debug\Tao.FreeGlut.dll' A first chance exception of type 'System.BadImageFormatException' occurred in FirstOpenGLTest.exe An unhandled exception of type 'System.BadImageFormatException' occurred in FirstOpenGLTest.exe Ovviamente non saprei dirti il perchè, speriamo che qualcuno più esperto legga il thread, ciao ![]() |
![]() |
![]() |
![]() |
#4 |
Member
Iscritto dal: Jul 2005
Messaggi: 291
|
Tutte le dll le ho prese dalla cartella del framework come erano, non penso siano buggate quelle purtroppo...
Per caso conosci altri framework con i quali posso utilizzare Glut/OpenGl in C#??
__________________
CPU: Intel Core 2 Quad Q6600 - Mobo: Asus P5E - RAM:4x2GB DDR2 - sk video: Power Color ATI Radeon HD3870 - HD:Western Digital 750GB |
![]() |
![]() |
![]() |
#5 |
Senior Member
Iscritto dal: Mar 2007
Messaggi: 1792
|
Ho compilato il tuo esempio da linea di comando con VC#2005 (csc test.cs /r:tao.opengl.dll,tao.freeglut.dll) senza ricevere messaggi di errore né in fase di compilazione né a runtime. Quale versione del Tao Framework hai installato?
|
![]() |
![]() |
![]() |
#6 |
Member
Iscritto dal: Jul 2005
Messaggi: 291
|
Tao 2.0.0, l'esempio compilato con Visual Studio 2008 e runnata dall'IDE su un sistema Windows Vista 64bit
__________________
CPU: Intel Core 2 Quad Q6600 - Mobo: Asus P5E - RAM:4x2GB DDR2 - sk video: Power Color ATI Radeon HD3870 - HD:Western Digital 750GB |
![]() |
![]() |
![]() |
#7 |
Senior Member
Iscritto dal: Oct 2007
Città: Padova
Messaggi: 4131
|
Ah, hai lanciato da Vista?
Non vorrei dire cavolate ma mi pare che Vista sia un po' più schizzinoso del vecchio XP in quanto a mandare in esecuzione file così tranquillamente... Magari i .exe e/o le .dll devono in qualche modo "essere firmati", magari con un magic number nell'intestazione del file... Ora, non so di preciso, però ipotizzo che questo potrebbe essere il motivo per cui ti da problemi nell'eseguire la dll e ti dice che è "BadFormat". Bho ![]() |
![]() |
![]() |
![]() |
#8 |
Senior Member
Iscritto dal: Mar 2007
Messaggi: 1792
|
Io l'ho provato su Vista 32 bit e funziona alla perfezione...
|
![]() |
![]() |
![]() |
#9 |
Senior Member
Iscritto dal: Oct 2007
Città: Padova
Messaggi: 4131
|
|
![]() |
![]() |
![]() |
#10 |
Senior Member
Iscritto dal: Mar 2007
Messaggi: 1792
|
Sì, il problema è proprio Windows Vista 64 bit come spiegato in questa discussione. I sistemi operativi a 64 bit di Microsoft non sono (ancora) il massimo in fatto di compatibilità, stabilità e supporto...
|
![]() |
![]() |
![]() |
#11 | |
Member
Iscritto dal: Jul 2005
Messaggi: 291
|
Quote:
(se po rimedià con qualche puzzonata?) EDIT: workaround trovato dal link, come sempre siete i migliori!!!! Grazie, mo funge (ho settato compilazione ax86 invece che x64)
__________________
CPU: Intel Core 2 Quad Q6600 - Mobo: Asus P5E - RAM:4x2GB DDR2 - sk video: Power Color ATI Radeon HD3870 - HD:Western Digital 750GB Ultima modifica di morskott : 24-01-2008 alle 17:55. |
|
![]() |
![]() |
![]() |
Strumenti | |
|
|
Tutti gli orari sono GMT +1. Ora sono le: 16:24.