LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   wxPython 2.6.0.1 massive errors (https://www.linuxquestions.org/questions/linux-software-2/wxpython-2-6-0-1-massive-errors-329978/)

epheles 06-03-2005 12:24 PM

wxPython 2.6.0.1 massive errors
 
I'm trying to install pysoulseek and thus need to install wxPython. I first untar/uncompress the source, configure config.py, then use "python setup.py build" (which is essentially what their wiki says to do).. with this, I get a bunch of errors, much of which the terminal cuts off. Here's some of it.

Code:

src/helpers.cpp:1924: error: conflicting types for `int pyList'
src/helpers.cpp:1918: error: previous declaration as `PyObject*pyList'
src/helpers.cpp:1925: error: parse error before `while'
src/helpers.cpp:1927: error: ISO C++ forbids declaration of `pyObj' with no
  type
src/helpers.cpp:1927: error: conflicting types for `int pyObj'
src/helpers.cpp:1919: error: previous declaration as `PyObject*pyObj'
src/helpers.cpp:1927: error: `wxObj' was not declared in this scope
src/helpers.cpp:1928: error: ISO C++ forbids declaration of `PyList_Append'
  with no type
src/helpers.cpp:1928: error: `int PyList_Append' redeclared as different kind
  of symbol
/usr/include/python2.4/listobject.h:51: error: previous declaration of `int
  PyList_Append(PyObject*, PyObject*)'
src/helpers.cpp:1928: error: initializer list being treated as compound
  expression
src/helpers.cpp:1929: error: ISO C++ forbids declaration of `node' with no type
src/helpers.cpp:1929: error: base operand of `->' is not a pointer
src/helpers.cpp:1930: error: parse error before `}' token
src/helpers.cpp:1931: error: ISO C++ forbids declaration of `
  wxPyEndBlockThreads' with no type
src/helpers.cpp:1931: error: redefinition of `int wxPyEndBlockThreads'
src/helpers.cpp:1643: error: `int wxPyEndBlockThreads' previously declared here
src/helpers.cpp:1932: error: parse error before `return'
src/helpers.cpp:1937: error: `wxWindow' was not declared in this scope
src/helpers.cpp:1937: error: `win' was not declared in this scope
src/helpers.cpp:1937: error: redefinition of `long int wxPyGetWinHandle'
include/wx/wxPython/wxPython_int.h:131: error: `long int wxPyGetWinHandle'
  previously defined here
src/helpers.cpp:1937: error: syntax error before `{' token
src/helpers.cpp:1959: error: syntax error before `*' token
src/helpers.cpp:1984: error: parse error before `if'
src/helpers.cpp:1993: error: ISO C++ forbids declaration of `
  PyString_AsStringAndSize' with no type
src/helpers.cpp:1993: error: `int PyString_AsStringAndSize' redeclared as
  different kind of symbol
/usr/include/python2.4/stringobject.h:177: error: previous declaration of `int
  PyString_AsStringAndSize(PyObject*, char**, int*)'
src/helpers.cpp:1993: error: initializer list being treated as compound
  expression
src/helpers.cpp:1993: error: invalid conversion from `int*' to `int'
src/helpers.cpp:1994: error: ISO C++ forbids declaration of `target' with no
  type
src/helpers.cpp:1994: error: parse error before `(' token
src/helpers.cpp:2005: error: parse error before `*' token
src/helpers.cpp:2026: error: redefinition of `PyObject*str'
src/helpers.cpp:1983: error: `PyObject*str' previously defined here
src/helpers.cpp:2027: error: parse error before `if'
src/helpers.cpp:2035: error: redefinition of `char*tmpPtr'
src/helpers.cpp:1992: error: `char*tmpPtr' previously declared here
src/helpers.cpp:2035: error: redefinition of `int tmpSize'
src/helpers.cpp:1992: error: `int tmpSize' previously declared here
src/helpers.cpp:2036: error: ISO C++ forbids declaration of `
  PyString_AsStringAndSize' with no type
src/helpers.cpp:2036: error: redefinition of `int PyString_AsStringAndSize'
src/helpers.cpp:1993: error: `int PyString_AsStringAndSize' previously defined
  here
src/helpers.cpp:2036: error: initializer list being treated as compound
  expression
src/helpers.cpp:2036: error: invalid conversion from `int*' to `int'
src/helpers.cpp:2037: error: ISO C++ forbids declaration of `target' with no
  type
src/helpers.cpp:2037: error: redefinition of `int target'
src/helpers.cpp:1994: error: `int target' previously declared here
src/helpers.cpp:2037: error: `wxString' was not declared in this scope
src/helpers.cpp:2039: error: parse error before `if'
src/helpers.cpp:2048: error: parse error before `&' token
src/helpers.cpp: In function `PyObject* wx2PyString(...)':
src/helpers.cpp:2054: error: `src' undeclared (first use this function)
src/helpers.cpp: At global scope:
src/helpers.cpp:2167: error: type specifier omitted for parameter `wxPoint'
src/helpers.cpp:2167: error: parse error before `*' token
src/helpers.cpp: In function `bool wxPointFromObjects(...)':
src/helpers.cpp:2168: error: `o1' undeclared (first use this function)
src/helpers.cpp:2168: error: `o2' undeclared (first use this function)
src/helpers.cpp:2169: error: `point' undeclared (first use this function)
src/helpers.cpp: At global scope:
src/helpers.cpp:2192: error: syntax error before `*' token
src/helpers.cpp:2196: error: syntax error before `*' token
src/helpers.cpp:2197: error: `PyObject*o1' used prior to declaration
src/helpers.cpp:2197: error: `PyObject*o2' used prior to declaration
src/helpers.cpp:2200: error: parse error before `if'
src/helpers.cpp:2205: error: ISO C++ forbids declaration of `count' with no
  type
src/helpers.cpp:2206: error: parse error before `if'
src/helpers.cpp:2210: error: ISO C++ forbids declaration of `temp' with no type
src/helpers.cpp:2210: error: parse error before `[' token
src/helpers.cpp:2215: error: parse error before `;' token
src/helpers.cpp:2215: error: syntax error before `++' token
src/helpers.cpp:2231: error: ISO C++ forbids declaration of `o2' with no type
src/helpers.cpp:2231: error: conflicting types for `int o2'
src/helpers.cpp:2197: error: previous declaration as `PyObject*o2'
src/helpers.cpp:2232: error: parse error before `if'
src/helpers.cpp:2241: error: `x' was not declared in this scope
src/helpers.cpp:2241: error: ISO C++ forbids declaration of `temp' with no type
src/helpers.cpp:2241: error: `pt' was not declared in this scope
src/helpers.cpp:2241: error: assignment (not initialization) in declaration
src/helpers.cpp:2242: error: parse error before `}' token
src/helpers.cpp:2245: error: ISO C++ forbids declaration of `o2' with no type
src/helpers.cpp:2245: error: redefinition of `int o2'
src/helpers.cpp:2231: error: `int o2' previously defined here
src/helpers.cpp:2245: error: invalid conversion from `PyObject*' to `int'
src/helpers.cpp:2246: error: parse error before `if'
src/helpers.cpp:2261: error: syntax error before `:' token
src/helpers.cpp:2264: error: syntax error before `:' token
src/helpers.cpp:2267: error: syntax error before `:' token
src/helpers.cpp:2269: error: syntax error before `:' token
src/helpers.cpp:2277: error: syntax error before `*' token
src/helpers.cpp:2282: error: conflicting types for `int count'
src/helpers.cpp:2205: error: previous declaration as `int*count'
src/helpers.cpp:2283: error: syntax error before `*' token
src/helpers.cpp:2288: error: parse error before `;' token
src/helpers.cpp:2288: error: syntax error before `++' token
src/helpers.cpp:2296: error: `x' was not declared in this scope
src/helpers.cpp:2296: error: ISO C++ forbids declaration of `temp' with no type
src/helpers.cpp:2296: error: `pt' was not declared in this scope
src/helpers.cpp:2296: error: assignment (not initialization) in declaration
src/helpers.cpp:2297: error: parse error before `}' token
src/helpers.cpp:2308: error: syntax error before `*' token
src/helpers.cpp:2313: error: redefinition of `int count'
src/helpers.cpp:2282: error: `int count' previously defined here
src/helpers.cpp:2314: error: syntax error before `*' token
src/helpers.cpp:2319: error: parse error before `;' token
src/helpers.cpp:2319: error: syntax error before `++' token
src/helpers.cpp:2333: error: syntax error before `*' token
src/helpers.cpp:2334: error: `x' was not declared in this scope
src/helpers.cpp:2334: error: ISO C++ forbids declaration of `temp' with no type
src/helpers.cpp:2334: error: `pStr' was not declared in this scope
src/helpers.cpp:2334: error: assignment (not initialization) in declaration
src/helpers.cpp:2335: error: parse error before `delete'
src/helpers.cpp:2341: error: syntax error before `*' token
src/helpers.cpp:2346: error: redefinition of `int count'
src/helpers.cpp:2313: error: `int count' previously defined here
src/helpers.cpp:2347: error: syntax error before `*' token
src/helpers.cpp:2352: error: parse error before `;' token
src/helpers.cpp:2352: error: syntax error before `++' token
src/helpers.cpp:2360: error: `x' was not declared in this scope
src/helpers.cpp:2360: error: ISO C++ forbids declaration of `temp' with no type
src/helpers.cpp:2360: error: `ae' was not declared in this scope
src/helpers.cpp:2360: error: assignment (not initialization) in declaration
src/helpers.cpp:2361: error: parse error before `}' token
src/helpers.cpp:2364: error: conflicting types for `PyObject*o2'
src/helpers.cpp:2245: error: previous declaration as `int o2'
src/helpers.cpp:2366: error: `x' was not declared in this scope
src/helpers.cpp:2366: error: syntax error before `.' token
src/helpers.cpp:2377: error: syntax error before `*' token
src/helpers.cpp:2382: error: redefinition of `int count'
src/helpers.cpp:2346: error: `int count' previously defined here
src/helpers.cpp:2383: error: syntax error before `*' token
src/helpers.cpp:2388: error: parse error before `;' token
src/helpers.cpp:2388: error: syntax error before `++' token
src/helpers.cpp:2394: error: ISO C++ forbids declaration of `PyErr_SetString'
  with no type
src/helpers.cpp:2394: error: `int PyErr_SetString' redeclared as different kind
  of symbol
/usr/include/python2.4/pyerrors.h:12: error: previous declaration of `void
  PyErr_SetString(PyObject*, const char*)'
src/helpers.cpp:2394: error: initializer list being treated as compound
  expression
src/helpers.cpp:2394: error: invalid conversion from `const char*' to `int'
src/helpers.cpp:2395: error: parse error before `return'
src/helpers.cpp:2397: error: `x' was not declared in this scope
src/helpers.cpp:2397: error: ISO C++ forbids declaration of `temp' with no type
src/helpers.cpp:2397: error: `pt' was not declared in this scope
src/helpers.cpp:2397: error: assignment (not initialization) in declaration
src/helpers.cpp:2398: error: parse error before `}' token
src/helpers.cpp:2401: error: ISO C++ forbids declaration of `PyErr_SetString'
  with no type
src/helpers.cpp:2401: error: redefinition of `int PyErr_SetString'
src/helpers.cpp:2394: error: `int PyErr_SetString' previously defined here
src/helpers.cpp:2401: error: initializer list being treated as compound
  expression
src/helpers.cpp:2401: error: invalid conversion from `const char*' to `int'
src/helpers.cpp:2402: error: parse error before `return'
src/helpers.cpp:2473: error: parse error before `*' token
src/helpers.cpp: In function `bool wxPySimple_typecheck(...)':
src/helpers.cpp:2478: error: `classname' undeclared (first use this function)
src/helpers.cpp:2482: error: `seqLen' undeclared (first use this function)
src/helpers.cpp: At global scope:
src/helpers.cpp:2488: error: type specifier omitted for parameter `wxSize'
src/helpers.cpp:2488: error: parse error before `*' token
src/helpers.cpp: In function `bool wxSize_helper(...)':
src/helpers.cpp:2491: error: `obj' undeclared (first use this function)
src/helpers.cpp:2491: error: `wxSize' undeclared (first use this function)
src/helpers.cpp:2494: error: `wxT' undeclared (first use this function)
src/helpers.cpp: At global scope:
src/helpers.cpp:2498: error: type specifier omitted for parameter `wxPoint'
src/helpers.cpp:2498: error: parse error before `*' token
src/helpers.cpp: In function `bool wxPoint_helper(...)':
src/helpers.cpp:2501: error: `wxPoint' undeclared (first use this function)
src/helpers.cpp:2504: error: `wxT' undeclared (first use this function)
src/helpers.cpp: At global scope:
src/helpers.cpp:2509: error: type specifier omitted for parameter `wxRealPoint'
src/helpers.cpp:2509: error: parse error before `*' token
src/helpers.cpp: In function `bool wxRealPoint_helper(...)':
src/helpers.cpp:2512: error: `wxRealPoint' undeclared (first use this function)
src/helpers.cpp:2518: error: `ptr' undeclared (first use this function)
src/helpers.cpp:2519: error: `wxT' undeclared (first use this function)
src/helpers.cpp:2540: error: `PyErr_SetString' cannot be used as a function
src/helpers.cpp: At global scope:
src/helpers.cpp:2546: error: type specifier omitted for parameter `wxRect'
src/helpers.cpp:2546: error: parse error before `*' token
src/helpers.cpp: In function `bool wxRect_helper(...)':
src/helpers.cpp:2549: error: `wxRect' undeclared (first use this function)
src/helpers.cpp:2556: error: `wxT' undeclared (first use this function)
src/helpers.cpp:2585: error: `PyErr_SetString' cannot be used as a function
src/helpers.cpp: At global scope:
src/helpers.cpp:2591: error: type specifier omitted for parameter `wxColour'
src/helpers.cpp:2591: error: parse error before `*' token
src/helpers.cpp: In function `bool wxColour_helper(...)':
src/helpers.cpp:2601: error: `wxT' undeclared (first use this function)
src/helpers.cpp:2608: error: `wxString' undeclared (first use this function)
src/helpers.cpp:2608: error: parse error before `=' token
src/helpers.cpp:2609: error: `spec' undeclared (first use this function)
src/helpers.cpp:2616: error: `wxColour' undeclared (first use this function)
src/helpers.cpp:2644: error: `PyErr_SetString' cannot be used as a function
src/helpers.cpp: In function `bool wxColour_typecheck(PyObject*)':
src/helpers.cpp:2651: error: `wxT' undeclared (first use this function)
src/helpers.cpp: At global scope:
src/helpers.cpp:2662: error: type specifier omitted for parameter `wxPoint2D'
src/helpers.cpp:2662: error: parse error before `*' token
src/helpers.cpp: In function `bool wxPoint2D_helper(...)':
src/helpers.cpp:2665: error: `wxPoint2D' undeclared (first use this function)
src/helpers.cpp:2672: error: `wxT' undeclared (first use this function)
src/helpers.cpp:2693: error: `PyErr_SetString' cannot be used as a function
src/helpers.cpp: At global scope:
src/helpers.cpp:2700: error: parse error before `&' token
src/helpers.cpp: In function `PyObject* wxArrayString2PyList_helper(...)':
src/helpers.cpp:2703: error: `arr' undeclared (first use this function)
src/helpers.cpp:2709: error: `PyList_Append' cannot be used as a function
src/helpers.cpp: At global scope:
src/helpers.cpp:2716: error: parse error before `&' token
src/helpers.cpp: In function `PyObject* wxArrayInt2PyList_helper(...)':
src/helpers.cpp:2721: error: `PyList_Append' cannot be used as a function
error: command 'gcc' failed with exit status 1

Hopefully someone knows what's going on with this.. thanks.

foo_bar_foo 06-03-2005 12:56 PM

we generally need the very first line of error and a few after
the rest of it just follows from the first thing to go wrong

might be you need to install wxWidgets and it's developement files if you use binaries

epheles 06-03-2005 10:10 PM

Okay, I installed wxGTK/wxWidgets. Everything seemed to go fine. But I'm still getting errors with trying to build wxPython.

Here's the first few errors:

Code:

contrib/stc/gtk/stc_wrap.cpp:1384:24: wx/stc/stc.h: No such file or directory
contrib/stc/gtk/stc_wrap.cpp:1387: error: `wxSTCNameStr' was not declared in
  this scope
contrib/stc/gtk/stc_wrap.cpp: In function `PyObject*
  _wrap_new_StyledTextCtrl(PyObject*, PyObject*, PyObject*)':
contrib/stc/gtk/stc_wrap.cpp:1662: error: `wxStyledTextCtrl' undeclared (first
  use this function)
contrib/stc/gtk/stc_wrap.cpp:1662: error: (Each undeclared identifier is
  reported only once for each function it appears in.)
contrib/stc/gtk/stc_wrap.cpp:1662: error: `result' undeclared (first use this
  function)
contrib/stc/gtk/stc_wrap.cpp:1713: error: parse error before `)' token
contrib/stc/gtk/stc_wrap.cpp: In function `PyObject*
  _wrap_new_PreStyledTextCtrl(PyObject*, PyObject*, PyObject*)':
contrib/stc/gtk/stc_wrap.cpp:1744: error: parse error before `)' token

