Menu

#4 Make problems

open
nobody
None
5
2012-12-12
2010-03-07
qubodup
No

c
In file included from oglextensions.c:10:
oglextensions.h:35: error: conflicting types for ‘PFNGLBUFFERDATAARBPROC’
/usr/include/GL/glext.h:5593: note: previous declaration of ‘PFNGLBUFFERDATAARBPROC’ was here
oglextensions.c: In function ‘init_ogl_extensions’:
oglextensions.c:47: warning: cast to pointer from integer of different size
oglextensions.c:48: warning: cast to pointer from integer of different size
oglextensions.c:49: warning: cast to pointer from integer of different size
oglextensions.c:50: warning: cast to pointer from integer of different size
oglextensions.c:51: warning: cast to pointer from integer of different size
oglextensions.c:56: warning: cast to pointer from integer of different size
oglextensions.c:57: warning: cast to pointer from integer of different size
oglextensions.c: In function ‘has_extension’:
oglextensions.c:77: warning: incompatible implicit declaration of built-in function ‘strstr’
oglextensions.c:81: warning: incompatible implicit declaration of built-in function ‘strlen’
oglextensions.c: In function ‘check_for_ogl_extensions’:
oglextensions.c:111: warning: incompatible implicit declaration of built-in function ‘printf’
make: *** [oglextensions.o] Error 1
make: *** Waiting for unfinished jobs....
In file included from oglstuff.c:35:
oglextensions.h:35: error: conflicting types for ‘PFNGLBUFFERDATAARBPROC’
/usr/include/GL/glext.h:5593: note: previous declaration of ‘PFNGLBUFFERDATAARBPROC’ was here
make: *** [oglstuff.o] Error 1

there seem to be multiple problems, on one hand PFNGLBU... on the other hand strlen, printf need some #include <> I think

make -j4, arch linux 64bit

