Coder Social home page Coder Social logo

Comments (10)

codebuk avatar codebuk commented on June 21, 2024

Hi,

On Fedora 20 with swig 2.0.11 I get similar errors. I have added and removed -builtin from swig-opts. Is there anything else I should try?

Dan

 bash-4.2$ python setup.py --verbose build
running build
running build_ext
building '_gphoto2_abilities_list' extension
swigging src/gphoto2/lib/gphoto2_abilities_list.i to src/gphoto2/lib/gphoto2_abilities_list_wrap.c
swig -python -nodefaultctor -O -Wextra -Werror -MMD -DGPHOTO2_25 -I/usr/include -o src/gphoto2/lib/gphoto2_abilities_list_wrap.c src/gphoto2/lib/gphoto2_abilities_list.i
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/src/gphoto2
creating build/temp.linux-x86_64-2.7/src/gphoto2/lib
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c src/gphoto2/lib/gphoto2_abilities_list_wrap.c -o build/temp.linux-x86_64-2.7/src/gphoto2/lib/gphoto2_abilities_list_wrap.o -O3 -Wno-unused-variable -Wno-strict-prototypes -Werror -DGPHOTO2_25
src/gphoto2/lib/gphoto2_abilities_list_wrap.c: In function ‘_wrap_CameraAbilitiesList___len__’:
src/gphoto2/lib/gphoto2_abilities_list_wrap.c:3398:5: error: implicit declaration of function ‘struct__CameraAbilitiesList___len__’ [-Werror=implicit-function-declaration]
     result = (int)struct__CameraAbilitiesList___len__(arg1);
     ^
src/gphoto2/lib/gphoto2_abilities_list_wrap.c: In function ‘_wrap_CameraAbilitiesList_count’:
src/gphoto2/lib/gphoto2_abilities_list_wrap.c:3694:5: error: implicit declaration of function ‘struct__CameraAbilitiesList_count’ [-Werror=implicit-function-declaration]
     result = (int)struct__CameraAbilitiesList_count(arg1);
     ^
src/gphoto2/lib/gphoto2_abilities_list_wrap.c: In function ‘_wrap_CameraAbilitiesList_lookup_model’:
src/gphoto2/lib/gphoto2_abilities_list_wrap.c:3733:5: error: implicit declaration of function ‘struct__CameraAbilitiesList_lookup_model’ [-Werror=implicit-function-declaration]
     result = (int)struct__CameraAbilitiesList_lookup_model(arg1,(char const *)arg2);
     ^
cc1: all warnings being treated as errors
error: command 'gcc' failed with exit status 1
bash-4.2$ python setup.py --verbose build
running build
running build_ext
building '_gphoto2_abilities_list' extension
swigging src/gphoto2/lib/gphoto2_abilities_list.i to src/gphoto2/lib/gphoto2_abilities_list_wrap.c
swig -python -nodefaultctor -O -Wextra -Werror -MMD -builtin -DGPHOTO2_25 -I/usr/include -o src/gphoto2/lib/gphoto2_abilities_list_wrap.c src/gphoto2/lib/gphoto2_abilities_list.i
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c src/gphoto2/lib/gphoto2_abilities_list_wrap.c -o build/temp.linux-x86_64-2.7/src/gphoto2/lib/gphoto2_abilities_list_wrap.o -O3 -Wno-unused-variable -Wno-strict-prototypes -Werror -DGPHOTO2_25
src/gphoto2/lib/gphoto2_abilities_list_wrap.c: In function ‘_wrap_CameraAbilitiesList___len__’:
src/gphoto2/lib/gphoto2_abilities_list_wrap.c:3913:5: error: implicit declaration of function ‘struct__CameraAbilitiesList___len__’ [-Werror=implicit-function-declaration]
     result = (int)struct__CameraAbilitiesList___len__(arg1);
     ^
src/gphoto2/lib/gphoto2_abilities_list_wrap.c: In function ‘_wrap_CameraAbilitiesList_count’:
src/gphoto2/lib/gphoto2_abilities_list_wrap.c:4214:5: error: implicit declaration of function ‘struct__CameraAbilitiesList_count’ [-Werror=implicit-function-declaration]
     result = (int)struct__CameraAbilitiesList_count(arg1);
     ^