and so on..

uebergod 09-26-2005 12:40 PM

*bump*
 
i've got the same problem, been trying to figure it out for weeks now and i'm about to just give up
the whole reason i'm installing it is so that i can use some python IDE's and learn python, but if it's this much trouble i don't think i want to learn python, nothing should be this much of a headache, there're posts all over the place about this problem but noone seeme to know how to solve it
if anyone knows of anything that could help, that'd be cool, thanks

Kumo 09-28-2005 12:25 PM

Yeah,I encountered the same problem just now. Really crazy, that there is no answer to this, besides that this seems to be an old problem, it looks like it's just a matter of "typing accidents", as it seems to me. Whatever, I didn't yet try using it, but now it compiles nicely.
To solve this problem (my way ^^), you'd have to open the $WXDIR/wxPython/contrib/stc/gtk/stc_wrap.cpp and got to line 1384. Since somehow the stc.h is expected in one of the default include paths it isn't included (it isn't even in /opt/wx/2.6/include ...). The only stc.h I could find is in $WXDIR/contrib/include/wx/stc/stc.h . So just change the line 1384 (since this time of writing. It should look like: #include <wx/stc/stc.h> ) to #include "../../../../contrib/include/wx/stc/stc.h" . Now it should compile, but again it doesn't link, since the needed objects aren't in place (which is, in my opinion, quite odd, since they're in $WXDIR/bld/lib [if you followed the BUILD.txt]) so just copy them to /opt/wx/2.6/lib (just go into $WXDIR/bld/lib and do cp *stc* /opt/wx/2.6/lib ) and then everything should compile fine.
Hope that helps.

