IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Caml Discussion :

[Ocaml][compilation] glGtk, erreur de linkage !


Sujet :

Caml

  1. #1
    Membre à l'essai
    Profil pro
    Étudiant
    Inscrit en
    Novembre 2009
    Messages
    22
    Détails du profil
    Informations personnelles :
    Âge : 35
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Novembre 2009
    Messages : 22
    Points : 22
    Points
    22
    Par défaut [Ocaml][compilation] glGtk, erreur de linkage !
    Bien le bonjour ! j'ai une erreur de linkage assez bizarre

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    make
    make[1]: Entering directory `/home/kulssaka/EHK/Yama_no_Me'
    ocamldep -native -I glGtk/ -I glcaml/ glGtk/glGtk.mli > ._ncdi/glGtk/glGtk.di
    ocamldep -native -I glGtk/ -I glcaml/ glcaml/glcaml.mli > ._ncdi/glcaml/glcaml.di
    ocamldep -I glGtk/ -I glcaml/ source2.ml > ._d/source2.d
    ocamldep -I glGtk/ -I glcaml/ glGtk/glGtk.ml > ._d/glGtk/glGtk.d
    ocamldep -I glGtk/ -I glcaml/ glcaml/glcaml.ml > ._d/glcaml/glcaml.d
    make[1]: Leaving directory `/home/kulssaka/EHK/Yama_no_Me'
    make[1]: Entering directory `/home/kulssaka/EHK/Yama_no_Me'
    ocamlc -c -I glGtk/ -I glcaml/ -I +sdl -I +lablgtk2 -I +lablgl glcaml/glcaml.mli
    ocamlopt -c -I glGtk/ -I glcaml/ -I +sdl -I +lablgtk2 -I +lablgl glcaml/glcaml.ml
    ocamlc -c -I glGtk/ -I glcaml/ -I +sdl -I +lablgtk2 -I +lablgl glGtk/glGtk.mli
    ocamlopt -c -I glGtk/ -I glcaml/ -I +sdl -I +lablgtk2 -I +lablgl glGtk/glGtk.ml
    ocamlopt -c -I glGtk/ -I glcaml/ -I +sdl -I +lablgtk2 -I +lablgl source2.ml
    File "source2.ml", line 49, characters 5-9:
    Warning Y: unused variable area.
    File "source2.ml", line 34, characters 6-54:
    Warning S: this expression should have type unit.
    File "source2.ml", line 39, characters 4-117:
    Warning S: this expression should have type unit.
    File "source2.ml", line 43, characters 4-112:
    Warning S: this expression should have type unit.
    ocamlc -c -cc "cc" -ccopt " \
                                    -DNATIVE_CODE   \
                                     -IglGtk/ -Iglcaml/ -I+sdl -I+lablgtk2 -I+lablgl  -o glcaml/glcaml_stub.o " glcaml/glcaml_stub.c
    ocamlopt \
                                      \
                                      -I glGtk/ -I glcaml/  -I +sdl -I +lablgtk2 -I +lablgl  bigarray.cmxa sdl.cmxa lablgtk.cmxa lablglade.cmxa lablgl.cmxa gtkInit.cmx  -ccopt -LglGtk/ -ccopt -Lglcaml/      glcaml/glcaml_stub.o    -o source2 \
                                    glcaml/glcaml.cmx glGtk/glGtk.cmx source2.cmx
    glGtk/glGtk.o: In function `camlGlGtk__fun_302':
    (.text+0x11): undefined reference to `ml_gtk_gl_area_make_current'
    glGtk/glGtk.o: In function `camlGlGtk__fun_294':
    (.text+0x65): undefined reference to `ml_gtk_gl_area_make_current'
    glGtk/glGtk.o: In function `camlGlGtk__fun_286':
    (.text+0xf7): undefined reference to `ml_gtk_gl_area_make_current'
    glGtk/glGtk.o: In function `camlGlGtk__method_make_current_257':
    (.text+0x378): undefined reference to `ml_gtk_gl_area_make_current'
    glGtk/glGtk.o: In function `camlGlGtk__method_swap_buffers_260':
    (.text+0x3e8): undefined reference to `ml_gtk_gl_area_swap_buffers'
    glGtk/glGtk.o: In function `camlGlGtk__area_201':
    (.text+0x84c): undefined reference to `ml_gtk_gl_area_new'
    glGtk/glGtk.o: In function `camlGlGtk__19':
    (.data+0x2ac): undefined reference to `ml_gtk_gl_area_make_current'
    glGtk/glGtk.o: In function `camlGlGtk__19':
    (.data+0x2b0): undefined reference to `ml_gtk_gl_area_swap_buffers'
    glGtk/glGtk.o: In function `camlGlGtk__19':
    (.data+0x2b4): undefined reference to `ml_gtk_gl_area_new'
    collect2: ld returned 1 exit status
    File "caml_startup", line 1, characters 0-1:
    Error: Error during linking
    make[1]: *** [source2] Error 2
    make[1]: Leaving directory `/home/kulssaka/EHK/Yama_no_Me'
    make: *** [native-code] Error 2
    voici mon glGtk.ml :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    (**************************************************************************)
    (*                Lablgtk                                                 *)
    (*                                                                        *)
    (*    This program is free software; you can redistribute it              *)
    (*    and/or modify it under the terms of the GNU Library General         *)
    (*    Public License as published by the Free Software Foundation         *)
    (*    version 2, with the exception described in file COPYING which       *)
    (*    comes with the library.                                             *)
    (*                                                                        *)
    (*    This program is distributed in the hope that it will be useful,     *)
    (*    but WITHOUT ANY WARRANTY; without even the implied warranty of      *)
    (*    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the       *)
    (*    GNU Library General Public License for more details.                *)
    (*                                                                        *)
    (*    You should have received a copy of the GNU Library General          *)
    (*    Public License along with this program; if not, write to the        *)
    (*    Free Software Foundation, Inc., 59 Temple Place, Suite 330,         *)
    (*    Boston, MA 02111-1307  USA                                          *)
    (*                                                                        *)
    (*                                                                        *)
    (**************************************************************************)
     
    (* $Id: glGtk.ml 1347 2007-06-20 07:40:34Z guesdon $ *)
     
    open Gaux
    open Gtk 
     
    type visual_options = [
      | `USE_GL            
      | `BUFFER_SIZE of int
      | `LEVEL of int      
      | `RGBA              
      | `DOUBLEBUFFER                                                                                                                                                                                          
      | `STEREO                                                                                                                                                                                                
      | `AUX_BUFFERS of int                                                                                                                                                                                    
      | `RED_SIZE of int                                                                                                                                                                                       
      | `GREEN_SIZE of int                                                                                                                                                                                     
      | `BLUE_SIZE of int                                                                                                                                                                                      
      | `ALPHA_SIZE of int                                                                                                                                                                                     
      | `DEPTH_SIZE of int                                                                                                                                                                                     
      | `STENCIL_SIZE of int                                                                                                                                                                                   
      | `ACCUM_GREEN_SIZE of int                                                                                                                                                                               
      | `ACCUM_ALPHA_SIZE of int                                                                                                                                                                               
    ]                                                                                                                                                                                                          
     
    type gl_area = [Gtk.drawing_area|`glarea]
     
    module GtkRaw = struct
      external create :   
        visual_options list -> share:[>`glarea] optobj -> gl_area obj
        = "ml_gtk_gl_area_new"                                       
     
      external swap_buffers : [>`glarea] obj -> unit
        = "ml_gtk_gl_area_swap_buffers"             
     
      external make_current : [>`glarea] obj -> bool
        = "ml_gtk_gl_area_make_current"             
    end                                             
     
    class area_signals obj =
    object (connect)
      inherit GObj.widget_signals_impl (obj : [> gl_area] obj)
      method display ~callback =
        (new GObj.event_signals obj)#after#expose ~callback:
          begin fun ev ->
            if GdkEvent.Expose.count ev = 0 then
              if GtkRaw.make_current obj then callback ()
              else prerr_endline "GlGtk-WARNING **: could not make current";
            true
          end
      method reshape ~callback =
        (new GObj.event_signals obj)#after#configure ~callback:
          begin fun ev ->
            if GtkRaw.make_current obj then begin
              callback ~width:(GdkEvent.Configure.width ev)
                ~height:(GdkEvent.Configure.height ev)
            end
            else prerr_endline "GlGtk-WARNING **: could not make current";
            true
          end
      method realize ~callback =
        (new GObj.misc_signals (obj :> Gtk.widget obj))#after#realize ~callback:
          begin fun ev ->
            if GtkRaw.make_current obj then callback ()
            else prerr_endline "GlGtk-WARNING **: could not make current"
          end
    end
     
    class area obj = object (self)
      inherit GObj.widget (obj : gl_area obj)
      method as_area = obj
      method event = new GObj.event_ops obj
      method connect = new area_signals obj
      method set_size = GtkMisc.DrawingArea.size obj
      method swap_buffers () = GtkRaw.swap_buffers obj
      method make_current () =
        if not (GtkRaw.make_current obj) then
          raise (Gl.GLerror "make_current")
    end
     
    let area options ?share ?(width=0) ?(height=0) ?packing ?show () =
      let share =
        match share with Some (x : area) -> Some x#as_area | None -> None in
      let w = GtkRaw.create options ~share:(Gpointer.optboxed share) in
      if width <> 0 || height <> 0 then GtkMisc.DrawingArea.size w ~width ~height;
      GtkBase.Widget.add_events w [`EXPOSURE];
      GObj.pack_return (new area w) ~packing ~show
     
    let region_of_raw raw =
      Gpointer.unsafe_create_region ~path:[|1|] ~get_length:Raw.byte_size raw
    Et voila mon makefile :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    all: native-code
    
    GLCAML = glcaml/glcaml_stub.c glcaml/glcaml.mli glcaml/glcaml.ml
    GLGTK = glGtk/glGtk.ml glGtk/glGtk.mli
    
    SOURCES = $(GLCAML) $(GLGTK) gladeconverter.ml
    RESULT = gladeconverter
    
    INCDIRS = +sdl +lablgtk2 +lablgl
    CMXA = bigarray.cmxa sdl.cmxa lablgtk.cmxa lablglade.cmxa lablgl.cmxa lablgtkgl.cmxa
    
    
    OCAMLNLDFLAGS = $(CMXA) gtkInit.cmx
    
    -include OCamlMakefile
    Pour le projet les sources sont :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    (*gladeconverter.ml*)
    
    (*OpenGl part*)
    
    let rtri = ref 0.0
    let rquad = ref 0.0
    
    let resizeGLScene ~width ~height =
      let ok_height = 
        if height = 0 then 1 else height in
    
      GlDraw.viewport 0 0 width ok_height;
    
      GlMat.mode `projection;
      GlMat.load_identity ();
      
      GluMat.perspective ~fovy:45.0 
        ~aspect:((float_of_int width)/.(float_of_int ok_height)) ~z:(0.1, 100.0);
        
      GlMat.mode `modelview;
      GlMat.load_identity ()
    
    
    let initGL () =
      GlDraw.shade_model `smooth;
      
      GlClear.color ~alpha:0.0 (0.0, 0.0, 0.0);
    
      GlClear.depth 1.0;
      Gl.enable `depth_test;
      GlFunc.depth_func `lequal;
    
      GlMisc.hint `perspective_correction `nicest
    
    
    let draw area () =
      GlClear.clear [`color; `depth];
      GlMat.load_identity ();
    
      GlMat.translate ~x:(-1.5) ~y:0.0 ~z:(-6.0) ();
      
      GlMat.rotate ~angle:!rtri ~x:0.0 ~y:1.0 ~z:0.0 ();
      
      GlDraw.begins `triangles;
      GlDraw.color (1.0, 0.0, 0.0);
      GlDraw.vertex3 (0.0, 1.0, 0.0);
      GlDraw.color (0.0, 1.0, 0.0);
      GlDraw.vertex3 (-1.0, -1.0, 0.0);
      GlDraw.color (0.0, 0.0, 1.0);
      GlDraw.vertex3 (1.0, -1.0, 0.0);
      GlDraw.ends ();
    
      GlMat.load_identity ();
      GlMat.translate ~x:1.5 ~y:0.0 ~z:(-6.0) ();
      GlMat.rotate ~angle:!rquad ~x:1.0 ~y:0.0 ~z:0.0 ();
      
      GlDraw.color (0.5, 0.5, 1.0);
      GlDraw.begins `quads;
      GlDraw.vertex3 (-1.0, 1.0, 0.0);
      GlDraw.vertex3 (1.0, 1.0, 0.0);
      GlDraw.vertex3 (1.0, -1.0, 0.0);
      GlDraw.vertex3 (-1.0, -1.0, 0.0);
      GlDraw.ends ();
    
      rtri := !rtri +. 0.2;
      rquad := !rquad -. 0.15;
    
      area#swap_buffers ()
    
    let xml =
       Glade.create ~file:"gl.glade" ()
    
    let load_xml () =
    (*Creating the window*)
    	let widget = Glade.get_widget xml "window1" in
    	let window = new GWindow.window (GtkWindow.Window.cast widget) in
    ignore(	window#connect#destroy ~callback:GMain.Main.quit);
    
    (*Creating the useless quit test button*)
    	let widget = Glade.get_widget xml "Quit" in
    	let button = new GButton.button (GtkButton.Button.cast widget) in
    ignore(	button#connect#clicked ~callback:(fun () ->
    		print_endline "Bye"; window#destroy (); GMain.quit ()));
    
    (*Creating the Quit menu*)
    	let widget = Glade.get_widget xml "EXIT" in
    	let item = new GMenu.menu_item (GtkMenu.MenuItem.cast widget) in
    ignore(	item#connect#activate ~callback:(fun () ->
    		print_endline "Bye"; window#destroy (); GMain.quit ()));
    
    (*Creating the GLarea*)
    	let widget = Glade.get_widget xml "Area" in
    	let frame = new GBin.aspect_frame (GtkBin.AspectFrame.cast widget) in
    		let area = GlGtk.area [ `RGBA; `DOUBLEBUFFER;`DEPTH_SIZE 16; `USE_GL]
    				  	~packing:frame#add () in
    ignore(area#connect#realize ~callback:
    	(fun () ->  initGL ();
    				resizeGLScene 800 800 ));
    
    ignore(GMain.Timeout.add ~ms:20 ~callback:
    	(fun () -> draw area ();true));
    
    ignore(area#connect#display ~callback:
    	(fun () -> draw area () ));
    
    
       
    (*End of xml*)   
    window#show ();
    GMain.main ()
    
    
    let main () =
    	load_xml ()
    
    let _ = main ()
    kulssaka@ubuntu:~/EHK/Yama_no_Me$ cat gladeconverter.ml
    (*gladeconverter.ml*)
    
    (*OpenGl part*)
    
    let rtri = ref 0.0
    let rquad = ref 0.0
    
    let resizeGLScene ~width ~height =
      let ok_height = 
        if height = 0 then 1 else height in
    
      GlDraw.viewport 0 0 width ok_height;
    
      GlMat.mode `projection;
      GlMat.load_identity ();
      
      GluMat.perspective ~fovy:45.0 
        ~aspect:((float_of_int width)/.(float_of_int ok_height)) ~z:(0.1, 100.0);
        
      GlMat.mode `modelview;
      GlMat.load_identity ()
    
    
    let initGL () =
      GlDraw.shade_model `smooth;
      
      GlClear.color ~alpha:0.0 (0.0, 0.0, 0.0);
    
      GlClear.depth 1.0;
      Gl.enable `depth_test;
      GlFunc.depth_func `lequal;
    
      GlMisc.hint `perspective_correction `nicest
    
    
    let draw area () =
      GlClear.clear [`color; `depth];
      GlMat.load_identity ();
    
      GlMat.translate ~x:(-1.5) ~y:0.0 ~z:(-6.0) ();
      
      GlMat.rotate ~angle:!rtri ~x:0.0 ~y:1.0 ~z:0.0 ();
      
      GlDraw.begins `triangles;
      GlDraw.color (1.0, 0.0, 0.0);
      GlDraw.vertex3 (0.0, 1.0, 0.0);
      GlDraw.color (0.0, 1.0, 0.0);
      GlDraw.vertex3 (-1.0, -1.0, 0.0);
      GlDraw.color (0.0, 0.0, 1.0);
      GlDraw.vertex3 (1.0, -1.0, 0.0);
      GlDraw.ends ();
    
      GlMat.load_identity ();
      GlMat.translate ~x:1.5 ~y:0.0 ~z:(-6.0) ();
      GlMat.rotate ~angle:!rquad ~x:1.0 ~y:0.0 ~z:0.0 ();
      
      GlDraw.color (0.5, 0.5, 1.0);
      GlDraw.begins `quads;
      GlDraw.vertex3 (-1.0, 1.0, 0.0);
      GlDraw.vertex3 (1.0, 1.0, 0.0);
      GlDraw.vertex3 (1.0, -1.0, 0.0);
      GlDraw.vertex3 (-1.0, -1.0, 0.0);
      GlDraw.ends ();
    
      rtri := !rtri +. 0.2;
      rquad := !rquad -. 0.15;
    
      area#swap_buffers ()
    
    let xml =
       Glade.create ~file:"gl.glade" ()
    
    let load_xml () =
    (*Creating the window*)
    	let widget = Glade.get_widget xml "window1" in
    	let window = new GWindow.window (GtkWindow.Window.cast widget) in
    ignore(	window#connect#destroy ~callback:GMain.Main.quit);
    
    (*Creating the useless quit test button*)
    	let widget = Glade.get_widget xml "Quit" in
    	let button = new GButton.button (GtkButton.Button.cast widget) in
    ignore(	button#connect#clicked ~callback:(fun () ->
    		print_endline "Bye"; window#destroy (); GMain.quit ()));
    
    (*Creating the Quit menu*)
    	let widget = Glade.get_widget xml "EXIT" in
    	let item = new GMenu.menu_item (GtkMenu.MenuItem.cast widget) in
    ignore(	item#connect#activate ~callback:(fun () ->
    		print_endline "Bye"; window#destroy (); GMain.quit ()));
    
    (*Creating the GLarea*)
    	let widget = Glade.get_widget xml "Area" in
    	let frame = new GBin.aspect_frame (GtkBin.AspectFrame.cast widget) in
    		let area = GlGtk.area [ `RGBA; `DOUBLEBUFFER;`DEPTH_SIZE 16; `USE_GL]
    				  	~packing:frame#add () in
    ignore(area#connect#realize ~callback:
    	(fun () ->  initGL ();
    				resizeGLScene 800 800 ));
    
    ignore(GMain.Timeout.add ~ms:20 ~callback:
    	(fun () -> draw area ();true));
    
    ignore(area#connect#display ~callback:
    	(fun () -> draw area () ));
    
    
       
    (*End of xml*)   
    window#show ();
    GMain.main ()
    
    
    let main () =
    	load_xml ()
    
    let _ = main ()
    
    le fichier glade en xml de test :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    <?xml version="1.0"?>
    <glade-interface>
      <!-- interface-requires gtk+ 2.16 -->
      <!-- interface-naming-policy project-wide -->
      <widget class="GtkWindow" id="window1">
        <property name="title" translatable="yes">Yama no Me</property>
        <child>
          <widget class="GtkFixed" id="fixed1">
            <property name="visible">True</property>
            <child>
              <widget class="GtkMenuBar" id="menubar1">
                <property name="width_request">944</property>
                <property name="height_request">26</property>
                <property name="visible">True</property>
                <child>
                  <widget class="GtkMenuItem" id="menuitem1">
                    <property name="visible">True</property>
                    <property name="label" translatable="yes">_File</property>
                    <property name="use_underline">True</property>
                    <child>
                      <widget class="GtkMenu" id="menu1">
                        <property name="visible">True</property>
                        <child>
                          <widget class="GtkImageMenuItem" id="Load">
                            <property name="label">_Load Map</property>
                            <property name="visible">True</property>
                            <property name="use_underline">True</property>
                            <property name="use_stock">False</property>
                            <child internal-child="image">
                              <widget class="GtkImage" id="image1">
                                <property name="visible">True</property>
                                <property name="stock">gtk-select-color</property>
                              </widget>
                            </child>
                          </widget>
                        </child>
                        <child>
                          <widget class="GtkSeparatorMenuItem" id="separatormenuitem1">
                            <property name="visible">True</property>
                          </widget>
                        </child>
                        <child>
                          <widget class="GtkImageMenuItem" id="EXIT">
                            <property name="label">gtk-quit</property>
                            <property name="visible">True</property>
                            <property name="use_underline">True</property>
                            <property name="use_stock">True</property>
                          </widget>
                        </child>
                      </widget>
                    </child>
                  </widget>
                </child>
              </widget>
            </child>
            <child>
              <widget class="GtkButton" id="Quit">
                <property name="label">gtk-quit</property>
                <property name="width_request">144</property>
                <property name="height_request">799</property>
                <property name="visible">True</property>
                <property name="can_focus">True</property>
                <property name="receives_default">True</property>
                <property name="use_stock">True</property>
              </widget>
              <packing>
                <property name="x">800</property>
                <property name="y">27</property>
              </packing>
            </child>
            <child>
              <widget class="GtkAspectFrame" id="Area">
                <property name="width_request">800</property>
                <property name="height_request">800</property>
                <property name="visible">True</property>
                <property name="label_xalign">0</property>
                <property name="shadow_type">none</property>
                <property name="obey_child">False</property>
                <child>
                  <placeholder/>
                </child>
              </widget>
              <packing>
                <property name="y">26</property>
              </packing>
            </child>
          </widget>
        </child>
      </widget>
    </glade-interface>
    
    Le but etant de creer une fenetre affichant de l'OpenGl dans la frame nommee GlArea

  2. #2
    Membre à l'essai
    Profil pro
    Étudiant
    Inscrit en
    Novembre 2009
    Messages
    22
    Détails du profil
    Informations personnelles :
    Âge : 35
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Novembre 2009
    Messages : 22
    Points : 22
    Points
    22
    Par défaut
    Bon mon erreur a changee, apparement les gens tordus ont oublies de preciser qu'il y avait une lib en plus a installer ....

    bref en telechargeant gtkglarea via mon package manager j'ai obtenu un lablgtkgl.cmxa qui est apparu dans mes libs sans .ml >< je vais tenter une compilation al mano car en rajoutant celui ci dans ma ligne de compile je me retrouve avec une autre erreur :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
     
    make
    make[1]: Entering directory `/home/kulssaka/EHK/Yama_no_Me'
    ocamldep -native -I glGtk/ -I glcaml/ glGtk/glGtk.mli > ._ncdi/glGtk/glGtk.di
    ocamldep -native -I glGtk/ -I glcaml/ glcaml/glcaml.mli > ._ncdi/glcaml/glcaml.di
    ocamldep -I glGtk/ -I glcaml/ source2.ml > ._d/source2.d
    ocamldep -I glGtk/ -I glcaml/ glGtk/glGtk.ml > ._d/glGtk/glGtk.d
    ocamldep -I glGtk/ -I glcaml/ glcaml/glcaml.ml > ._d/glcaml/glcaml.d
    make[1]: Leaving directory `/home/kulssaka/EHK/Yama_no_Me'
    make[1]: Entering directory `/home/kulssaka/EHK/Yama_no_Me'
    ocamlc -c -I glGtk/ -I glcaml/ -I +sdl -I +lablgtk2 -I +lablgl glcaml/glcaml.mli
    ocamlopt -c -I glGtk/ -I glcaml/ -I +sdl -I +lablgtk2 -I +lablgl glcaml/glcaml.ml
    ocamlc -c -I glGtk/ -I glcaml/ -I +sdl -I +lablgtk2 -I +lablgl glGtk/glGtk.mli
    ocamlopt -c -I glGtk/ -I glcaml/ -I +sdl -I +lablgtk2 -I +lablgl glGtk/glGtk.ml
    ocamlopt -c -I glGtk/ -I glcaml/ -I +sdl -I +lablgtk2 -I +lablgl source2.ml
    File "source2.ml", line 49, characters 5-9:
    Warning Y: unused variable area.
    File "source2.ml", line 34, characters 6-54:
    Warning S: this expression should have type unit.
    File "source2.ml", line 39, characters 4-117:
    Warning S: this expression should have type unit.
    File "source2.ml", line 43, characters 4-112:
    Warning S: this expression should have type unit.
    ocamlc -c -cc "cc" -ccopt " \
                                    -DNATIVE_CODE   \
                                     -IglGtk/ -Iglcaml/ -I+sdl -I+lablgtk2 -I+lablgl  -o glcaml/glcaml_stub.o " glcaml/glcaml_stub.c
    ocamlopt \
                                      \
                                      -I glGtk/ -I glcaml/  -I +sdl -I +lablgtk2 -I +lablgl  bigarray.cmxa sdl.cmxa lablgtk.cmxa lablglade.cmxa lablgl.cmxa lablgtkgl.cmxa gtkInit.cmx  -ccopt -LglGtk/ -ccopt -Lglcaml/      glcaml/glcaml_stub.o    -o source2 \
                                    glcaml/glcaml.cmx glGtk/glGtk.cmx source2.cmx
    gcc: /usr/lib/ocaml/lablgtk2/lablgtkgl.a: No such file or directory
    File "caml_startup", line 1, characters 0-1:
    Error: Error during linking
    make[1]: *** [source2] Error 2
    make[1]: Leaving directory `/home/kulssaka/EHK/Yama_no_Me'
    make: *** [native-code] Error 2
    je vous tiens au courant .... une rumeur dis qu'il y a des pb avec gl_area sous archlinux :S j'espere pas

  3. #3
    Membre à l'essai
    Profil pro
    Étudiant
    Inscrit en
    Novembre 2009
    Messages
    22
    Détails du profil
    Informations personnelles :
    Âge : 35
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Novembre 2009
    Messages : 22
    Points : 22
    Points
    22
    Par défaut
    Contre toute attente j'ai resolu mon probleme de lib sous ubuntu, je vais mener une enquete apres mon rush projet.

    J'ai mis en rouge les modifications.

    Ca marche c'est le principal :



    Cordialement kulssaka.

  4. #4
    Membre à l'essai
    Profil pro
    Étudiant
    Inscrit en
    Novembre 2009
    Messages
    22
    Détails du profil
    Informations personnelles :
    Âge : 35
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Novembre 2009
    Messages : 22
    Points : 22
    Points
    22
    Par défaut
    Apparemment, j'ai demandé autour de moi, à des gens qui ont le même projet que moi à faire, et il semblerait que cette erreur soit une erreur de linkage fréquente avec ocaml et gtk sur certaines versions de linux, où les liens ne sont pas tout à fait ceux attendus par le compilateur ocaml.

    =>
    La seule solution est donc de passer le compilateur en mode verbose et de relinker ce que le compilateur demande exactement.... Je testerai sans doute ce week end, car il y aurait une petite trentaine de libs a relinker d'apres mon ami

    Si vous êtes en manque de temps comme moi ou par pure flemmardise, installer vite fait un ubuntu/(voir autre mais j'ai pas testé) semble être une solution de facilité et de rapidité.

  5. #5
    Membre à l'essai
    Étudiant
    Inscrit en
    Novembre 2009
    Messages
    10
    Détails du profil
    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Novembre 2009
    Messages : 10
    Points : 15
    Points
    15
    Par défaut
    Tu as fini ton monologue alors ? =D
    Sinon je ne connais pas d'autres solutions

  6. #6
    Futur Membre du Club
    Profil pro
    Inscrit en
    Décembre 2009
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2009
    Messages : 5
    Points : 6
    Points
    6
    Par défaut Help
    Pourrais-tu me contacter par MP car j ai le meme probleme que toi et j'aimerai bien un petit coup de main j'arrive pas a compiler sous Debian.
    Et vraiment la fleme d'installer Ubuntu avec toutes les librairies.

    Merci d'avance

  7. #7
    Membre éprouvé
    Avatar de InOCamlWeTrust
    Profil pro
    Inscrit en
    Septembre 2006
    Messages
    1 036
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Septembre 2006
    Messages : 1 036
    Points : 1 284
    Points
    1 284
    Par défaut
    Faut pas installer Unbuntu... C'est pas bon pour la santé.

  8. #8
    Membre éprouvé
    Avatar de Cacophrene
    Homme Profil pro
    Biologiste
    Inscrit en
    Janvier 2009
    Messages
    535
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : Royaume-Uni

    Informations professionnelles :
    Activité : Biologiste

    Informations forums :
    Inscription : Janvier 2009
    Messages : 535
    Points : 1 125
    Points
    1 125
    Par défaut
    Bonjour !

    Citation Envoyé par InOCamlWeTrust
    Faut pas installer Unbuntu... C'est pas bon pour la santé.
    Unbuntu non, mais Deubuntu oui.

  9. #9
    Futur Membre du Club
    Profil pro
    Inscrit en
    Décembre 2009
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2009
    Messages : 5
    Points : 6
    Points
    6
    Par défaut
    A part ce genre de reponse quelqu'un pourrait-il m'aider
    merci d'avance!

  10. #10
    Membre à l'essai
    Profil pro
    Étudiant
    Inscrit en
    Novembre 2009
    Messages
    22
    Détails du profil
    Informations personnelles :
    Âge : 35
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Novembre 2009
    Messages : 22
    Points : 22
    Points
    22
    Par défaut
    La seule solution est donc de passer le compilateur en mode verbose et de relinker ce que le compilateur demande exactement
    Je vois pas trop ce que tu peux faire d'autre, j'ai pris la solution rapide, mais forcement la plus noob par manque de temps, au final je suis en plein partiels là et donc j'ai toujours pas testé de relinker les libs (big LOL).

    C'est vrai que ça me dégoute de perdre mon arch pour coder sous ubuntu, mais bon. J'ai fini la prépa le 11 janvier, je testerais sans doute apres si personne ne le fait avant

    Pour passer le compilateur en mode verbose utilise le tag -v avec ton compilateur

  11. #11
    Futur Membre du Club
    Profil pro
    Inscrit en
    Décembre 2009
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2009
    Messages : 5
    Points : 6
    Points
    6
    Par défaut
    tu serais pas a Epita toi ?
    Juste une idée comme ca je suis en partiel aussi et jfinis aussi la prepa le 11 :d

  12. #12
    Membre à l'essai
    Profil pro
    Étudiant
    Inscrit en
    Novembre 2009
    Messages
    22
    Détails du profil
    Informations personnelles :
    Âge : 35
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Novembre 2009
    Messages : 22
    Points : 22
    Points
    22
    Par défaut
    en même temps si tu sais pas que je suis a l'epita vu mon pseudo ... bref on doit être dans le même amphi si tu finis le 11 aussi, si ça se trouve dans la même classe, et mon pseudo te dit rien

  13. #13
    Futur Membre du Club
    Profil pro
    Inscrit en
    Décembre 2009
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2009
    Messages : 5
    Points : 6
    Points
    6
    Par défaut
    Pourrais tu me donner la liste des librairies que tu as installe pour pouvoir utiliser glade gtk et opengl ? Et surtout l'ordre d'installation cela m'aiderait bien merci d'avance

  14. #14
    Futur Membre du Club
    Profil pro
    Inscrit en
    Décembre 2009
    Messages
    5
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Décembre 2009
    Messages : 5
    Points : 6
    Points
    6
    Par défaut
    C'est bon en suivant tes cnseils j'arrive a avoir cette zone Opengl mais le probleme c est que lorsque jveux afficher quelque chose j'obtiens : Erreur de segmentation et rien d'autre apres.

  15. #15
    Membre à l'essai
    Profil pro
    Étudiant
    Inscrit en
    Novembre 2009
    Messages
    22
    Détails du profil
    Informations personnelles :
    Âge : 35
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Étudiant

    Informations forums :
    Inscription : Novembre 2009
    Messages : 22
    Points : 22
    Points
    22
    Par défaut
    Dans ce cas je pense que tu devrais vérifier tes appels au fichier glade, genre t'as appelé un bouton qui n'existe pas dans le xml ou un truc dans ce genre.

    je sais qu'il ya une erreur bizarre aussi, car j'ai compilé avec le même makefile les même sources sur deux ordinateurs différents et sur l'un j'avais aps d'erreur de segmentation en quittant et sur l'autre si, je sais pas pourquoi mais quand je m'y remettrais il faudra bien que je vois ><

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. [compilation] Makefile erreur (linkage?)
    Par Valkirion dans le forum C++
    Réponses: 7
    Dernier message: 03/08/2007, 21h24
  2. Erreur de linkage d'une Dll
    Par Hokagge dans le forum MFC
    Réponses: 1
    Dernier message: 30/03/2006, 14h48
  3. Erreur de Linkage GMP
    Par youbyoub dans le forum Autres éditeurs
    Réponses: 8
    Dernier message: 05/03/2006, 13h31
  4. Membres statiques d'une classe et erreur de linkage
    Par Neilos dans le forum C++Builder
    Réponses: 10
    Dernier message: 09/02/2006, 23h06
  5. Réponses: 4
    Dernier message: 30/04/2004, 13h14

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo