|
From: Schedler, K. <Kur...@hi...> - 2001-02-22 14:45:18
|
I seem to be getting this error a lot when compiling example programs I find on the web: c:\my documents\src\cpp\simple\main.o(.text+0x162):main.cpp: undefined reference to `GetStockObject@4' Anyone have an idea what is wrong? This is the offending line of code: wndclass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH); And one other thing I wanted to ask about... when using the menu "wizard" in the resource editor, I added a "File" item and an "Exit" subitem under that. But when the app added the lines of code to my resource file, I ended up with "File", "File->Exit", and then an "Exit" on the main menu bar as well. Oops, one more thing (I promise this will be the last in this message!), when using Edit->Insert to add an if, while, or for loop template, the curly braces don't tab over to align with the code above. Have I not set up something properly, or am I asking for a new feature? Thanks, krs. "The sender believes that this E-mail and any attachments were free of any virus, worm, Trojan horse, and/or malicious code when sent. This message and its attachments could have been infected during transmission. By reading the message and opening any attachments, the recipient accepts full responsibility for taking protective and remedial action about viruses and other defects. The sender's employer is not liable for any loss or damage arising in any way from this message or its attachments." |
|
From: <pi...@we...> - 2002-07-05 11:33:01
|
Hello! When I try to compile and run a self-written program, there sometimes appears the following error-message from the compiler/linker:=20 [linker error] undefined reference to 'WinMain@16' Can somebody explain me the meaning of this message? Thank you! Andy |
|
From: Szathmary L. <sz...@de...> - 2003-04-08 20:26:12
|
Hi,
I'm quite new to Dev-C++, and I ran into a problem. I wanted to compile
this simple prg.:
#include <stdlib.h>
#include <tiffio.h>
#include <tiff.h>
int main(int argc, char *argv[])
{
TIFF* tif = TIFFOpen("foo.tif", "r");
// ... do stuff ...
TIFFClose(tif);
system("PAUSE");
return 0;
}
but I get the next error: undefined reference to TIFFOpen and to
TIFFClose. In the include directory I have tiff.h, tiffio.h and
tiffvers.h, in the lib dir. I have tiff.lib, and libtiff.a
What is wrong? In the options menu the lib and iclude directories are set
properly.
Thanks,
laszlo
|
|
From: Per W. <pw...@ia...> - 2003-04-08 20:42:00
|
It isn't enough that your lib directory contains the tiff libraries. You
also have to add them to the project.
The lib directory is where the linker will look for the libraries.
However, it won't start looking for a library unless the project
references the library.
Open project options, and on compiler options add the needed library.
/Per W
On Tue, 8 Apr 2003, Szathmary Laszlo wrote:
> Hi,
>
> I'm quite new to Dev-C++, and I ran into a problem. I wanted to compile
> this simple prg.:
>
> #include <stdlib.h>
> #include <tiffio.h>
> #include <tiff.h>
>
> int main(int argc, char *argv[])
> {
> TIFF* tif = TIFFOpen("foo.tif", "r");
> // ... do stuff ...
> TIFFClose(tif);
> system("PAUSE");
> return 0;
> }
>
> but I get the next error: undefined reference to TIFFOpen and to
> TIFFClose. In the include directory I have tiff.h, tiffio.h and
> tiffvers.h, in the lib dir. I have tiff.lib, and libtiff.a
> What is wrong? In the options menu the lib and iclude directories are set
> properly.
>
> Thanks,
>
> laszlo
>
>
>
>
> -------------------------------------------------------
> This SF.net email is sponsored by: ValueWeb:
> Dedicated Hosting for just $79/mo with 500 GB of bandwidth!
> No other company gives more support or power for your dedicated server
> http://click.atdmt.com/AFF/go/sdnxxaff00300020aff/direct/01/
> _______________________________________________
> 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: Szathmary L. <sz...@de...> - 2003-04-08 20:51:30
|
> Open project options, and on compiler options add the needed library. Hi, Thanks for the info, I didn't know that. I have two files in lib: tiff.lib and libtiff.a I tried to add tiff.lib as "../../DevCpp5/lib/tiff.lib", but when I want to run it, it says it cannot load libtiff.dll How can I fix it? Thanks, Laszlo |
|
From: Neszt T. <ne...@ss...> - 2003-04-09 06:50:30
|
Hello! > Thanks for the info, I didn't know that. I have two files in lib: tiff.lib > and libtiff.a > I tried to add tiff.lib as "../../DevCpp5/lib/tiff.lib", but when I want > to run it, it says it cannot load libtiff.dll > How can I fix it? When You have a lib*.a, you have to tell to the compiler, You want to use it. So in the "Project Options" / "Parameters" / "Linker" fill a new line: -l* In Your case: -ltiff Regards, Neszt Tibor p.s.: Remelem sikerul :-) |
|
From:
<HH....@TL...> - 2003-08-13 09:49:38
|
I'm using DEV-CC 4.9.8.0 My questions are: How can i find out, what "__gxx_personality_v0" is the alias for? There is no substring defining a variable or function or something else in that string. The original message is: [Linker error] undefined reference to `__gxx_personality_v0' I:\Sources\C\PARSER2\Makefile.win [Build Error] [DEVPAR.exe] Error 1 Are there sections "compiler-"& "link-messages" within the documentation? (Unfortunately(?) not found yet!) hh.rueger |
|
From: Per W. <pw...@ia...> - 2003-08-13 10:48:54
|
Did you compile as c++? Make sure that you link with -lstdc++ /Per W On Wed, 13 Aug 2003, "TLVermA R=FCger, Hans-Herbert" wrote: > I'm using DEV-CC 4.9.8.0 > My questions are: > How can i find out, what "__gxx_personality_v0" is the alias for? There = is > no substring defining a variable or function or something else in that > string. The original message is: > =09=09=09=09=09[Linker error] undefined reference > to `__gxx_personality_v0' > I:\Sources\C\PARSER2\Makefile.win=09[Build Error] [DEVPAR.exe] Error 1 > Are there sections "compiler-"& "link-messages" within the documentation? > (Unfortunately(?) not found yet!) > hh.rueger > > > > > > > > > ------------------------------------------------------- > This SF.Net email sponsored by: Free pre-built ASP.NET sites including > Data Reports, E-commerce, Portals, and Forums are available now. > Download today and enter to win an XBOX or Visual Studio .NET. > http://aspnet.click-url.com/go/psa00100003ave/direct;at.aspnet_072303_01/= 01 > _______________________________________________ > Dev-cpp-users mailing list > Dev...@li... > TO UNSUBSCRIBE: http://www23.brinkster.com/noicys/devcpp/ub.htm > https://lists.sourceforge.net/lists/listinfo/dev-cpp-users > |
|
From: <vi...@ya...> - 2003-11-12 19:59:45
|
Hi. I got this errors when try to compile a code with winsock2.h. I searched, but didn't find anything... can somebody help me? Thanks. C:\TEMP/ccsjaaaa.o(.text+0x416):cliente_TCP.cpp: undefined reference to `WSAStartup@8' C:\TEMP/ccsjaaaa.o(.text+0x437):cliente_TCP.cpp: undefined reference to `socket@12' C:\TEMP/ccsjaaaa.o(.text+0x454):cliente_TCP.cpp: undefined reference to `WSAGetLastError@0' C:\TEMP/ccsjaaaa.o(.text+0x49c):cliente_TCP.cpp: undefined reference to `htons@4' C:\TEMP/ccsjaaaa.o(.text+0x4b5):cliente_TCP.cpp: undefined reference to `inet_addr@4' C:\TEMP/ccsjaaaa.o(.text+0x4f4):cliente_TCP.cpp: undefined reference to `gethostbyname@4' C:\TEMP/ccsjaaaa.o(.text+0x596):cliente_TCP.cpp: undefined reference to `connect@12' C:\TEMP/ccsjaaaa.o(.text+0x5b3):cliente_TCP.cpp: undefined reference to `WSAGetLastError@0' C:\TEMP/ccsjaaaa.o(.text+0x608):cliente_TCP.cpp: undefined reference to `send@16' C:\TEMP/ccsjaaaa.o(.text+0x622):cliente_TCP.cpp: undefined reference to `WSAGetLastError@0' C:\TEMP/ccsjaaaa.o(.text+0x694):cliente_TCP.cpp: undefined reference to `recv@16' C:\TEMP/ccsjaaaa.o(.text+0x6ae):cliente_TCP.cpp: undefined reference to `WSAGetLastError@0' C:\TEMP/ccsjaaaa.o(.text+0x722):cliente_TCP.cpp: undefined reference to `closesocket@4' C:\TEMP/ccsjaaaa.o(.text+0x72a):cliente_TCP.cpp: undefined reference to `WSACleanup@0' ----- www3.solar.com.br/~mstelles Don't worry about life; you're not going to survive it anyway. --------------------------------- Yahoo! Mail - 6MB, anti-spam e antivírus gratuito. Crie sua conta agora! |
|
From: Vlada D. <dj...@im...> - 2003-11-13 07:27:32
|
You need to link winsock library. Go to Project>Project options>Linker = options and add a line like -lyourlib, where yourlib is the library you = need to link. For winsock, I think it should be ws2_32 (or maybe = wsock32). ----- Original Message -----=20 From: Marcelo Telles=20 To: dev...@li...=20 Sent: Wednesday, November 12, 2003 8:59 PM Subject: [Dev-C++] linker error Hi. I got this errors when try to compile a code with winsock2.h. I searched, but didn't find anything... can somebody help me? Thanks. C:\TEMP/ccsjaaaa.o(.text+0x416):cliente_TCP.cpp: undefined reference = to `WSAStartup@8' C:\TEMP/ccsjaaaa.o(.text+0x437):cliente_TCP.cpp: undefined reference = to `socket@12' C:\TEMP/ccsjaaaa.o(.text+0x454):cliente_TCP.cpp: undefined reference = to `WSAGetLastError@0' C:\TEMP/ccsjaaaa.o(.text+0x49c):cliente_TCP.cpp: undefined reference = to `htons@4' C:\TEMP/ccsjaaaa.o(.text+0x4b5):cliente_TCP.cpp: undefined reference = to `inet_addr@4' C:\TEMP/ccsjaaaa.o(.text+0x4f4):cliente_TCP.cpp: undefined reference = to `gethostbyname@4' C:\TEMP/ccsjaaaa.o(.text+0x596):cliente_TCP.cpp: undefined reference = to `connect@12' C:\TEMP/ccsjaaaa.o(.text+0x5b3):cliente_TCP.cpp: undefined reference = to `WSAGetLastError@0' C:\TEMP/ccsjaaaa.o(.text+0x608):cliente_TCP.cpp: undefined reference = to `send@16' C:\TEMP/ccsjaaaa.o(.text+0x622):cliente_TCP.cpp: undefined reference = to `WSAGetLastError@0' C:\TEMP/ccsjaaaa.o(.text+0x694):cliente_TCP.cpp: undefined reference = to `recv@16' C:\TEMP/ccsjaaaa.o(.text+0x6ae):cliente_TCP.cpp: undefined reference = to `WSAGetLastError@0' C:\TEMP/ccsjaaaa.o(.text+0x722):cliente_TCP.cpp: undefined reference = to `closesocket@4' C:\TEMP/ccsjaaaa.o(.text+0x72a):cliente_TCP.cpp: undefined reference = to `WSACleanup@0' ----- www3.solar.com.br/~mstelles Don't worry about life; you're not going to survive it anyway. -------------------------------------------------------------------------= ----- Yahoo! Mail - 6MB, anti-spam e antiv=EDrus gratuito. Crie sua conta = agora! |
|
From: Fred J. <ph...@ya...> - 2005-07-16 18:48:18
|
Hello
I have this linker error which makes me think that the
definition file is not being seen by the linker, this
code is taken from "Thinking in C++, 2nd Edition,
Volume 1, Annotated Solutions Guide"
Using Dev-C++ 4.9.9.2, The error is:
[Linker error] undefined reference to f(int)
all the following files are in the same dir.
thanks
//: S03:Prototypes.h
void f(int);
///:~
//: S03:Prototypes.cpp {O}
// Implements functions declared in Prototypes.h
#include <iostream>
using namespace std;
void f(int i) {
cout << "f(" << i << ") returning void\n";
}
///:~
//: S03:ProtoTest.cpp
//{L} Prototypes
#include <iostream>
#include "Prototypes.h"
int main() {
f(1);
getchar();
return 0;
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
|
|
From: Per W. <pw...@ia...> - 2005-07-16 19:21:16
|
You must make sure that the file Prototypes.cpp (strange file name by the
way since it doesn't contain function prototypes but actual
implementations...) has been added to the project. If not, the compiler
will not compile it (no Prototypes.o generated) and the linker will not
link it.
/Per W
On Sat, 16 Jul 2005, Fred J. wrote:
> Hello
> I have this linker error which makes me think that the
> definition file is not being seen by the linker, this
> code is taken from "Thinking in C++, 2nd Edition,
> Volume 1, Annotated Solutions Guide"
> Using Dev-C++ 4.9.9.2, The error is:
> [Linker error] undefined reference to =91f(int)=92
> all the following files are in the same dir.
>
> thanks
>
> //: S03:Prototypes.h
> void f(int);
> ///:~
>
> //: S03:Prototypes.cpp {O}
> // Implements functions declared in Prototypes.h
> #include <iostream>
> using namespace std;
>
> void f(int i) {
> cout << "f(" << i << ") returning void\n";
> }
> ///:~
>
> //: S03:ProtoTest.cpp
> //{L} Prototypes
> #include <iostream>
> #include "Prototypes.h"
>
> int main() {
> f(1);
>
> getchar();
> return 0;
> }
|