Menu ▾ ▴

#27 Mac install breaks

unread
nobody
None
5
2024-07-23
2024-07-16
Moosems
No
Moosems $ brew install fltk                        
Warning: fltk 1.3.9 is already installed and up-to-date.
To reinstall 1.3.9, run:
  brew reinstall fltk
Moosems $ pip3 install pyfltk --break-system-packages
Collecting pyfltk
  Using cached pyFltk-1.3.9.tar.gz (587 kB)
  Preparing metadata (setup.py) ... done
Building wheels for collected packages: pyfltk
  Building wheel for pyfltk (setup.py) ... error
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> [17 lines of output]
      Building for  Mac OS X
      i386 CPU variant detected
      ['./src', './contrib', '/usr/include']
      Checking FLTK configuration ...
      Checking fltk-config using FLTK_HOME
      Checking fltk-config using default installation
      Using FLTK:  ['1.3.9\n']
      fltk-config includes:  ['/usr/local/Cellar/fltk/1.3.9/include']
      fltk-config link paths:  ['/usr/local/Cellar/fltk/1.3.9/lib']
      fltk-config link libraries:  ['fltk_images', 'png', 'z', 'jpeg', 'fltk_gl', 'fltk_forms', 'fltk', 'pthread']
      FLTK was configured with multi-threading support!
      FLTK was configured with OpenGL support!
      FLTK was configured with Forms support!
      done
      clang: error: no such file or directory: './fltk/fltk_wrap.cpp'
      clang: error: no input files
      error: command '/usr/bin/clang' failed with exit code 1
      [end of output]

  note: This error originates from a subprocess, and is likely not a problem with pip.
  ERROR: Failed building wheel for pyfltk
  Running setup.py clean for pyfltk
Failed to build pyfltk
ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyfltk)

I installed fltk just moments before.

Related

Bugs: #27

