LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 12-17-2009, 01:17 PM   #1
beboppinbobby
LQ Newbie
 
Registered: Oct 2009
Posts: 5

Rep: Reputation: 0
Problem compiling (error: ‘strcmp’ was not declared in this scope)


Here is my terminal log from the compile shell script:

================ Compiling MorphGen ===================
make: Entering directory `/home/#####/RML/Source/MorphGen'
g++ -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -MD -c -O3 -funroll-loops -fomit-frame-pointer -ftemplate-depth-35 MorphGen.cpp -o MorphGen.orst
In file included from ../LemmatizerLib/../MorphWizardLib/wizard.h:8,
from ../LemmatizerLib/StdMorph.h:12,
from MorphGen.cpp:7:
../LemmatizerLib/../MorphWizardLib/FormInfo.h: In member function ‘bool CLemmaInfo::operator==(const CLemmaInfo&) const’:
../LemmatizerLib/../MorphWizardLib/FormInfo.h:87: error: ‘strncmp’ was not declared in this scope
../LemmatizerLib/../MorphWizardLib/FormInfo.h: In member function ‘bool CLemmaInfo::operator<(const CLemmaInfo&) const’:
../LemmatizerLib/../MorphWizardLib/FormInfo.h:96: error: ‘strncmp’ was not declared in this scope
In file included from ../LemmatizerLib/MorphDictBuilder.h:9,
from MorphGen.cpp:10:
../LemmatizerLib/MorphDict.h: In member function ‘bool CMorphDict::IsLessMorphInterp::operator()(const CLemmaInfoAndLemma&, const char*) const’:
../LemmatizerLib/MorphDict.h:53: error: ‘strcmp’ was not declared in this scope
../LemmatizerLib/MorphDict.h: In member function ‘bool CMorphDict::IsLessMorphInterp::operator()(const char*, const CLemmaInfoAndLemma&) const’:
../LemmatizerLib/MorphDict.h:59: error: ‘strcmp’ was not declared in this scope
../LemmatizerLib/MorphDict.h: In member function ‘bool CMorphDict::IsLessMorphInterp::operator()(const CLemmaInfoAndLemma&, const CLemmaInfoAndLemma&) const’:
../LemmatizerLib/MorphDict.h:66: error: ‘strcmp’ was not declared in this scope
make: *** [MorphGen.orst] Error 1
make: Leaving directory `/home/#####/RML/Source/MorphGen'
======================
Error: cannot compile MorphGen


How do I get strcmp and strncmp included in this scope? Is the standard library not loading for some reason?

Thanks!
 
Old 12-17-2009, 01:29 PM   #2
gerardorn
LQ Newbie
 
Registered: Nov 2009
Location: México
Posts: 9

Rep: Reputation: 0
Quote:
../LemmatizerLib/../MorphWizardLib/FormInfo.h: In member function ‘bool CLemmaInfo:perator<(const CLemmaInfo&) const’:
../LemmatizerLib/../MorphWizardLib/FormInfo.h:96: error: ‘strncmp’ was not declared in this scope
should be strcmp not strncmp
 
Old 12-18-2009, 11:51 AM   #3
beboppinbobby
LQ Newbie
 
Registered: Oct 2009
Posts: 5

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by gerardorn View Post
should be strcmp not strncmp
I was searching online and it appears that both are standard functions in string.h.

But why isn't my compiler using them?

Last edited by beboppinbobby; 12-18-2009 at 07:28 PM. Reason: typo
 
Old 12-18-2009, 05:36 PM   #4
smeezekitty
Senior Member
 
Registered: Sep 2009
Location: Washington U.S.
Distribution: M$ Windows / Debian / Ubuntu / DSL / many others
Posts: 2,339

Rep: Reputation: 231Reputation: 231Reputation: 231
#include <string.h>
 
Old 12-19-2009, 01:33 AM   #5
evo2
LQ Guru
 
Registered: Jan 2009
Location: Japan
Distribution: Mostly Debian and CentOS
Posts: 6,726

Rep: Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706Reputation: 1706
Quote:
Originally Posted by smeezekitty View Post
#include <string.h>
Actaully since it is c++, not c it is better to use:

#include <cstring>

Evo2
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
aria2, ‘assert’ was not declared in this scope , compiler error adityasharma Linux - Newbie 4 07-31-2009 05:51 AM
Compiling tesseract-2.03: error: ‘INT32’ was not declared in this scope J_Szucs Linux - Software 10 03-05-2009 02:35 PM
Errors while compiling Faust: "PATH_MAX was not declared in this scope" prasadbrg Linux - Software 6 12-15-2008 01:04 AM
/ArgParser.cpp:207: error: 'atoi' was not declared in this scope Jane2008 Linux - Newbie 2 11-07-2008 09:23 AM
Error Prompt - 'Execute_command was not declared in this scope. Please help! thhuang Linux - Newbie 1 11-05-2007 12:38 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

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

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration