| View previous topic :: View next topic |
| Author |
Message |
wiz LXF regular
Joined: Thu Apr 07, 2005 7:20 pm Posts: 119 Location: In front of a computer
|
Posted: Wed Jun 28, 2006 11:46 pm Post subject: G++ compile errors |
|
|
I am trying to compile some code and I keep getting errors that look like compiler or library version problems.
| Code: |
from imgstream.cc:31:
/usr/include/c++/3.4/cstddef:52: error: expected unqualified-id before "long"
/usr/include/c++/3.4/cstddef:52: error: expected `;' before "long"
In file included from /usr/include/c++/3.4/bits/stl_algobase.h:67,
from /usr/include/c++/3.4/bits/char_traits.h:46,
from /usr/include/c++/3.4/ios:46,
from /usr/include/c++/3.4/ostream:45,
from /usr/include/c++/3.4/iostream:45,
from imgstream.hh:40,
from imgstream.cc:31:
/usr/include/c++/3.4/cstdlib:103: error: `::malloc' has not been declared
/usr/include/c++/3.4/cstdlib:111: error: `::realloc' has not been declared
|
Can anybody give me a clue to what may be wrong?
The same problem occurs with g++ 3.3, 3.4 & 4.0 |
|
| Back to top |
|
 |
Nigel LXF regular

Joined: Fri Apr 08, 2005 9:03 pm Posts: 1141 Location: Gloucestershire, UK
|
Posted: Wed Jun 28, 2006 11:59 pm Post subject: RE: G++ compile errors |
|
|
What is line 52 of cstddef ?
Also, what are the lines just before line 40 of imgstream.hh and line 31 of imgstream.cc ? |
|
| Back to top |
|
 |
jjmac LXF regular
Joined: Fri Apr 08, 2005 2:32 am Posts: 1996 Location: Sydney, Australia
|
Posted: Thu Jun 29, 2006 12:49 am Post subject: RE: G++ compile errors |
|
|
/usr/include/c++/3.4/cstddef
| Code: |
#ifndef _GLIBCXX_CSTDDEF
#define _GLIBCXX_CSTDDEF 1
#pragma GCC system_header
#include <stddef.h>
namespace std
{
using ::ptrdiff_t; <-------------- line 52.
using ::size_t;
}
|
stdlib.h is included by 'cstdlib' ??
Maybe you just need to add "using namespace std" , without the quotes up the top of the file yur trying to pass.
jm _________________ http://counter.li.org
#313537
The FVWM wm -=- www.fvwm.org -=-
Somebody stole my air guitar, It happened just the other day,
But it's ok, 'cause i've got a spare ... |
|
| Back to top |
|
 |
wiz LXF regular
Joined: Thu Apr 07, 2005 7:20 pm Posts: 119 Location: In front of a computer
|
Posted: Thu Jun 29, 2006 7:28 am Post subject: |
|
|
The code I am trying to compile was written by Epson for a scanner driver so I am certain that the syntax is correct, I have not changed it at all.
The compiler is finding errors in the C++ library code from #include statements in the Epson code
I will post a few more details later. I'm off to work  |
|
| Back to top |
|
 |
wiz LXF regular
Joined: Thu Apr 07, 2005 7:20 pm Posts: 119 Location: In front of a computer
|
Posted: Thu Jun 29, 2006 8:57 pm Post subject: |
|
|
Found a whole load of gobbledegook about it at http://tinyurl.com/ndw32
It looks as though it just needs a bit more experimenting to figure out what is going on.
edit: The bit about compiling from source is down at the bottom of the page |
|
| Back to top |
|
 |
jjmac LXF regular
Joined: Fri Apr 08, 2005 2:32 am Posts: 1996 Location: Sydney, Australia
|
Posted: Mon Jul 03, 2006 10:12 am Post subject: |
|
|
>>
The code I am trying to compile was written by Epson for a scanner driver so I am certain that the syntax is correct, I have not changed it at all.
>>
Thats very trusting of you .
Unless "using namespce std;" is decleared at the top of a src file, any following types that are scoped/wrapped by that namespace will be unknown to the compiler. As "unknown" type messages were being generated, especially for something like ::malloc, i figured it would be worth checking on.
>>
The compiler is finding errors in the C++ library code from #include statements in the Epson code
>>
Just looking at that link briefly, and the nature of the patches, the errors are more likely being generated by the epson src. And yes, there is an abi change between 3.3.x and 3.4.x which probably is the root of the fails.
jm _________________ http://counter.li.org
#313537
The FVWM wm -=- www.fvwm.org -=-
Somebody stole my air guitar, It happened just the other day,
But it's ok, 'cause i've got a spare ... |
|
| Back to top |
|
 |
wiz LXF regular
Joined: Thu Apr 07, 2005 7:20 pm Posts: 119 Location: In front of a computer
|
Posted: Mon Jul 03, 2006 1:58 pm Post subject: |
|
|
Thanks. This was part of a rushed job so I couldn't afford to spend too much time on it.
I got the scanner working by using Xsane with a driver from the Windoze software disk, but Xsane takes almost 40! seconds to start.
I will get back to it when I have more time, I want to know what is wrong for future reference. |
|
| Back to top |
|
 |
| View previous topic :: View next topic |
|