473,396 Members | 1,997 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Problem with C++ Compiling Error ld: Unresolved Error

Hi Everyone,

The problem that I have involves compiling two files. I've
received this error before and I understood that I was missing the
correct library. The error is as follows:

ld: Unresolved:
String::getline(std::basic_istream <char,
std::char_traits<char>&>, const &String String)

The code segment follows this structure:

#include <fstream>
#include "String.h"
#include <string>

function()
{
String val = "";
ifstream File;
int num_of_exits=0;

try
{
File.open(<path>, val);
while( ! File.eof())
{
//Searching for specific word
if( val.find("Exit") != string::npos)
num_of_exits++

//Searching for a word
getline(File, val)
}
}
catch(Exception& E)
{}
}
In my makefile, I have included the necessary libraries to compile. I
was able to confirm that the getline does exist with the nm
command. Is there any other reason why this would happen besides
not including the proper libraries or includes? Any ideas. Thanks.

Feb 12 '07 #1
2 1598
st********@gmail.com wrote in news:1171322316.597537.91260
@m58g2000cwm.googlegroups.com:
Hi Everyone,

The problem that I have involves compiling two files. I've
received this error before and I understood that I was missing the
correct library. The error is as follows:

ld: Unresolved:
String::getline(std::basic_istream <char,
std::char_traits<char>&>, const &String String)

The code segment follows this structure:

#include <fstream>
#include "String.h"
What's in this header file?
#include <string>

function()
Functions must have a return type.
{
String val = "";
We have no idea what a String is. std::string we know about (also note
that C++ is case-sensitive, in case you actually meant std::string)
ifstream File;
int num_of_exits=0;

try
{
File.open(<path>, val);
while( ! File.eof())
{
//Searching for specific word
if( val.find("Exit") != string::npos)
num_of_exits++

//Searching for a word
getline(File, val)
Which getline are you talking about? Is there one in the "String.h"
header file that we don't know about?
}
}
catch(Exception& E)
{}
}
In my makefile, I have included the necessary libraries to compile. I
was able to confirm that the getline does exist with the nm
command. Is there any other reason why this would happen besides
not including the proper libraries or includes? Any ideas. Thanks.
Post minimally, compiliable code next time to demonstrate your problem.
Many thinks may be concealed behind transcription errors.
I suspect your entire problem rests on that "String.h" is probably a
superfluous header file, not enough std:: qualifications, and C++ is
case-sensitive.
Feb 12 '07 #2
st********@gmail.com wrote:
Hi Everyone,

The problem that I have involves compiling two files. I've
received this error before and I understood that I was missing the
correct library. The error is as follows:
Please don't multi-post, it wastes everyone's time.

Stick to one group, or if you realy have to, cross-post.

--
Ian Collins.
Feb 13 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: tertius | last post by:
Hi All, I embedded some Python/C API functions in my C dll. I use the Borland freecommandline tools. I converted the python23.lib with coff2omf but still get unresolved externals. If I...
5
by: J | last post by:
Hi everyone, I started embedding python into a 3D graphics App and I came across this linking problem. SO.lib(ScnGlobal.obj) : error LNK2001: unresolved external symbol...
2
by: Connell Gauld | last post by:
Hi, I am having problems compiling a small project in VC++ 6. I have included the error below and the full project (including workspace) can be downloaded here:...
2
by: noe | last post by:
Hello, I have linked a '.c' file and I have obtained next fail: C:\prueba2\sfilter>build -cZ BUILD: Object root set to: ==> objchk BUILD: Adding /Y to COPYCMD so xcopy ops won't hang. BUILD:...
4
by: Aaron Queenan | last post by:
When I build a C++ library to .NET using the managed C++ compiler, I get the following error message: Linking... LINK : error LNK2020: unresolved token (0A000005) _CrtDbgReport LINK : error...
1
by: Sebastian Sosna | last post by:
Hello NG ! Iam developing in C# so my cpp knowledge is limited. Ive downloaded a C++ sample wich is doing some AD Job. U can get it here : http://support.microsoft.com/?id=302515 Ive tried...
1
by: Joannes Vermorel | last post by:
I am currently trying to port a small open source scientfic library written in C++ to .Net. The code (including the VS solution) could be found at http://www.vermorel.com/opensource/selfscaling.zip...
0
by: Usman | last post by:
Hi there I'm having problem compiling my code. I have a library along with its header file that I've used in my Com project. On compilation I get this linking error. Does anyone have any idea...
8
by: mickey22 | last post by:
Hi all, I am trying to compile a VC++ project and it is win32 console application.When I try to compile it I get a lot of linking problems.I have included all the header files needed for the...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.