src/gphoto2/lib/gphoto2_abilities_list_wrap.c: In function ‘_wrap_CameraAbilitiesList_lookup_model’:
src/gphoto2/lib/gphoto2_abilities_list_wrap.c:4254:5: error: implicit declaration of function ‘struct__CameraAbilitiesList_lookup_model’ [-Werror=implicit-function-declaration]
     result = (int)struct__CameraAbilitiesList_lookup_model(arg1,(char const *)arg2);
     ^
src/gphoto2/lib/gphoto2_abilities_list_wrap.c: At top level:
src/gphoto2/lib/gphoto2_abilities_list_wrap.c:5479:5: error: implicit declaration of function ‘offsetof’ [-Werror=implicit-function-declaration]
     (Py_ssize_t)offsetof(SwigPyObject, dict), /* tp_dictoffset */
     ^
src/gphoto2/lib/gphoto2_abilities_list_wrap.c:5479:26: error: expected expression before ‘SwigPyObject’
     (Py_ssize_t)offsetof(SwigPyObject, dict), /* tp_dictoffset */
                          ^
src/gphoto2/lib/gphoto2_abilities_list_wrap.c:5731:26: error: expected expression before ‘SwigPyObject’
     (Py_ssize_t)offsetof(SwigPyObject, dict), /* tp_dictoffset */
                          ^
cc1: all warnings being treated as errors
error: command 'gcc' failed with exit status 1
bash-4.2$ 

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on June 21, 2024

Are you using a version newer than commit 86f261e, and have you tried completely removing the build directory?

from python-gphoto2.

codebuk avatar codebuk commented on June 21, 2024

Jim,

Yes. Newer than 86f261e
86f261e
.

Have deleted build directory.

Dan

Cheers,

Dan Tyrrell
Data & Networks Techniek
m 0409 964694 e [email protected]
www.dnt.com.au

On 2 December 2014 at 19:23, Jim Easterbrook [email protected]
wrote:

Are you using a version newer than commit 86f261e
86f261e,
and have you tried completely removing the build directory?


Reply to this email directly or view it on GitHub
#4 (comment)
.

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on June 21, 2024

That's odd, as your log messages show the -builtin option being used.
Can you add some "print swig_version" statements to setup.py to try and work out what's going on.

from python-gphoto2.

codebuk avatar codebuk commented on June 21, 2024

Jim,

The log posted includes 2 attempts -a run without and then with -builtin. I manually edited setup.py.

Here it is set back to the original with 'print swig_version:

bash-4.2$ python setup.py --verbose build
2.0.11
running build
running build_ext
building '_gphoto2_abilities_list' extension
swigging src/gphoto2/lib/gphoto2_abilities_list.i to src/gphoto2/lib/gphoto2_abilities_list_wrap.c
swig -python -nodefaultctor -O -Wextra -Werror -MMD -DGPHOTO2_25 -I/usr/include -o src/gphoto2/lib/gphoto2_abilities_list_wrap.c src/gphoto2/lib/gphoto2_abilities_list.i
creating build
creating build/temp.linux-x86_64-2.7
creating build/temp.linux-x86_64-2.7/src
creating build/temp.linux-x86_64-2.7/src/gphoto2
creating build/temp.linux-x86_64-2.7/src/gphoto2/lib
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c src/gphoto2/lib/gphoto2_abilities_list_wrap.c -o build/temp.linux-x86_64-2.7/src/gphoto2/lib/gphoto2_abilities_list_wrap.o -O3 -Wno-unused-variable -Wno-strict-prototypes -Werror -DGPHOTO2_25
src/gphoto2/lib/gphoto2_abilities_list_wrap.c: In function ‘_wrap_CameraAbilitiesList___len__’:
src/gphoto2/lib/gphoto2_abilities_list_wrap.c:3398:5: error: implicit declaration of function ‘struct__CameraAbilitiesList___len__’ [-Werror=implicit-function-declaration]
     result = (int)struct__CameraAbilitiesList___len__(arg1);
     ^