Discussion

  • Horst Kevin

    Horst Kevin - 2010-03-09

    This is somehow strage, because to oglextensions.h:35 you come only if the preprocessor directive WIN is true and to oglextensions.c:47 you only come if WIN is false. I wonder how this could happen. But, you should set WIN to 0 anyway (in constants.h). Then, to be sure all will work fine and a complete rebuild will be done, remove all the .o files. The try again.

    Keep in mind:
    What kind of source do you use? At the moment only the released sources are save. An svn snapshot could be broken at the moment (but maybe you are lucky ...).

    And, because the warning about printf and stuff, I don't know about. I have seen this and it first appeared with gcc 4.?. However, I do simply ignore it, you also should :-) If I will find little free time I look for a solution ...

     
  • qubodup

    qubodup - 2010-03-10

    WIN is 0
    constants.h:#define WIN 0

    I removed all .o files

    I use the latest svn revision. (sorry I forgot to mention this) It seems to me that most developers find latest-revision bug reports useful, which is why I posted this :)

    Oh, I didn't realize these were only warnings. usually these kind of messages cause errors for me. :)

     
  • Horst Kevin

    Horst Kevin - 2010-03-10

    Did you got rid of the real error? which actually was:

    oglextensions.h:35: error: conflicting types for
    ‘PFNGLBUFFERDATAARBPROC’
    /usr/include/GL/glext.h:5593: note: previous declaration of
    ‘PFNGLBUFFERDATAARBPROC’ was here

    Then also the warnings:
    oglextensions.c:47: warning: cast to pointer from integer of different size
    should disappear.

    In this:

    I use the latest svn revision. (sorry I forgot to mention this) It seems
    to me that most developers find latest-revision bug reports useful, which
    is why I posted this :)

    Oh, I didn't realize these were only warnings. usually these kind of
    messages cause errors for me. :)

    you are absolutely right, shame on me, I'm lazy and use svn as a kind of update.

     
  • Horst Kevin

    Horst Kevin - 2010-03-10

    I wrote:
    you are absolutely right, shame on me, I'm lazy and use svn as a kind of
    update.

    Aehm, I did mean, as kind of backup, not update

     
  • qubodup

    qubodup - 2010-03-10

    No, the error persists.

    $ rm *o
    $ make -j1
    gcc -g -c fac.c
    gcc -g -c mymath.c
    gcc -g -c oglstuff.c
    In file included from oglstuff.c:35:
    oglextensions.h:35: error: conflicting types for ‘PFNGLBUFFERDATAARBPROC’
    /usr/include/GL/glext.h:5593: note: previous declaration of ‘PFNGLBUFFERDATAARBPROC’ was here
    make: *** [oglstuff.o] Error 1

    But I made no changes, so it could not have changed :) I did a fresh SVN checkout and the error happens again. Perhaps you could do a fresh svn checkout to test it?

    lazy? You mean the fact that you use svn, rather than releasing releases?
    I prefer to be able to compile from svn, this way, if there are bugs in a release, I don't have to, in addition, get the svn version to test if the bug is already fixed. also I'm interested in the latest features. :)

     
  • Horst Kevin

    Horst Kevin - 2010-03-11

    Ok, this is a real issue.

    It looks like the PFNGLBUFFERDATAARBPROC function type has changed or is simply different on your system (2nd parameter is no longer int but GLsizeiptrARB). I define this type my myself and there it is int. This self-defining is actually only necessary for windows, however, I also do it for linux.

    But on my system all works fine. I use the proprietary nvidia driver on arch 32 bit. I wonder if it depends on the fact it is a 64bit system or not, because the new sizeiptrARB type seems to make it possible to use 64 bit integer, however, it's just an assumption.

    What you could try is to use the function directly (it is used in initworld.c, there the VBO's get initialized, just remove the my_ prefix and of course the according parts it oglextension.c/.h).

    I must do some investigation anyway how to handle this (keeping in mind it also works on windows).

     
  • qubodup

    qubodup - 2010-03-11

    I removed all occurrences of "my_" from the three files you mentioned.

    $ make -j1
    gcc -g -c oglstuff.c
    In file included from oglstuff.c:35:
    oglextensions.h:35: error: conflicting types for ‘PFNGLBUFFERDATAARBPROC’
    /usr/include/GL/glext.h:5593: note: previous declaration of ‘PFNGLBUFFERDATAARBPROC’ was here
    oglextensions.h:46: error: ‘glMultiTexCoord2fARB’ redeclared as different kind of symbol
    /usr/include/GL/gl.h:2017: note: previous declaration of ‘glMultiTexCoord2fARB’ was here
    oglextensions.h:47: error: ‘glActiveTextureARB’ redeclared as different kind of symbol
    /usr/include/GL/gl.h:2005: note: previous declaration of ‘glActiveTextureARB’ was here
    make: *** [oglstuff.o] Error 1

    $ make -j4
    gcc -g -c oglstuff.c
    gcc -g -c oglextensions.c
    gcc -g -c initworld.c
    gcc -g -c physics.c
    In file included from oglextensions.c:10:
    oglextensions.h:35: error: conflicting types for ‘PFNGLBUFFERDATAARBPROC’
    /usr/include/GL/glext.h:5593: note: previous declaration of ‘PFNGLBUFFERDATAARBPROC’ was here
    oglextensions.h:46: error: ‘glMultiTexCoord2fARB’ redeclared as different kind of symbol
    /usr/include/GL/gl.h:2017: note: previous declaration of ‘glMultiTexCoord2fARB’ was here
    oglextensions.h:47: error: ‘glActiveTextureARB’ redeclared as different kind of symbol
    /usr/include/GL/gl.h:2005: note: previous declaration of ‘glActiveTextureARB’ was here
    oglextensions.c: In function ‘init_ogl_extensions’:
    oglextensions.c:47: warning: cast to pointer from integer of different size
    oglextensions.c:48: warning: cast to pointer from integer of different size
    oglextensions.c:49: warning: cast to pointer from integer of different size
    oglextensions.c:50: warning: cast to pointer from integer of different size
    oglextensions.c:51: warning: cast to pointer from integer of different size
    oglextensions.c:56: warning: cast to pointer from integer of different size
    oglextensions.c:57: warning: cast to pointer from integer of different size
    oglextensions.c: In function ‘has_extension’:
    oglextensions.c:77: warning: incompatible implicit declaration of built-in function ‘strstr’
    oglextensions.c:81: warning: incompatible implicit declaration of built-in function ‘strlen’
    oglextensions.c: In function ‘check_for_ogl_extensions’:
    oglextensions.c:111: warning: incompatible implicit declaration of built-in function ‘printf’
    make: *** [oglextensions.o] Error 1
    make: *** Waiting for unfinished jobs....
    In file included from oglstuff.c:35:
    oglextensions.h:35: error: conflicting types for ‘PFNGLBUFFERDATAARBPROC’
    /usr/include/GL/glext.h:5593: note: previous declaration of ‘PFNGLBUFFERDATAARBPROC’ was here
    oglextensions.h:46: error: ‘glMultiTexCoord2fARB’ redeclared as different kind of symbol
    /usr/include/GL/gl.h:2017: note: previous declaration of ‘glMultiTexCoord2fARB’ was here
    oglextensions.h:47: error: ‘glActiveTextureARB’ redeclared as different kind of symbol
    /usr/include/GL/gl.h:2005: note: previous declaration of ‘glActiveTextureARB’ was here
    In file included from initworld.c:32:
    oglextensions.h:35: error: conflicting types for ‘PFNGLBUFFERDATAARBPROC’
    /usr/include/GL/glext.h:5593: note: previous declaration of ‘PFNGLBUFFERDATAARBPROC’ was here
    oglextensions.h:46: error: ‘glMultiTexCoord2fARB’ redeclared as different kind of symbol
    /usr/include/GL/gl.h:2017: note: previous declaration of ‘glMultiTexCoord2fARB’ was here
    oglextensions.h:47: error: ‘glActiveTextureARB’ redeclared as different kind of symbol
    /usr/include/GL/gl.h:2005: note: previous declaration of ‘glActiveTextureARB’ was here
    physics.c: In function ‘do_fighter_physics’:
    physics.c:1250: warning: incompatible implicit declaration of built-in function ‘printf’
    initworld.c: In function ‘get_3d_data_bin’:
    initworld.c:81: warning: incompatible implicit declaration of built-in function ‘memset’
    initworld.c: In function ‘get_grundtextur_block’:
    initworld.c:578: warning: incompatible implicit declaration of built-in function ‘memcpy’
    initworld.c: In function ‘get_wald_block’:
    initworld.c:623: warning: incompatible implicit declaration of built-in function ‘memcpy’
    initworld.c: In function ‘assemble_one_cloud_block’:
    initworld.c:935: warning: incompatible implicit declaration of built-in function ‘memset’
    make: *** [oglstuff.o] Error 1
    initworld.c: In function ‘loadTerrain’:
    initworld.c:1886: warning: incompatible implicit declaration of built-in function ‘memset’
    initworld.c:2210: warning: incompatible implicit declaration of built-in function ‘memcpy’
    make: *** [initworld.o] Error 1

    Did I remove too much? Sorry for not being able to differentiate what is good and what is bad "my_" :)

     
  • Nobody/Anonymous

    What I mean is:
    The Problem is PFNGLBUFFERDATAARBPROC my_glBufferDataARB
    Maybe you can solve the problem by using the according function directly, i.e. as
    delivered by glext.h. For this must do following:

    To remove type definition and declaration of 'my' version of the function:
    Remove line 35 and 43 from oglextensions.h

    Remove the part which delivers the function pointer:
    Remove line 44 and 50 from oglextensions.c

    And finally replace my function by the one delivered by the system everythere it is used, probably at following three places:
    Remove the "my_'" prefix from line 347, 351, 355 in initworld.c
    I hope glBufferDataARB is the right name, if not, look in /usr/include/GL/glext.h. Maybe you also must include the glext.h file in initworld.c, but I'am not sure this is necessary or not.

    Good luck :-)

    And by the way, mybe this is the final solution which I will implement to fix this problem. Alternatively I could provid a sizeiptrARB type ... Maybe both switchable by preproc instructions ...

    And would you be so nice to tell me what 3D card/driver you use? And do you have a 32 bit linux at hand where the problem does not exist? Thanks!

     
  • qubodup

    qubodup - 2010-03-13

    I'm on a 32bit netbook now and it compiles just with a few warnings

    http://codepad.org/3UlGNQCK

    I'll try what you explained the next time I'm at my desktop :)

     
  • qubodup

    qubodup - 2010-03-16

    I followed your advice and it compiled successfully!

    I copied ./fac from src/flugui to svn root (or is it trunk?) and executed it. I'm segfaulting :(

    Here's the bt:

    $ gdb ./fac
    GNU gdb (GDB) 7.0.1
    Copyright (C) 2009 Free Software Foundation, Inc.
    License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
    This is free software: you are free to change and redistribute it.
    There is NO WARRANTY, to the extent permitted by law. Type "show copying"
    and "show warranty" for details.
    This GDB was configured as "x86_64-unknown-linux-gnu".
    For bug reporting instructions, please see:
    <http://www.gnu.org/software/gdb/bugs/>...
    Reading symbols from /home/qubodup/src/subversion/facsimulation/fac...done.
    (gdb) run
    Starting program: /home/qubodup/src/subversion/facsimulation/fac
    [Thread debugging using libthread_db enabled]
    Error during parsing trackfile.
    Error during parsing trackfile.
    w=1024 h=768 screen_ratio=1.330000 Korrektur = 0.997500

    Bis hier is alles klar
    VBO extension supported.
    Multitexturing is suitable (max = 4) and all needed extensions there.

    Bis hier is alles klar
    0.027440 -0.999616 -0.003920
    Anzahl der Dreiecke = 30
    Daten sind texturweise im Speicher abgelegt ...
    VBO's werden angelegt.

    Program received signal SIGSEGV, Segmentation fault.
    0xfffffffff7db9fa0 in ?? ()
    (gdb) bt
    #0 0xfffffffff7db9fa0 in ?? ()
    #1 0x000000000040a78c in get_3d_data_bin (p_pi=0x8348b0 "UEBERSCHRIFT //LOAD THREEDIM MODELS /X",
    p_file_name=0x42e680 "data/objects_3d/opponent_md.tri", p_anzt=0x7fffffff9b90, p_scal_fac=1,
    p_vbo_ctx=0x7fffffff9ca8, p_detail=0, p_do_not_use_vbos=0 '\000') at initworld.c:345
    #2 0x000000000042a6c5 in init_world (p_opt_ctx=0x7fffffffc750, p_env=0x7fffffff94a0, p_all_verts=0x7fffffff9570,
    p_ich=0x7fffffffe370, p_oppos=0x7fffffffc740, p_ctx=0x7fffffffdc80, p_render_ctx=0x7fffffffc7d0,
    p_all_vehicles=0x7fffffffc748, p_stimmung=1, p_terrain_element=0x7fffffff9498, p_light_pos=0x7fffffffe490,
    p_textures=0x7fffffffe410) at initmisc.c:63
    #3 0x0000000000402d30 in spiel () at fac.c:224
    #4 0x0000000000402fc7 in main (argc=1, argv=0x7fffffffe678) at fac.c:312
    (gdb) quit
    A debugging session is active.

    Inferior 1 \[process 4644\] will be killed.
    

    Quit anyway? (y or n) y

     
  • Horst Kevin

    Horst Kevin - 2010-04-15

    Sorry for the delay.
    Maybe problems are solved with latest svn snapshot.
    What I did is no longer to try to get functions pointers for the ARB stuff (as it is still necessary for windows). I use the functions as they are delivered by the system.

     
  • qubodup

    qubodup - 2010-04-15

    Hello,

    thanks, it does work now, however it segfaults often

    Program received signal SIGSEGV, Segmentation fault.
    0x00007ffff4f4f767 in XNextEvent () from /usr/lib/libX11.so.6
    (gdb) bt
    #0 0x00007ffff4f4f767 in XNextEvent () from /usr/lib/libX11.so.6
    #1 0x00007ffff770fa50 in X11_DispatchEvent () from /usr/lib/libSDL-1.2.so.0
    #2 0x00007ffff771090b in X11_PumpEvents () from /usr/lib/libSDL-1.2.so.0
    #3 0x00007ffff76e2b80 in SDL_PumpEvents () from /usr/lib/libSDL-1.2.so.0
    #4 0x00007ffff76e3019 in SDL_PollEvent () from /usr/lib/libSDL-1.2.so.0
    #5 0x000000000042746d in get_input_from_keyboard (p_glwin=0x0, p_inp_ctx=0x9139c0, p_textures=0x7fffffffe410)
    at input.c:415
    #6 0x000000000040915a in game_loop (p_ich=0x7fffffffe370, p_opt_ctx=0x7fffffffc960, p_ptr_glwin=0x0,
    p_all_vehicles=0x9139c0, p_textures=0x7fffffffe410, p_terrain=0x7fffef2b9010, p_ctx=0x7fffffffdc80,
    p_render_ctx=0x7fffffffc9e0, p_light_pos=0x7fffffffe490, p_oppo=0x1343bb0, p_all_verts=0x7fffffff9780,
    p_env=0x7fffffff96b0) at loop.c:661
    #7 0x00000000004030a3 in spiel () at fac.c:257
    #8 0x0000000000403177 in main (argc=1, argv=0x7fffffffe678) at fac.c:312

    and I can't seem to find the reason. usually when I try to turn back, after 90DEG it will crash, this time it crashed instantly after the map finished loading (the loading screen was still visible), might be because I had gdb started to backtrace the segfault.

    Perhaps this is just configfile related (by the way, the fullscreen = 0 has no effect D: (please make windowed the default, games screw up my window size all the time in linux by resizing the screen..

    anyways, what was I talking about? Segfaults right.. Let me know if I can help by testing and so on, don't worry about taking your time, I get email notifications when new posts are made to this ticket. :)

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.