Linux Format forums Forum Index Linux Format forums
Help, discussion, magazine feedback and more
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

G++ compile errors

 
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming
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

PostPosted: Wed Jun 28, 2006 11:46 pm    Post subject: G++ compile errors Reply with quote

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
View user's profile Send private message
Nigel
LXF regular


Joined: Fri Apr 08, 2005 9:03 pm
Posts: 1141
Location: Gloucestershire, UK

PostPosted: Wed Jun 28, 2006 11:59 pm    Post subject: RE: G++ compile errors Reply with quote

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
View user's profile Send private message
jjmac
LXF regular


Joined: Fri Apr 08, 2005 2:32 am
Posts: 1996
Location: Sydney, Australia

PostPosted: Thu Jun 29, 2006 12:49 am    Post subject: RE: G++ compile errors Reply with quote

/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
View user's profile Send private message
wiz
LXF regular


Joined: Thu Apr 07, 2005 7:20 pm
Posts: 119
Location: In front of a computer

PostPosted: Thu Jun 29, 2006 7:28 am    Post subject: Reply with quote

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 Sad
Back to top
View user's profile Send private message
wiz
LXF regular


Joined: Thu Apr 07, 2005 7:20 pm
Posts: 119
Location: In front of a computer

PostPosted: Thu Jun 29, 2006 8:57 pm    Post subject: Reply with quote

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
View user's profile Send private message
jjmac
LXF regular


Joined: Fri Apr 08, 2005 2:32 am
Posts: 1996
Location: Sydney, Australia

PostPosted: Mon Jul 03, 2006 10:12 am    Post subject: Reply with quote

>>
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 Smile.

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
View user's profile Send private message
wiz
LXF regular


Joined: Thu Apr 07, 2005 7:20 pm
Posts: 119
Location: In front of a computer

PostPosted: Mon Jul 03, 2006 1:58 pm    Post subject: Reply with quote

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 user's profile Send private message
View previous topic :: View next topic  
Display posts from previous:   
Post new topic   Reply to topic    Linux Format forums Forum Index -> Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
Linux Format forums topic RSS feed 


Powered by phpBB © 2001, 2005 phpBB Group


Copyright 2011 Future Publishing, all rights reserved.


Web hosting by UKFast