hellbourne 10-29-2005 06:39 AM

Still having problems
 
I did all you wrote but still got yet another error message:

"cannot find -lwx_gtk2_stc-2.6"

Do you have any idea how to resolve this issue?

Thanks,

Amit.

Kumo 10-30-2005 12:38 PM

Well, first look if it's (it = libwx_gtk2_stc-2.6.so) in /opt/wx/2.6/lib , or even somewhere else. If not you probably forgot to copy those libs as written at the end of my instruction ("cp *std* /opt/wx/2.6/lib" in $WXDIR/bld/lib). Though I suppose the directory for the libs is taken from the config, you could also add it to your LD_LIBRARY_PATH : "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/wx/2.6/lib" .

hellbourne 11-01-2005 12:31 PM

Quote:

Originally posted by Kumo
Well, first look if it's (it = libwx_gtk2_stc-2.6.so) in /opt/wx/2.6/lib , or even somewhere else. If not you probably forgot to copy those libs as written at the end of my instruction ("cp *std* /opt/wx/2.6/lib" in $WXDIR/bld/lib). Though I suppose the directory for the libs is taken from the config, you could also add it to your LD_LIBRARY_PATH : "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/wx/2.6/lib" .
I indeed looked in /opt/wx/2.6/lib but apparently the appropriate filename has an additional "d" in it, i.e. libwx_gtk2d_stc-2.6.so, so obviously that's why python doesn't find it. Where do I change the appropriate script?

Thanks,

Amit.

Kumo 11-01-2005 12:59 PM

Quote:

Originally posted by hellbourne
I indeed looked in /opt/wx/2.6/lib but apparently the appropriate filename has an additional "d" in it, i.e. libwx_gtk2d_stc-2.6.so, so obviously that's why python doesn't find it. Where do I change the appropriate script?

Thanks,

Amit.

Crazy, mine's got a "u" ;). Whatever, I wouldn't suggest changing the source, although I already instructed you to do so :P. I'd recommend doing :
"su" (if you aren't already root, and don't have the privileges to write into: )
"cd /opt/wx/2.6/lib"
"ln -s libwx_gtk2d_stc-2.6.so libwx_gtk2_stc-2.6.so" (should create a symlink to the "correct" file)

If the "d" was the problem, this should solve it....

hellbourne 11-03-2005 03:24 PM

Quote:

Originally posted by Kumo
Crazy, mine's got a "u" ;). Whatever, I wouldn't suggest changing the source, although I already instructed you to do so :P. I'd recommend doing :
"su" (if you aren't already root, and don't have the privileges to write into: )
"cd /opt/wx/2.6/lib"
"ln -s libwx_gtk2d_stc-2.6.so libwx_gtk2_stc-2.6.so" (should create a symlink to the "correct" file)

