From VC++ To Dev-C++
I am working with a directx game in microsoft Visual C++. I tried to compile it with Dev-c++ and got tons of errors (no problem compiling in VC++). So, would someone with experience using devcpp please help me understand the difference and how to solve the problem?
For those who doesn''t know about devcpp check out http://www.bloodshed.net/devcpp.html
(it''s free stuff, thats why i like it )
Error messages:
ompilator: Default compiler
Building Makefile: "C:\Dev-Cpp\Mupp\Makefile.win"
Kör make...
make.exe -f "C:\Dev-Cpp\Mupp\Makefile.win" all
g++.exe -c E:/Coding/Tanya/Projektarbete/Projekt.cpp -o E:/Coding/Tanya/Projektarbete/Projekt.o -I"C:/Dev-Cpp/include" -I"C:/Dev-Cpp/include" -I"E:/Coding/DXSDK9.0/Include"
In file included from C:/Dev-Cpp/include/objbase.h:58,
from E:/Coding/DXSDK9.0/Include/ddraw.h:36,
from E:/Coding/Tanya/Projektarbete/Projekt.cpp:2:
C:/Dev-Cpp/include/unknwn.h:27: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/unknwn.h:27: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/unknwn.h:41: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/unknwn.h:41: warning: `com_interface'' attribute directive ignored
In file included from C:/Dev-Cpp/include/objbase.h:59,
from E:/Coding/DXSDK9.0/Include/ddraw.h:36,
from E:/Coding/Tanya/Projektarbete/Projekt.cpp:2:
C:/Dev-Cpp/include/objidl.h:411: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:411: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:412: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:412: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:413: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:413: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:414: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:414: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:415: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:415: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:416: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:416: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:417: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:417: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:418: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:418: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:419: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:419: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:431: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:431: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:452: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:452: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:468: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:468: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:479: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:479: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:495: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:495: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:517: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:517: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:530: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:530: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:541: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:541: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:556: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:556: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:573: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:573: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:593: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:593: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:623: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:623: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:640: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:640: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:656: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:656: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:671: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:671: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:687: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:687: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:706: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:706: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:720: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:720: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:745: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:745: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:756: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:756: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:771: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:771: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:784: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:784: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:801: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:801: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:813: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:813: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:830: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:830: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:842: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:842: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:857: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:857: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:868: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:868: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:884: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:884: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:906: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:906: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:920: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:920: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:933: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:933: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:947: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:947: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:958: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:958: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:972: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:972: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:983: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:983: warning: `com_interface'' attribute directive ignored
C:/Dev-Cpp/include/objidl.h:997: `com_interface'' only supported with -fvtable-thunks
C:/Dev-Cpp/include/objidl.h:997: warning: `com_interface'' attribute directive ignored
In file included from E:/Coding/Tanya/Projektarbete/Projekt.cpp:2:
E:/Coding/DXSDK9.0/Include/ddraw.h:999: `com_interface'' only supported with -fvtable-thunks
E:/Coding/DXSDK9.0/Include/ddraw.h:999: warning: `com_interface'' attribute directive ignored
E:/Coding/DXSDK9.0/Include/ddraw.h:1085: `com_interface'' only supported with -fvtable-thunks
E:/Coding/DXSDK9.0/Include/ddraw.h:1085: warning: `com_interface'' attribute directive ignored
E:/Coding/DXSDK9.0/Include/ddraw.h:1177: `com_interface'' only supported with -fvtable-thunks
E:/Coding/DXSDK9.0/Include/ddraw.h:1177: warning: `com_interface'' attribute directive ignored
E:/Coding/DXSDK9.0/Include/ddraw.h:1279: `com_interface'' only supported with -fvtable-thunks
E:/Coding/DXSDK9.0/Include/ddraw.h:1279: warning: `com_interface'' attribute directive ignored
E:/Coding/DXSDK9.0/Include/ddraw.h:1364: `com_interface'' only supported with -fvtable-thunks
E:/Coding/DXSDK9.0/Include/ddraw.h:1364: warning: `com_interface'' attribute directive ignored
E:/Coding/DXSDK9.0/Include/ddraw.h:1406: `com_interface'' only supported with -fvtable-thunks
E:/Coding/DXSDK9.0/Include/ddraw.h:1406: warning: `com_interface'' attribute directive ignored
E:/Coding/DXSDK9.0/Include/ddraw.h:1478: `com_interface'' only supported with -fvtable-thunks
E:/Coding/DXSDK9.0/Include/ddraw.h:1478: warning: `com_interface'' attribute directive ignored
E:/Coding/DXSDK9.0/Include/ddraw.h:1605: `com_interface'' only supported with -fvtable-thunks
E:/Coding/DXSDK9.0/Include/ddraw.h:1605: warning: `com_interface'' attribute directive ignored
E:/Coding/DXSDK9.0/Include/ddraw.h:1740: `com_interface'' only supported with -fvtable-thunks
E:/Coding/DXSDK9.0/Include/ddraw.h:1740: warning: `com_interface'' attribute directive ignored
E:/Coding/DXSDK9.0/Include/ddraw.h:1883: `com_interface'' only supported with -fvtable-thunks
E:/Coding/DXSDK9.0/Include/ddraw.h:1883: warning: `com_interface'' attribute directive ignored
E:/Coding/DXSDK9.0/Include/ddraw.h:2041: `com_interface'' only supported with -fvtable-thunks
E:/Coding/DXSDK9.0/Include/ddraw.h:2041: warning: `com_interface'' attribute directive ignored
E:/Coding/DXSDK9.0/Include/ddraw.h:2161: `com_interface'' only supported with -fvtable-thunks
E:/Coding/DXSDK9.0/Include/ddraw.h:2161: warning: `com_interface'' attribute directive ignored
E:/Coding/DXSDK9.0/Include/ddraw.h:2195: `com_interface'' only supported with -fvtable-thunks
E:/Coding/DXSDK9.0/Include/ddraw.h:2195: warning: `com_interface'' attribute directive ignored
E:/Coding/Tanya/Projektarbete/Projekt.cpp: In function `int LoadHeroAnimation()'':
E:/Coding/Tanya/Projektarbete/Projekt.cpp:677: name lookup of `AnimToLoad'' changed for new ANSI `for'' scoping
E:/Coding/Tanya/Projektarbete/Projekt.cpp:661: using obsolete binding at `AnimToLoad''
E:/Coding/Tanya/Projektarbete/Projekt.cpp: In function `int DirectDrawSetup()'':
E:/Coding/Tanya/Projektarbete/Projekt.cpp:1249: warning: converting NULL to non-pointer type
E:/Coding/Tanya/Projektarbete/Projekt.cpp: In function `int CreateBob(BitmapObjectType *, int, int, int, int, char *)'':
E:/Coding/Tanya/Projektarbete/Projekt.cpp:1641: warning: NULL used in arithmetic
make.exe: *** [E:/Coding/Tanya/Projektarbete/Projekt.o] Error 1
Körning avslutad
EndasilVisit my site, try my gameswww.dragonrealmsoftware.comI need more beta tester for my game! Check out http://www.dragonrealmsoftware.com
VC6 has its own view of what C++ should be, which differs from that of g++ (which is arguably closer to the ISO C++ standard). It is thus no surprise that nonstandard code accepted by VC6 would be rejected by other compilers.
If you read the error message, you'll see that they very subtly suggest you add -fvtable-thunks to your compilation command-line options. COM is an unholy hack that relies on the internal layout of C++ objects and the presence and location of a virtual function table - all things which are not standardized in C++. g++ has support for it, but you have to explicitely enable it.
The other error at the bottom is due to the fact that, in standard C++, when you write for(int i; i<10; ++i) { ... }, the variable i exists only for the duration of the loop .
Be glad you have pretty explicit error messages.
Try to learn the words you don't understand
[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
[edited by - Fruny on February 18, 2003 12:03:09 PM]
If you read the error message, you'll see that they very subtly suggest you add -fvtable-thunks to your compilation command-line options. COM is an unholy hack that relies on the internal layout of C++ objects and the presence and location of a virtual function table - all things which are not standardized in C++. g++ has support for it, but you have to explicitely enable it.
The other error at the bottom is due to the fact that, in standard C++, when you write for(int i; i<10; ++i) { ... }, the variable i exists only for the duration of the loop .
Be glad you have pretty explicit error messages.
Try to learn the words you don't understand
[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
[edited by - Fruny on February 18, 2003 12:03:09 PM]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Add "-fvtable-thunks" to Dev-C++''s compiler options whenever you are compiling COM stuff. Also make sure you have DirectX libs specific for MinGW.
quote: Original post by Fruny
The other error at the bottom is due to the fact that, in standard C++, when you write for(int i; i<10; ++i) { ... }, the variable i exists only for the duration of the loop .
Can you enable the looping variable to be destroyed after the loop exits in vc++? The fact that it doesn't annoys the hell out of me.
Runtime errors should be renamed to runtime terrors
[edited by - Eskhan on February 18, 2003 12:17:46 PM]
--------------------Though this program be madness, yet there is a method in't
VC6, no. VC7, yes. It''s in the project options, under the ''language'' item if I am not mistaken.
[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
[ Start Here ! | How To Ask Smart Questions | Recommended C++ Books | C++ FAQ Lite | Function Ptrs | CppTips Archive ]
[ Header Files | File Format Docs | LNK2001 | C++ STL Doc | STLPort | Free C++ IDE | Boost C++ Lib | MSVC6 Lib Fixes ]
"Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." — Brian W. Kernighan
Dammit
well, I guess i''ll have to stick to enclosing the for loops with compund statements then...
Runtime errors should be renamed to runtime terrors
well, I guess i''ll have to stick to enclosing the for loops with compund statements then...
Runtime errors should be renamed to runtime terrors
--------------------Though this program be madness, yet there is a method in't
Go to ''project options''->''compiler''->''compiler options''->''c++ compiler'' and write ''-fvtable-thunks'' in there.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
You need to convert your directX libs to mingw32 libs. Here is an article describing how to do it. It talks about recompiling the tools, but I think they have binaries up for download already.
It is foolish for a wise man to be silent, but wise for a fool.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement