GIDForums  

Go Back   GIDForums > Computer Programming Forums > C++ Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 09-Jun-2009, 04:14
calvinlyp calvinlyp is offline
New Member
 
Join Date: Jun 2009
Posts: 8
calvinlyp is on a distinguished road

Error: ‘::setlocale’ has not been declared


hi all,

i am getting an error when installing a software.

Code:
source='zm.cpp' object='zm.o' libtool=no \ depfile='.deps/zm.Po' tmpdepfile='.deps/zm.TPo' \ depmode=gcc3 /bin/bash ../conftools/depcomp \ g++ -DHAVE_CONFIG_H -I. -I. -I.. -Wall -c -o zm.o `test -f 'zm.cpp' || echo './'`zm.cpp In file included from /usr/include/c++/4.3/clocale:48, from /usr/include/c++/4.3/i486-linux-gnu/bits/c++locale.h:47, from /usr/include/c++/4.3/bits/localefwd.h:47, from /usr/include/c++/4.3/string:50, from ./serial.h:60, from zm.cpp:39: /usr/include/locale.h:125: error: expected unqualified-id before ‘throw’ /usr/include/locale.h:125: error: expected initializer before ‘throw’ In file included from /usr/include/c++/4.3/i486-linux-gnu/bits/c++locale.h:47, from /usr/include/c++/4.3/bits/localefwd.h:47, from /usr/include/c++/4.3/string:50, from ./serial.h:60, from zm.cpp:39: /usr/include/c++/4.3/clocale:60: error: ‘::setlocale’ has not been declared In file included from zm.cpp:39:

is there anyway i can solve the problem for
Code:
"/usr/include/c++/4.3/clocale:60: error: ‘::setlocale’ has not been declared"

pls advise.
Attached Files
File Type: zip clocale.zip (1.3 KB, 0 views)
  #2  
Old 09-Jun-2009, 05:01
Mexican Bob's Avatar
Mexican Bob Mexican Bob is offline
Member
 
Join Date: Mar 2008
Location: Chicxulub, Yucatán
Posts: 226
Mexican Bob is a jewel in the roughMexican Bob is a jewel in the roughMexican Bob is a jewel in the rough

Re: error while installing


Did you run the configure application or is there some other kind of initialization required?

The only thing that I can GUESS from your post is that you're trying to build (not install) some kind of serial port control program and that "zm.cpp" is probably related to the zmodem protocol.

Maybe you should tell us WHICH SOFTWARE you are trying to install rather than zipping up a standard library header file that probably includes locale.h somewhere before line 60.

A little more information about your platform (assumed to be x86), operating system (assumed to be Windows) and development tools/environment (assumed to be GCC 4.3 using Cygwin or MinGw) would be a nice gesture, too.


MxB
  #3  
Old 09-Jun-2009, 05:11
calvinlyp calvinlyp is offline
New Member
 
Join Date: Jun 2009
Posts: 8
calvinlyp is on a distinguished road

Re: error while installing


Quote:
Originally Posted by Mexican Bob
Did you run the configure application or is there some other kind of initialization required?
yes i did run the configure but the error ocurs during sudo Make.


Quote:
Originally Posted by Mexican Bob
Maybe you should tell us WHICH SOFTWARE you are trying to install rather than zipping up a standard library header file that probably includes locale.h somewhere before line 60.

the software i am using is sharc. it can download from
http://sourceforge.net/projects/sharc/

Quote:
Originally Posted by Mexican Bob
A little more information about your platform (assumed to be x86), operating system (assumed to be Windows) and development tools/environment (assumed to be GCC 4.3 using Cygwin or MinGw) would be a nice gesture, too.
MxB

i am using xubuntu 8.10, GCC version is 4.3.
  #4  
Old 09-Jun-2009, 09:44
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,217
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: error while installing


Quote:
Originally Posted by calvinlyp
...i am using xubuntu 8.10, GCC version is 4.3.
OK. Let's start all over again. I'll show you what worked for me with Ubuntu 8.10 (32-bit version). Version of gcc/g++ is 4.3.2

Here's what I did. Note that I always capture the results of configure and make, since errors or significant warnings may occur many lines before the end (and, therefore would have scrolled off of the screen). By capturing the output I can inspect them at leisure.

  1. I downloaded sharc-1.00b3.tar.gz into a directory under my home directory

  2. I executed
    tar zxvf sharc-100b3.tar.gz

  3. I executed
    cd sharc-100b3

  4. I executed
    ./configure 2>& 1 | tee configure.log

    Piping it to "tee" means that you can see the lines as they are generated by configure, and after completion, you can view "configure.log" with a text editor to look for anomalies

  5. I executed
    ./make 2>& 1 | tee make.log

    After completion you can view "make.log"


    Anyhow...

    There was an error:

    Code:
    In file included from utils.cpp:40: ./socket.h:143: error: extra qualification ‘Socket::’ on member ‘_read’

  6. I edited src/socket.h

    I changed line 143 from this:
    CPP / C++ / C Code:
    		ssize_t Socket::_read(int d, void *buf, size_t nbytes, int flags);
    

    to this:
    CPP / C++ / C Code:
    		ssize_t _read(int d, void *buf, size_t nbytes, int flags);
    

  7. Then I reran the make command line.
    make 2>& 1 | tee make.log


    It ran to completion. The executable sharc was in the src directory.

    Here are a few lines from make.log (the lines concerning zm.cpp and the line immediately before and immediately after).

    Code:
    ./xmodem.h:137: warning: ‘cr3tab’ defined but not used source='zm.cpp' object='zm.o' libtool=no \ depfile='.deps/zm.Po' tmpdepfile='.deps/zm.TPo' \ depmode=gcc3 /bin/bash ../conftools/depcomp \ g++ -DHAVE_CONFIG_H -I. -I. -I.. -Wall -g -c -o zm.o `test -f 'zm.cpp' || echo './'`zm.cpp In file included from ./gpscommon.h:32, from zm.cpp:49: ./serial.h:80: warning: ‘typedef’ was ignored in this declaration

  8. I executed
    sudo make install 2>& 1 | tee install.log

  9. I tested the installation by entering
    cd
    sharc

    Here's what I saw
    Code:
    Creation Time: Tue Jun 9 14:30:42 2009 Sharc version 1.00b3 ------------------ Planned Operations ------------------ ----------------- Actual Operations -----------------

Bottom line: If you see anything that looks like errors (or significant warnings) in the configure.log or make.log files, try to resolve them. There are many warnings in make.log that can be safely ignored. If you see something that you don't understand, ask specific questions.


Regards,

Dave
Last edited by davekw7x : 09-Jun-2009 at 10:16.
  #5  
Old 09-Jun-2009, 10:02
calvinlyp calvinlyp is offline
New Member
 
Join Date: Jun 2009
Posts: 8
calvinlyp is on a distinguished road

Re: error while installing


actually i did all the points you did from 1-6.

however the cpp of some of the files of the sharc was being modified by my previous research colleague, and he left me without any documentation, thus i was to try to re-installed his version of sharc, which it appear to have the error as stated in my first post.

is there anyway i could do to try to remove the errors?

pls advise.thx.
  #6  
Old 09-Jun-2009, 10:13
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,217
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: error while installing


Quote:
Originally Posted by calvinlyp
actually i did all the points you did from 1-6.
My first point was downloading the latest source file from the site you gave in your previous post.

Quote:
Originally Posted by calvinlyp
however the cpp of some of the files of the sharc was being modified by my previous research colleague, and he left me without any documentation, thus i was to try to re-installed his version of sharc

Ummm---so you did not do all of the points that I did from 1-6.

Quote:
Originally Posted by calvinlyp
is there anyway i could do to try to remove the errors?
  1. Download fresh source from the site you gave in your previous post.

  2. Get it to compile. (Maybe do the rest of the points in my previous post.)

  3. Try to figure out what files were modified (and why).

  4. ???


Regards,

Dave
  #7  
Old 09-Jun-2009, 10:19
calvinlyp calvinlyp is offline
New Member
 
Join Date: Jun 2009
Posts: 8
calvinlyp is on a distinguished road

Re: error while installing


Quote:
Originally Posted by davekw7x
My first point was downloading from the site you gave in your previous post.



Ummm---so you did not do all of the points that I did from 1-6.

Download fresh source from the site you gave in your previous post


Regards,

Dave

i did the fresh download and did all your 9 steps correctly.
however, the online version does not work very well thus it was being modified.

therefore i am getting that error.

is there possible ways to detect which cpp file is generating below 3 errors:

/usr/include/locale.h:125: error: expected unqualified-id before ‘throw’
/usr/include/locale.h:125: error: expected initializer before ‘throw’
/usr/include/c++/4.3/clocale:60: error: ‘::setlocale’ has not been declared


your help will be greatly appreciated.
  #8  
Old 09-Jun-2009, 11:03
davekw7x davekw7x is offline
Outstanding Member
 
Join Date: Feb 2004
Location: Left Coast, USA
Posts: 5,217
davekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to beholddavekw7x is a splendid one to behold

Re: error while installing


Quote:
Originally Posted by calvinlyp
...
therefore i am getting that error.

is there possible ways to detect which cpp file is generating below 3 errors:
From your first post it starts with an error and shows the chain of include files that it went through to get back to the point where zm.cpp included serial.h. I would look at zm.cpp in the tainted distribution and compare it with the authentic source. I would do the same for serial.h.

Of couse I have no way of knowing what was changed or why.

One other point: The current version of sharc appears to have a date code of Mar 28, 2008. If your locally-tainted version came from an earlier distribution, there may be many other differences between your legacy code and the current authentic version that have nothing to do with local changes. There also may have been changes to configure or other stuff that generated Makefile and configuration parameters used in the build.

I hate to repeat myself, but I have no way of knowing...


Regards,

Dave
Last edited by davekw7x : 09-Jun-2009 at 12:27.
 
 

Recent GIDBlogAccepted for Ph.D. program by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
OS X Tiger 'make' problem. _Sensible FLTK Forum 1 16-Aug-2008 14:36
a significant problem after installing Xp mohammad Computer Software Forum - Windows 10 09-Aug-2005 08:03
Problems installing linux fedora core 3 kai85 Computer Software Forum - Linux 9 24-Mar-2005 16:58
[Linux] Installing PHP --with-mcrypt JdS Web Hosting Forum 0 20-Aug-2003 09:40

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 03:48.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.