If the "d" was the problem, this should solve it....

OK, so it's not the problem. The complete error message (line) is:
/usr/lib/gcc/i586-suse-linux/4.0.2/../../../../i586-suse-linux/bin/ld: cannot find -lwx_gtk2_stc-2.6

Hope this helps you to help me,

Amit.

Kumo 11-05-2005 03:40 AM

Umm, well, this error message suggests two things (as I already mentioned beforehand):
1.) the libwx_gtk2_stc-2.6.so is really non-existing, or
2.) the directory of this file isn't in LD_LIBRARY_PATH

So, now that you created the link, the libwx_gtk2_stc-2.6.so should reside in /opt/wx/2.6/lib, no?
You first do "echo $LD_LIBRARY_PATH" and search for the directory, if you can't find it, do "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/opt/wx/2.6/lib" (without the quotationmarks, of course ;) ).
(without closing the terminal after that, you, hopefully, should be able to compile fine, otherwise I'm running out of Ideas....)

skip_g33k 03-31-2006 04:40 PM

Fixed
 
I just ran into the same thing while trying to build wxPython 2.6.3.0 from source. In the wxPython directory I tried running setup.py build install and got this error (it was the first at the top of about 5000 lines of errors).

Code:

contrib/stc/gtk/stc_wrap.cpp:1384:24: wx/stc/stc.h: No such file or directory
Fortunately, I found the answer.

When I got stuck, I did a search and ran into someone who mentioned a Build.txt document. I went hunting and found the file
Code:

wxPython-src-2.6.3.0/wxPython/docs/BUILD.html
In there, after the configure step, he talks about make and the need to make not only the wxPython stuff but also the other things in contrib. Here is a quote:

Quote:

To build and install wxWidgets you could just use the "make" command but there are other libraries besides the main wxWidgets libs that also need to be built so again I make a script to do it all for me so I don't forget anything. This time it is called ".make" (I use the leading "." so when I do rm -r * in my build dir I don't lose my scripts too.) This is what it looks like:

make $* \
&& make -C contrib/src/animate $* \
&& make -C contrib/src/gizmos $* \
&& make -C contrib/src/stc $*
As you can see, he builds the stc and then (by virtue of passing the arguments to his script using $*), when he installs, he also installs stc.

After doing this './.make install', my command to build wxPython worked:

/opt/python-2.4/bin/python setup.py \
WX_CONFIG=/opt/python-2.4/wxPython/bin/wx-config \
build install

I hope this helps someone who runs into this problem.


All times are GMT -5. The time now is 07:28 AM.