6.The EXE files created are huge. What can i do to reduce the size?
If you want to reduce your exe file size from 330 Ko to 12 Ko forexample, go to compiler options. Then click on the Linker pageand uncheck 'Generate debug information'. This willremove debugging information (if you want to debug, uncheck it).You can also click on Optimization page and check 'Bestoptimization'.

7.Under Windows NT, every time i launch Dev-C++ i get the message“Failed to set data for”
The is because you are not in Administrator mode, and Dev-C++tries to write to the registry. To get rid of the error message,log on as the Administrator, or uncheck the file associationoptions in Environment options, Misc. Sheet.

8.when I try to compile I get: ld: cannot open crt2. o: No suchfile or directory. What can i do ?
Go to Compiler options, and check if the Lib directory iscorrectly set to:
C:Dev-C++Lib
(for a default installation).

If this stilldoesn't work, try copying the file Libcrt2.o to your Dev-C++'sBin directory.

9.How can i use the OpenGL library and others ?
All the libraries that comes with Mingw reside in the Libdirectory. They are all named in the following way: lib*.a
To link a library with your project, just add in Project options,Further option files :
-lopengl32
This is for including the libopengl32.a library. To add any otherlibrary, just follow the same syntax:
Type -l (L in lowercase) plus the base name of the library(filename without 'lib' and the '.a'extension).

10.When i compile a file that contains references to Windowsfilename (like <Mydirmyfile.h>), i get a 'unrecognizedescape sequence' message ?

The Mingw compilerunderstands paths in the Unix style (/mydir/myfile.h). Tryreplacing the in the filename by /

11.Is there any GUI library or packages available for Dev-C++ ?

You can downloadextra packages for Dev-C++ at http://www.bloodshed.net/dev/

12.I am having problems using Borland specific functions such asclrscr()

Include conio.h toyour source, and add C:Dev-C++Libconio.o to 'FurtherObject Files' in Project Options (where C:Dev-C++ is whereyou installed Dev-C++)

13.The toolbars icons are showing incorrectly.

On some screenresolutions, toolbars icons may show up incorrectly. You shouldtry changing your screen resolution, or disable toolbars from theView menu in Dev-C++

14. It seems i've found a problem/bug thatis not specified here. What should i do ?

First, you shouldtry doing a 'Check for Dev-C++ update' (in Help menu)to know if a new version has come that may correct this problem.If there are no new version or the problem wasn't fixed thenplease send an email describing the bug to : [email protected]

15.When attempting to create a setup program, i get the error'File BinSetup.exe not found'.
If you arewilling to use the Setup Creator feature of Dev-C++, you need to download and install thisfile
16.How to use assembly with Dev-C++ ?
The assembler uses AT&T (notIntel). Here's an example of such a syntax :
// 2 global variables
int AdrIO ;
static char ValIO ;
void MyFunction(..........)
{
__asm('mov %dx,_AdrIO') ; // loading 16 bits register
__asm('mov %al,_ValIO') ; // loading 8 bits register
/*
Don't forget the underscore _ before each global variable names !
*/
__asm('mov %dx,%ax') ; // AX --> DX
}
I'm self studying from the book, C++ Primer Plus Fifth Edition, by Stephen Prata. The following relates to Chapter 13, Page 699, Programming Exercise #4. One task is to write the derived class method definitions based upon the given prototypes. The following are the said prototypes.
You will note that the base class destructor is virtual. That the derived class destructor is implemented inline.

Dev C++ Undefined Reference Page

I was creating the derived class method definitions in a cpp file and couldn't get the project to progressively compile correctly. At my first method definition, a default constructor, the compiler kept spitting out this error message:
Chapter-13pe-13-04port.cpp|74|undefined reference to `vtable for VintagePort'
The line number was pointing to my derived class constructor definition. I did some googling around and came across this workaround. I removed the inline effect of the derived class destructor, made that into a method definition in the cpp file and presto, compilation succeeded.
Am I to assume that the example in the book, as regards the inline feature of a derived class destructor, is in error. Are there any other explanations.

Recommended Answers

I was creating the derived class method definitions in a cpp file
and couldn't get the project to progressively compile correctly.
At my first method definition, a default constructor,
the compiler kept spitting out this error message:

Dev C++ Undefined Reference To __imp_wsastartup'

this is perhaps the most obscure error message that gcc (actually …
Jump to Post

All 10 Replies

vijayan1211,152

Dev C++ Linker Error Undefined Reference To Winmain@16'

> I was creating the derived class method definitions in a cpp file
> and couldn't get the project to progressively compile correctly.
> At my first method definition, a default constructor,
> the compiler kept spitting out this error message:
this is perhaps the most obscure error message that gcc (actually the linker) spits out, but the reason is simple:
the compiler has to put the (one and only one) vtable for a class into some object file or the other. it puts it into the object file for the translation unit where the definition of the first non-pure-virtual out-of-line virtual member function is present. if there is no such definition, you get this rather unhelpful linker error message.
Dev
you would be able to progressively compile the code even if a non-pure virtual function is not defined, but to be able to link without errors, every such function must have a definition (at least a stub). and to prevent the non-creation of a v-table by the compiler, at least one of the non-pure virtual functions will have to be defined out-of-line.
gcc has a faq about this: http://gcc.gnu.org/faq.html#vtables

> Am I to assume that the example in the book, as regards the inline feature
> of a derived class destructor, is in error.
i think it is not a particularly good book, but in this case neither the book nor the compiler is in error.
if you define the destructor inline, and void VintagePort::Show() const out-of-line, the error will go away. there has to be at least one out-of-line definition of a non-pure-virtual function.
note: the microsoft compiler (as well as several other compilers) does not require this; it instantiates a v-table with internal linkage in *every* translation unit in which such a header (all non-pure virtual functions are inline) is included. this violates the c++ one definition rule for v-tables, but as always, folks at redmond tend to value pragmatism highly. and they do give you __declspec(novtable) to suppress the proliferation of v-tables.
Dev
superjacent commented: To the point and relevant advice, thank you.+1