Discussion

  • Robert Arkiletian

    On Mon, Jul 15, 2024 at 6:49 PM Moosems moosems@users.sourceforge.net wrote:


    [bugs:#27] Mac install breaks

    Status: unread
    Group:
    Created: Tue Jul 16, 2024 01:49 AM UTC by Moosems
    Last Updated: Tue Jul 16, 2024 01:49 AM UTC
    Owner: nobody

    Moosems $ brew install fltk
    Warning: fltk 1.3.9 is already installed and up-to-date.
    To reinstall 1.3.9, run:
    brew reinstall fltk
    Moosems $ pip3 install pyfltk --break-system-packages
    Collecting pyfltk
    Using cached pyFltk-1.3.9.tar.gz (587 kB)
    Preparing metadata (setup.py) ... done
    Building wheels for collected packages: pyfltk
    Building wheel for pyfltk (setup.py) ... error
    error: subprocess-exited-with-error

    × python setup.py bdist_wheel did not run successfully.
    │ exit code: 1
    ╰─> [17 lines of output]
    Building for Mac OS X
    i386 CPU variant detected
    ['./src', './contrib', '/usr/include']
    Checking FLTK configuration ...
    Checking fltk-config using FLTK_HOME
    Checking fltk-config using default installation
    Using FLTK: ['1.3.9\n']
    fltk-config includes: ['/usr/local/Cellar/fltk/1.3.9/include']
    fltk-config link paths: ['/usr/local/Cellar/fltk/1.3.9/lib']
    fltk-config link libraries: ['fltk_images', 'png', 'z', 'jpeg', 'fltk_gl', 'fltk_forms', 'fltk', 'pthread']
    FLTK was configured with multi-threading support!
    FLTK was configured with OpenGL support!
    FLTK was configured with Forms support!
    done
    clang: error: no such file or directory: './fltk/fltk_wrap.cpp'
    clang: error: no input files
    error: command '/usr/bin/clang' failed with exit code 1
    [end of output]

    note: This error originates from a subprocess, and is likely not a problem with pip.
    ERROR: Failed building wheel for pyfltk
    Running setup.py clean for pyfltk
    Failed to build pyfltk
    ERROR: ERROR: Failed to build installable wheels for some pyproject.toml based projects (pyfltk)

    I installed fltk just moments before.

    I think I know why this may have failed. If you look at the pypi
    download files here
    https://pypi.org/project/pyFltk/#files
    you will see that we only have a built package for Python 3.9 on arm64
    based macs. So issuing "pip3 install pyfltk" downloaded the source
    package instead since you probably have a different version of python.
    In this case, you will need to build it yourself from source or
    install python 3.9 with "brew install python@3.9". Here are the
    instructions to build it from source.

    brew install fltk
    brew install python-setuptools
    brew install swig
    pip3 install wheel
    Download the source from
    https://sourceforge.net/projects/pyfltk/files/pyfltk/pyFltk-1.3.9/pyFltk-1.3.9.tar.gz
    tar -xzf pyFltk-1.3.9.tar.gz
    cd pyFltk-1.3.9/
    python3 setup.py swig
    python3 setup.py build
    python3 setup.py bdist_wheel
    cd dist
    pip3 install pyFltk-1.3.9-.....whl

    Let me know if this works for you. When I am able to get my hands on a
    mac, then I will upload more pre-built packages.

     

    Related

    Bugs: #27

  • Moosems

    Moosems - 2024-07-22

    Unfortunately that did not work for me. I got the install, opened it up, and then build failed.

    Moosems $ python3 setup.py build
    
    Building for  Mac OS X
    i386 CPU variant detected
    ['./src', './contrib', '/usr/include']
    Checking FLTK configuration ... 
    Checking fltk-config using FLTK_HOME
    Checking fltk-config using default installation
    Using FLTK:  ['1.3.9\n']
    fltk-config includes:  ['/usr/local/Cellar/fltk/1.3.9/include']
    fltk-config link paths:  ['/usr/local/Cellar/fltk/1.3.9/lib']
    fltk-config link libraries:  ['fltk_images', 'png', 'z', 'jpeg', 'fltk_gl', 'fltk_forms', 'fltk', 'pthread']
    FLTK was configured with multi-threading support!
    FLTK was configured with OpenGL support!
    FLTK was configured with Forms support!
    done
    /usr/local/lib/python3.12/site-packages/setuptools/_distutils/dist.py:268: UserWarning: Unknown distribution option: 'include_package_data'
      warnings.warn(msg)
    ./fltk/fltk_wrap.cpp:5030:21: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
        char *directory=SWIG_Python_str_AsChar(dObj);
                        ^~~~~~~~~~~~~~~~~~~~~~
                        SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:5030:44: error: cannot initialize a parameter of type 'const char *' with an lvalue of type 'PyObject *' (aka '_object *')
        char *directory=SWIG_Python_str_AsChar(dObj);
                                               ^~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    ./fltk/fltk_wrap.cpp:6091:19: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
                    char* pyLabel = SWIG_Python_str_AsChar(lObj);
                                    ^~~~~~~~~~~~~~~~~~~~~~
                                    SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:6091:42: error: cannot initialize a parameter of type 'const char *' with an lvalue of type 'PyObject *' (aka '_object *')
                    char* pyLabel = SWIG_Python_str_AsChar(lObj);
                                                           ^~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    ./fltk/fltk_wrap.cpp:6243:13: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(count,i));
                       ^~~~~~~~~~~~~~~~~~~~~~
                       SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:6243:36: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'PyObject *' (aka '_object *')
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(count,i));
                                              ^~~~~~~~~~~~~~~~~~~~~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    ./fltk/fltk_wrap.cpp:6268:13: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(data,i));
                       ^~~~~~~~~~~~~~~~~~~~~~
                       SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:6268:36: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'PyObject *' (aka '_object *')
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(data,i));
                                              ^~~~~~~~~~~~~~~~~~~~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    ./fltk/fltk_wrap.cpp:6311:13: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(count,i));
                       ^~~~~~~~~~~~~~~~~~~~~~
                       SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:6311:36: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'PyObject *' (aka '_object *')
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(count,i));
                                              ^~~~~~~~~~~~~~~~~~~~~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    ./fltk/fltk_wrap.cpp:6336:13: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(data,i));
                       ^~~~~~~~~~~~~~~~~~~~~~
                       SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:6336:36: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'PyObject *' (aka '_object *')
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(data,i));
                                              ^~~~~~~~~~~~~~~~~~~~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    In file included from ./fltk/fltk_wrap.cpp:6445:
    /usr/local/Cellar/fltk/1.3.9/include/FL/gl.h:75:48: warning: 'glRecti' is deprecated: first deprecated in macOS 10.14 - OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings) [-Wdeprecated-declarations]
    inline void gl_rectf(int x,int y,int w,int h) {glRecti(x,y,x+w,y+h);}
                                                   ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl.h:2657:13: note: 'glRecti' has been explicitly marked deprecated here
    extern void glRecti (GLint x1, GLint y1, GLint x2, GLint y2) OPENGL_DEPRECATED(10.0, 10.14);
                ^
    ./fltk/fltk_wrap.cpp:6470:13: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(count,i));
                       ^~~~~~~~~~~~~~~~~~~~~~
                       SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:6470:36: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'PyObject *' (aka '_object *')
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(count,i));
                                              ^~~~~~~~~~~~~~~~~~~~~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    ./fltk/fltk_wrap.cpp:6495:13: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(data,i));
                       ^~~~~~~~~~~~~~~~~~~~~~
                       SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:6495:36: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'PyObject *' (aka '_object *')
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(data,i));
                                              ^~~~~~~~~~~~~~~~~~~~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    ./fltk/fltk_wrap.cpp:6533:5: warning: 'glDrawPixels' is deprecated: first deprecated in macOS 10.14 - OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings) [-Wdeprecated-declarations]
        glDrawPixels(self->w(), self->h(), GL_RGB, GL_UNSIGNED_BYTE, rgb);
        ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl.h:2467:13: note: 'glDrawPixels' has been explicitly marked deprecated here
    extern void glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) OPENGL_DEPRECATED(10.0, 10.14);
                ^
    ./fltk/fltk_wrap.cpp:6767:13: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(count,i));
                       ^~~~~~~~~~~~~~~~~~~~~~
                       SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:6767:36: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'PyObject *' (aka '_object *')
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(count,i));
                                              ^~~~~~~~~~~~~~~~~~~~~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    ./fltk/fltk_wrap.cpp:6792:13: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(data,i));
                       ^~~~~~~~~~~~~~~~~~~~~~
                       SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    2 warnings and 20 errors generated.
    error: command '/usr/bin/clang' failed with exit code 1
    
     
  • Andreas Held

    Andreas Held - 2024-07-23

    Do you have swig installed? To build from the source distribution you will need swig, once that is installed, please try:
    python3 setup.py swig build

    If this does not solve your problem, please show the swig version you are using and the output of:
    python3 setup.py swig

     
  • Moosems

    Moosems - 2024-07-23

    brew list shows swig as installed (I installed it as I followed your steps line by line so its the newest version as well). python3 setup.py swig build gives the following:

    Moosems $ cd pyFltk-1.3.9            
    Moosems $ python3 setup.py swig build
    Building for  Mac OS X
    i386 CPU variant detected
    ['./src', './contrib', '/usr/include']
    Checking FLTK configuration ... 
    Checking fltk-config using FLTK_HOME
    Checking fltk-config using default installation
    Using FLTK:  ['1.3.9\n']
    fltk-config includes:  ['/usr/local/Cellar/fltk/1.3.9/include']
    fltk-config link paths:  ['/usr/local/Cellar/fltk/1.3.9/lib']
    fltk-config link libraries:  ['fltk_images', 'png', 'z', 'jpeg', 'fltk_gl', 'fltk_forms', 'fltk', 'pthread']
    FLTK was configured with multi-threading support!
    FLTK was configured with OpenGL support!
    FLTK was configured with Forms support!
    done
    /usr/local/lib/python3.12/site-packages/setuptools/_distutils/dist.py:268: UserWarning: Unknown distribution option: 'include_package_data'
      warnings.warn(msg)
    Using default location for FLTK!
    ./fltk/fltk_wrap.cpp:5030:21: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
        char *directory=SWIG_Python_str_AsChar(dObj);
                        ^~~~~~~~~~~~~~~~~~~~~~
                        SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:5030:44: error: cannot initialize a parameter of type 'const char *' with an lvalue of type 'PyObject *' (aka '_object *')
        char *directory=SWIG_Python_str_AsChar(dObj);
                                               ^~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    ./fltk/fltk_wrap.cpp:6091:19: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
                    char* pyLabel = SWIG_Python_str_AsChar(lObj);
                                    ^~~~~~~~~~~~~~~~~~~~~~
                                    SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:6091:42: error: cannot initialize a parameter of type 'const char *' with an lvalue of type 'PyObject *' (aka '_object *')
                    char* pyLabel = SWIG_Python_str_AsChar(lObj);
                                                           ^~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    ./fltk/fltk_wrap.cpp:6243:13: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(count,i));
                       ^~~~~~~~~~~~~~~~~~~~~~
                       SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:6243:36: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'PyObject *' (aka '_object *')
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(count,i));
                                              ^~~~~~~~~~~~~~~~~~~~~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    ./fltk/fltk_wrap.cpp:6268:13: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(data,i));
                       ^~~~~~~~~~~~~~~~~~~~~~
                       SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:6268:36: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'PyObject *' (aka '_object *')
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(data,i));
                                              ^~~~~~~~~~~~~~~~~~~~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    ./fltk/fltk_wrap.cpp:6311:13: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(count,i));
                       ^~~~~~~~~~~~~~~~~~~~~~
                       SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:6311:36: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'PyObject *' (aka '_object *')
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(count,i));
                                              ^~~~~~~~~~~~~~~~~~~~~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    ./fltk/fltk_wrap.cpp:6336:13: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(data,i));
                       ^~~~~~~~~~~~~~~~~~~~~~
                       SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:6336:36: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'PyObject *' (aka '_object *')
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(data,i));
                                              ^~~~~~~~~~~~~~~~~~~~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    In file included from ./fltk/fltk_wrap.cpp:6445:
    /usr/local/Cellar/fltk/1.3.9/include/FL/gl.h:75:48: warning: 'glRecti' is deprecated: first deprecated in macOS 10.14 - OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings) [-Wdeprecated-declarations]
    inline void gl_rectf(int x,int y,int w,int h) {glRecti(x,y,x+w,y+h);}
                                                   ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl.h:2657:13: note: 'glRecti' has been explicitly marked deprecated here
    extern void glRecti (GLint x1, GLint y1, GLint x2, GLint y2) OPENGL_DEPRECATED(10.0, 10.14);
                ^
    ./fltk/fltk_wrap.cpp:6470:13: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(count,i));
                       ^~~~~~~~~~~~~~~~~~~~~~
                       SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:6470:36: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'PyObject *' (aka '_object *')
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(count,i));
                                              ^~~~~~~~~~~~~~~~~~~~~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    ./fltk/fltk_wrap.cpp:6495:13: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(data,i));
                       ^~~~~~~~~~~~~~~~~~~~~~
                       SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:6495:36: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'PyObject *' (aka '_object *')
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(data,i));
                                              ^~~~~~~~~~~~~~~~~~~~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    ./fltk/fltk_wrap.cpp:6533:5: warning: 'glDrawPixels' is deprecated: first deprecated in macOS 10.14 - OpenGL API deprecated. (Define GL_SILENCE_DEPRECATION to silence these warnings) [-Wdeprecated-declarations]
        glDrawPixels(self->w(), self->h(), GL_RGB, GL_UNSIGNED_BYTE, rgb);
        ^
    /Library/Developer/CommandLineTools/SDKs/MacOSX13.sdk/System/Library/Frameworks/OpenGL.framework/Headers/gl.h:2467:13: note: 'glDrawPixels' has been explicitly marked deprecated here
    extern void glDrawPixels (GLsizei width, GLsizei height, GLenum format, GLenum type, const GLvoid *pixels) OPENGL_DEPRECATED(10.0, 10.14);
                ^
    ./fltk/fltk_wrap.cpp:6767:13: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(count,i));
                       ^~~~~~~~~~~~~~~~~~~~~~
                       SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    ./fltk/fltk_wrap.cpp:6767:36: error: cannot initialize a parameter of type 'const char *' with an rvalue of type 'PyObject *' (aka '_object *')
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(count,i));
                                              ^~~~~~~~~~~~~~~~~~~~~~~
    ./fltk/fltk_wrap.cpp:862:38: note: passing argument to parameter 'c' here
    SWIG_Python_str_FromChar(const char *c)
                                         ^
    ./fltk/fltk_wrap.cpp:6792:13: error: use of undeclared identifier 'SWIG_Python_str_AsChar'; did you mean 'SWIG_Python_str_FromChar'?
              tmp[i] = SWIG_Python_str_AsChar(PyList_GetItem(data,i));
                       ^~~~~~~~~~~~~~~~~~~~~~
                       SWIG_Python_str_FromChar
    ./fltk/fltk_wrap.cpp:862:1: note: 'SWIG_Python_str_FromChar' declared here
    SWIG_Python_str_FromChar(const char *c)
    ^
    fatal error: too many errors emitted, stopping now [-ferror-limit=]
    2 warnings and 20 errors generated.
    error: command '/usr/bin/clang' failed with exit code 1
    

    Running python3 setup.py swig gives the following:

    Moosems $ python3 setup.py swig
    Building for  Mac OS X
    i386 CPU variant detected
    ['./src', './contrib', '/usr/include']
    Checking FLTK configuration ... 
    Checking fltk-config using FLTK_HOME
    Checking fltk-config using default installation
    Using FLTK:  ['1.3.9\n']
    fltk-config includes:  ['/usr/local/Cellar/fltk/1.3.9/include']
    fltk-config link paths:  ['/usr/local/Cellar/fltk/1.3.9/lib']
    fltk-config link libraries:  ['fltk_images', 'png', 'z', 'jpeg', 'fltk_gl', 'fltk_forms', 'fltk', 'pthread']
    FLTK was configured with multi-threading support!
    FLTK was configured with OpenGL support!
    FLTK was configured with Forms support!
    done
    /usr/local/lib/python3.12/site-packages/setuptools/_distutils/dist.py:268: UserWarning: Unknown distribution option: 'include_package_data'
      warnings.warn(msg)
    Using default location for FLTK!
    
     
  • Andreas Held

    Andreas Held - 2024-07-23

    Could you please show the output of:
    swig -version

     
  • Andreas Held

    Andreas Held - 2024-07-23

    Ok, I think I know what your problem is. It seems that the changes for swig V4.2 did not actually make it into the tarball of pyFltk1.3.9. Either you have to install swig V4.1 or older or you have to get the pyFltk sources from sf.net. Sorry about that, we will try to create a new tarball as son as possible, but this will definitely take a few days.

     

Log in to post a comment.