src/gphoto2/lib/gphoto2_abilities_list_wrap.c: In function ‘_wrap_CameraAbilitiesList_count’:
src/gphoto2/lib/gphoto2_abilities_list_wrap.c:3694:5: error: implicit declaration of function ‘struct__CameraAbilitiesList_count’ [-Werror=implicit-function-declaration]
     result = (int)struct__CameraAbilitiesList_count(arg1);
     ^
src/gphoto2/lib/gphoto2_abilities_list_wrap.c: In function ‘_wrap_CameraAbilitiesList_lookup_model’:
src/gphoto2/lib/gphoto2_abilities_list_wrap.c:3733:5: error: implicit declaration of function ‘struct__CameraAbilitiesList_lookup_model’ [-Werror=implicit-function-declaration]
     result = (int)struct__CameraAbilitiesList_lookup_model(arg1,(char const *)arg2);
     ^
cc1: all warnings being treated as errors
error: command 'gcc' failed with exit status 1
bash-4.2$ 

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on June 21, 2024

Ah, now I see. It's not the "(Py_ssize_t)offsetof(SwigPyObject, dict)" error at all, but something else that doesn't go away when -builtin is used. I'll look into it.

from python-gphoto2.

codebuk avatar codebuk commented on June 21, 2024

Jim,

Many thanks. I can give you access to the system if it makes it any easier or if there is anything else I can do just yell out.

Dan

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on June 21, 2024

It looks as if the '-builtin' bug isn't the only thing that changed in SWIG 2.0.11 (I'm on 2.0.10).
Your missing functions such as struct__CameraAbilitiesList___len__ are called _CameraAbilitiesList___len__ in my version. I think it might be possible to add extra definitions in macros.i. Can you add int (*struct ## _ ## type ## _ ## member)() = function; immediately after line 143 in macros.i and try again.

from python-gphoto2.

codebuk avatar codebuk commented on June 21, 2024

Jim,

Much better but a similar error later on:

  building '_gphoto2_widget' extension
swigging src/gphoto2/lib/gphoto2_widget.i to src/gphoto2/lib/gphoto2_widget_wrap.c
swig -python -nodefaultctor -O -Wextra -Werror -MMD -DGPHOTO2_25 -I/usr/include -o src/gphoto2/lib/gphoto2_widget_wrap.c src/gphoto2/lib/gphoto2_widget.i
gcc -pthread -fno-strict-aliasing -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector-strong --param=ssp-buffer-size=4 -grecord-gcc-switches -m64 -mtune=generic -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.7 -c src/gphoto2/lib/gphoto2_widget_wrap.c -o build/temp.linux-x86_64-2.7/src/gphoto2/lib/gphoto2_widget_wrap.o -O3 -Wno-unused-variable -Wno-strict-prototypes -Werror -DGPHOTO2_25
src/gphoto2/lib/gphoto2_widget_wrap.c: In function ‘_wrap_CameraWidget_set_value’:
src/gphoto2/lib/gphoto2_widget_wrap.c:4135:3: error: implicit declaration of function ‘struct__CameraWidget_set_value’ [-Werror=implicit-function-declaration]
   result = (PyObject *)struct__CameraWidget_set_value(arg1,arg2);
   ^
src/gphoto2/lib/gphoto2_widget_wrap.c:4135:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   result = (PyObject *)struct__CameraWidget_set_value(arg1,arg2);
            ^
src/gphoto2/lib/gphoto2_widget_wrap.c: In function ‘_wrap_CameraWidget_get_value’:
src/gphoto2/lib/gphoto2_widget_wrap.c:4158:3: error: implicit declaration of function ‘struct__CameraWidget_get_value’ [-Werror=implicit-function-declaration]
   result = (PyObject *)struct__CameraWidget_get_value(arg1);
   ^
src/gphoto2/lib/gphoto2_widget_wrap.c:4158:12: error: cast to pointer from integer of different size [-Werror=int-to-pointer-cast]
   result = (PyObject *)struct__CameraWidget_get_value(arg1);
            ^
cc1: all warnings being treated as errors
error: command 'gcc' failed with exit status 1
bash-4.2$ 

from python-gphoto2.

jim-easterbrook avatar jim-easterbrook commented on June 21, 2024

Yup, same problem. My "hand crafted" helper functions need to match SWIG's naming scheme and it must have changed. Commit 667efe9 should do the right thing.

from python-gphoto2.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.