Thread: [Dev-C++] unresolved external/linker error
Open Source C & C++ IDE for Windows
Brought to you by:
claplace
|
From: The Tone's. <to...@ds...> - 2002-09-16 18:13:42
|
hi, i'm _sure_ this is a noob question. I am a Java programmer by trade, haven't done 'C' in years. I am trying to develop some code for a personal project. I started a 'C' console project. using the GNU manual : http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_175.html#SEC184 I am trying to use the 'getline' function. i'm getting an 'undefined reference' error from the Linker (not the compiler). Do I need to tell the linker to use some lib that isn't setup by default ? Does this have something to do with 'C' vs. 'C++' ? TIA, Tony ===== |
|
From: PhrostByte <Phr...@so...> - 2002-09-17 03:45:06
|
Maybe your looking for gets() and fgets()? -----Original Message----- From: dev...@li... [mailto:dev...@li...] On Behalf Of The Tone'ster Sent: Monday, September 16, 2002 11:14 AM To: list dev-cpp-users Subject: [Dev-C++] unresolved external/linker error hi, i'm _sure_ this is a noob question. I am a Java programmer by trade, haven't done 'C' in years. I am trying to develop some code for a personal project. I started a 'C' console project. using the GNU manual : http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_175.html#SEC184 I am trying to use the 'getline' function. i'm getting an 'undefined reference' error from the Linker (not the compiler). Do I need to tell the linker to use some lib that isn't setup by default ? Does this have something to do with 'C' vs. 'C++' ? TIA, Tony ===== ------------------------------------------------------- This sf.net email is sponsored by:ThinkGeek Welcome to geek heaven. http://thinkgeek.com/sf _______________________________________________ Dev-cpp-users mailing list Dev...@li... TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm https://lists.sourceforge.net/lists/listinfo/dev-cpp-users |
|
From: Per W. <pw...@ia...> - 2002-09-17 06:33:53
|
Forget any mention of a gets() function. It should N.E.V.E.R. be used because of buffer overflow problems. /Per W On Mon, 16 Sep 2002, PhrostByte wrote: > Maybe your looking for gets() and fgets()? > > -----Original Message----- > From: dev...@li... > [mailto:dev...@li...] On Behalf Of The > Tone'ster > Sent: Monday, September 16, 2002 11:14 AM > To: list dev-cpp-users > Subject: [Dev-C++] unresolved external/linker error > > > > hi, > > i'm _sure_ this is a noob question. > > I am a Java programmer by trade, haven't done 'C' in years. > > I am trying to develop some code for a personal project. > > I started a 'C' console project. > > using the GNU manual : > > http://www.gnu.org/manual/glibc-2.2.3/html_node/libc_175.html#SEC184 > > I am trying to use the 'getline' function. > > i'm getting an 'undefined reference' error from the Linker (not the > compiler). > > Do I need to tell the linker to use some lib that isn't setup by default > ? > > Does this have something to do with 'C' vs. 'C++' ? > > TIA, > Tony > > ===== > > > > ------------------------------------------------------- > This sf.net email is sponsored by:ThinkGeek > Welcome to geek heaven. > http://thinkgeek.com/sf _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > ------------------------------------------------------- > Sponsored by: AMD - Your access to the experts on Hammer Technology! > Open Source & Linux Developers, register now for the AMD Developer > Symposium. Code: EX8664 http://www.developwithamd.com/developerlab > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: Carlos d. M. <cg...@wo...> - 2002-09-17 11:30:44
|
#include <iostream.h> |
|
From: The Tone's. <to...@ds...> - 2002-09-17 21:06:16
|
To recap : I was trying to use the "getline()" function in the GCC/GNU distro as included in Dev-Cpp v5 beta. I was getting an error from the linker. I looked into the <iostream.h>. This appears to be a C++ header. I am developing/compiling as 'C'. I tried it anyway. compile errors. to be expected. The GCC docs seem to imply that this is a <stdio.h> function that can be used from 'C' code ? ??? TIA, Tony --- Carlos García del Monte <cg...@wo...> wrote: > #include <iostream.h> ===== |
|
From: The Tone's. <to...@ds...> - 2002-09-18 02:41:52
|
uhh ... I think I get it now. These functions are actually part of the "GNU libc" ... not part of the GNU compiler suite and any runtime libs it contains ? so ... I would need to have this stuff, and it looks like the source is not portable to windows ? Tony --- The Tone'ster <to...@ds...> wrote: > > To recap : > > I was trying to use the "getline()" function in the GCC/GNU distro as > included > in Dev-Cpp v5 beta. > > I was getting an error from the linker. > > I looked into the <iostream.h>. > > This appears to be a C++ header. > > I am developing/compiling as 'C'. > > I tried it anyway. > > compile errors. to be expected. > > The GCC docs seem to imply that this is a <stdio.h> function that can be used > from 'C' code ? > > ??? > > TIA, > Tony > > --- Carlos García del Monte <cg...@wo...> wrote: > > #include <iostream.h> > > ===== > > > > ------------------------------------------------------- > This SF.NET email is sponsored by: AMD - Your access to the experts > on Hammer Technology! Open Source & Linux Developers, register now > for the AMD Developer Symposium. Code: EX8664 > http://www.developwithamd.com/developerlab > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users ===== |
|
From: Per W. <pw...@ia...> - 2002-09-18 07:05:08
|
You can still use fgets. It's just the gets that must not be used, since it doesn't take the size of the input buffer as a parameter. /Per W On Tue, 17 Sep 2002, The Tone'ster wrote: >=20 > uhh ... >=20 > I think I get it now. >=20 > These functions are actually part of the "GNU libc" ... not part of the G= NU > compiler suite and any runtime libs it contains ? >=20 > so ... I would need to have this stuff, and it looks like the source is n= ot > portable to windows ? >=20 > Tony >=20 > --- The Tone'ster <to...@ds...> wrote: > >=20 > > To recap : > >=20 > > I was trying to use the "getline()" function in the GCC/GNU distro as > > included > > in Dev-Cpp v5 beta. > >=20 > > I was getting an error from the linker. > >=20 > > I looked into the <iostream.h>. > >=20 > > This appears to be a C++ header. > >=20 > > I am developing/compiling as 'C'. > >=20 > > I tried it anyway. > >=20 > > compile errors. to be expected. > >=20 > > The GCC docs seem to imply that this is a <stdio.h> function that can b= e used > > from 'C' code ? > >=20 > > ??? > >=20 > > TIA, > > Tony > >=20 > > --- Carlos Garc=EDa del Monte <cg...@wo...> wrote: > > > #include <iostream.h> > >=20 > > =3D=3D=3D=3D=3D > >=20 > >=20 > >=20 > > ------------------------------------------------------- > > This SF.NET email is sponsored by: AMD - Your access to the experts > > on Hammer Technology! Open Source & Linux Developers, register now > > for the AMD Developer Symposium. Code: EX8664 > > http://www.developwithamd.com/developerlab > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >=20 >=20 > =3D=3D=3D=3D=3D >=20 >=20 >=20 > ------------------------------------------------------- > This SF.NET email is sponsored by: AMD - Your access to the experts > on Hammer Technology! Open Source & Linux Developers, register now > for the AMD Developer Symposium. Code: EX8664 > http://www.developwithamd.com/developerlab > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >=20 |
|
From: Carlos d. M. <cg...@wo...> - 2002-09-18 09:00:36
|
Oh, yes, iostream is C++, I should have notice it, stdio has no getline.
There are no C getline(), only C++, the one from iostream and the other w=
hich come
=66rom string and the other string classes. And get is either from iostre=
am.
You can make your own getline, overload it
void getline(char *buffer, int size){
char test =3D 'a';
for (int i =3D 0; i < size && test !=3D '\n'; i++){
buffer[i] =3D get();
test =3D buffer[i];
}
}
The Tone'ster escribi=F3:
> To recap :
>
> I was trying to use the "getline()" function in the GCC/GNU distro as i=
ncluded
> in Dev-Cpp v5 beta.
>
> I was getting an error from the linker.
>
> I looked into the <iostream.h>.
>
> This appears to be a C++ header.
>
> I am developing/compiling as 'C'.
>
> I tried it anyway.
>
> compile errors. to be expected.
>
> The GCC docs seem to imply that this is a <stdio.h> function that can b=
e used
> from 'C' code ?
>
> ???
>
> TIA,
> Tony
>
> --- Carlos Garc=EDa del Monte <cg...@wo...> wrote:
> > #include <iostream.h>
>
> =3D=3D=3D=3D=3D
>
> -------------------------------------------------------
> This SF.NET email is sponsored by: AMD - Your access to the experts
> on Hammer Technology! Open Source & Linux Developers, register now
> for the AMD Developer Symposium. Code: EX8664
> http://www.developwithamd.com/developerlab
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
|
|
From: Per W. <pw...@ia...> - 2002-09-18 11:10:59
|
Forst of all, I didn't know that overload existed in C.
Second. Why write a new getline with - almost - the same function as
the already existing fgets?
Third. The sample code never terminates the loaded buffer after it finds z
newline character, or runs out of buffer space.
/Per W
On Wed, 18 Sep 2002, Carlos Garc=EDa del Monte wrote:
> Oh, yes, iostream is C++, I should have notice it, stdio has no getline.
> There are no C getline(), only C++, the one from iostream and the other w=
hich come
> from string and the other string classes. And get is either from iostream=
=2E
>=20
> You can make your own getline, overload it
> void getline(char *buffer, int size){
> char test =3D 'a';
> for (int i =3D 0; i < size && test !=3D '\n'; i++){
> buffer[i] =3D get();
> test =3D buffer[i];
> }
> }
>=20
> The Tone'ster escribi=F3:
>=20
> > To recap :
> >
> > I was trying to use the "getline()" function in the GCC/GNU distro as i=
ncluded
> > in Dev-Cpp v5 beta.
> >
> > I was getting an error from the linker.
> >
> > I looked into the <iostream.h>.
> >
> > This appears to be a C++ header.
> >
> > I am developing/compiling as 'C'.
> >
> > I tried it anyway.
> >
> > compile errors. to be expected.
> >
> > The GCC docs seem to imply that this is a <stdio.h> function that can b=
e used
> > from 'C' code ?
> >
> > ???
> >
> > TIA,
> > Tony
> >
> > --- Carlos Garc=EDa del Monte <cg...@wo...> wrote:
> > > #include <iostream.h>
> >
> > =3D=3D=3D=3D=3D
> >
> > -------------------------------------------------------
> > This SF.NET email is sponsored by: AMD - Your access to the experts
> > on Hammer Technology! Open Source & Linux Developers, register now
> > for the AMD Developer Symposium. Code: EX8664
> > http://www.developwithamd.com/developerlab
> > _______________________________________________
> > Dev-cpp-users mailing list
> > Dev...@li...
> > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=20
>=20
>=20
> -------------------------------------------------------
> This SF.NET email is sponsored by: AMD - Your access to the experts
> on Hammer Technology! Open Source & Linux Developers, register now
> for the AMD Developer Symposium. Code: EX8664
> http://www.developwithamd.com/developerlab
> _______________________________________________
> Dev-cpp-users mailing list
> Dev...@li...
> TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
> https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
>=20
|
|
From: Carlos d. M. <cg...@wo...> - 2002-09-18 11:57:48
|
Per Westermark escribi=F3: > Forst of all, I didn't know that overload existed in C. Sorry, my english is not perfect, I got the "license" of saying overload,= I noticed it would be best not having it after sending. Er, today is my dumb day, it s= eems > > > Second. Why write a new getline with - almost - the same function as > the already existing fgets? I have the cpluplus reference, and by it and the name fgets is for workin= g for files (I should have add it) but I assumed the question was about stdin. > > > Third. The sample code never terminates the loaded buffer after it find= s z > newline character, or runs out of buffer space. Ouch! I had the feeling of forgetting something. buffer[size] =3D '\0'; It shouldn't run out of buffer, the parameter is given. (well, size =3D l= ast non \0 index +1) (I didn't test it) > > > I was trying to use the "getline()" function in the GCC/GNU distro = as included > > > in Dev-Cpp v5 beta. > > > > > > I was getting an error from the linker. > > > > > > I looked into the <iostream.h>. > > > > > > This appears to be a C++ header. > > > > > > I am developing/compiling as 'C'. > > > > > > I tried it anyway. > > > > > > compile errors. to be expected. > > > > > > The GCC docs seem to imply that this is a <stdio.h> function that c= an be used > > > from 'C' code ? > > > > > > ??? > > > > > > TIA, > > > Tony > > > > > > --- Carlos Garc=EDa del Monte <cg...@wo...> wrote: > > > > #include <iostream.h> > > > > > > =3D=3D=3D=3D=3D > > > > > > ------------------------------------------------------- > > > This SF.NET email is sponsored by: AMD - Your access to the experts > > > on Hammer Technology! Open Source & Linux Developers, register now > > > for the AMD Developer Symposium. Code: EX8664 > > > http://www.developwithamd.com/developerlab > > > _______________________________________________ > > > Dev-cpp-users mailing list > > > Dev...@li... > > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > ------------------------------------------------------- > > This SF.NET email is sponsored by: AMD - Your access to the experts > > on Hammer Technology! Open Source & Linux Developers, register now > > for the AMD Developer Symposium. Code: EX8664 > > http://www.developwithamd.com/developerlab > > _______________________________________________ > > Dev-cpp-users mailing list > > Dev...@li... > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > |
|
From: Abhijit S. <mu...@gm...> - 2002-09-18 16:46:08
|
> Second. Why write a new getline with - almost - the same function as > the already existing fgets? I have the cpluplus reference, and by it and the name fgets is for working for files (I should have add it) but I assumed the question was about stdin. stdin is also a file. The console is a file (named `con'), everything is a file. Hell, in Unix, Count Dracula is a file. ___________________________________________________________ Abhijit Shylanath E-mail: mu...@gm... || ibr...@bi... Web-site: http://mudeth.tripod.com/ |
|
From: Per W. <pw...@ia...> - 2002-09-19 02:08:20
|
Yes, fgets(buf,sizeof(buf),stdin) works ok to read from stdin. /Per W On Wed, 18 Sep 2002, Carlos Garc=EDa del Monte wrote: >=20 >=20 > Per Westermark escribi=F3: >=20 > > Forst of all, I didn't know that overload existed in C. >=20 > Sorry, my english is not perfect, I got the "license" of saying overload,= I noticed it > would be best not having it after sending. Er, today is my dumb day, it s= eems >=20 > > > > > > Second. Why write a new getline with - almost - the same function as > > the already existing fgets? >=20 > I have the cpluplus reference, and by it and the name fgets is for workin= g for files (I > should have add it) but I assumed the question was about stdin. >=20 > > > > > > Third. The sample code never terminates the loaded buffer after it find= s z > > newline character, or runs out of buffer space. >=20 > Ouch! I had the feeling of forgetting something. > buffer[size] =3D '\0'; > It shouldn't run out of buffer, the parameter is given. (well, size =3D l= ast non \0 index > +1) >=20 > (I didn't test it) >=20 > > > > I was trying to use the "getline()" function in the GCC/GNU distro = as included > > > > in Dev-Cpp v5 beta. > > > > > > > > I was getting an error from the linker. > > > > > > > > I looked into the <iostream.h>. > > > > > > > > This appears to be a C++ header. > > > > > > > > I am developing/compiling as 'C'. > > > > > > > > I tried it anyway. > > > > > > > > compile errors. to be expected. > > > > > > > > The GCC docs seem to imply that this is a <stdio.h> function that c= an be used > > > > from 'C' code ? > > > > > > > > ??? > > > > > > > > TIA, > > > > Tony > > > > > > > > --- Carlos Garc=EDa del Monte <cg...@wo...> wrote: > > > > > #include <iostream.h> > > > > > > > > =3D=3D=3D=3D=3D > > > > > > > > ------------------------------------------------------- > > > > This SF.NET email is sponsored by: AMD - Your access to the experts > > > > on Hammer Technology! Open Source & Linux Developers, register now > > > > for the AMD Developer Symposium. Code: EX8664 > > > > http://www.developwithamd.com/developerlab > > > > _______________________________________________ > > > > Dev-cpp-users mailing list > > > > Dev...@li... > > > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > > > > > > > > > > ------------------------------------------------------- > > > This SF.NET email is sponsored by: AMD - Your access to the experts > > > on Hammer Technology! Open Source & Linux Developers, register now > > > for the AMD Developer Symposium. Code: EX8664 > > > http://www.developwithamd.com/developerlab > > > _______________________________________________ > > > Dev-cpp-users mailing list > > > Dev...@li... > > > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > > > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > > > >=20 >=20 >=20 > ------------------------------------------------------- > This SF.NET email is sponsored by: AMD - Your access to the experts > on Hammer Technology! Open Source & Linux Developers, register now > for the AMD Developer Symposium. Code: EX8664 > http://www.developwithamd.com/developerlab > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users >=20 |
|
From: Ares L. <ge...@ns...> - 2002-10-18 06:55:44
|
QWxsLCANCldobyBjYW4gZ2l2ZSBtZSBhIGV4YW1wbGUgdGhhdCBob3cgdG8gY29tcGlsZSBhIEdO VSBwcm9qZWN0LCBzdWNoIGxpa2UgQXBhY2hlLCB3aGljaCBjYW4gYmUgY29tcGlsZWQgYm90aCB1 bmRlciBsaW51eCBieSB1c2luZyBnY2MgYW5kIHVuZGVyIHdpbmRvd3MgYnkgdXNpbmcgVkMuIEkg dHJpZWQgdG8gdXNlIERFVi1DUFAgY29tcGlsZSBBcGFjaGUgYnV0IGZhaWxlZC4NCi1BcmVz |
|
From: The Tone's. <to...@ds...> - 2002-09-17 14:42:29
|
yeah. this is what the doc for GCC said, thus my attempt to use the alternative getline(). somebody else suggested #include <iostream.h>. I'll try this. The GCC doc said that this function was part of <stdio.h>. Cheers, Tony --- Per Westermark <pw...@ia...> wrote: > Forget any mention of a gets() function. It should N.E.V.E.R. be used > because of buffer overflow problems. > > /Per W > > On Mon, 16 Sep 2002, PhrostByte wrote: > > > Maybe your looking for gets() and fgets()? > > ===== |
|
From: Ihsan A. Al D. <ia...@jo...> - 2002-10-18 12:24:33
|
> All, > Who can give me a example that how to compile a GNU project, such like Apache, which can be compiled both under linux by using gcc and under windows by using VC. I tried to use DEV-CPP compile Apache but failed. What is Apache ans where I can find it? Mohammed |
|
From: Zodiaq <zo...@ac...> - 2002-10-18 12:47:11
|
Hello Ihsan and all Dev-C++ users, Sunday, October 13, 2002, 11:05:30 AM, Ihsan wrote as follows: IAAD> What is Apache ans where I can find it? Apache is best httpd server... it is widely used around whole world! Over 60% (or even more, I don't remember stats) of all HTTP servers are running on Apache... and the homepage is (of course) www.apache.org IAAD> Mohammed -- regards, Zodiaq |