VC++ -> Dev-C++
Hi I want to port my MS VC++ game to Dev-C++ what changes do I have to make?
Is there any sites/tutorials that can help me?
Thanks.
try making a new project (or whatever) in DevC++, add all the files and compile. it gives you an error? fix it. doesn''t seem to be hard. it''s even possible you won''t get any errors, so try it 1st!
---
shurcool
my project
---
shurcool
my project
Yes, just remember that they both compile the same kind of code: C/C++. There are a few minor quirks, but there are a few people around that use Dev-C++ primarily (myself included), so we should be able to help you through your problems.
Always add this to your code:
#ifndef CDS_FULLSCREEN
#define CDS_FULLSCREEN 4
#endif
Always add this to your code:
#ifndef CDS_FULLSCREEN
#define CDS_FULLSCREEN 4
#endif
The Dev-C++ IDE uses the mingw g++ 2.95.3 compiler.
g++ manuals are available at gcc.gnu.org.
Go there, and compare their implementation of the language with Microsoft''s.
If you''re using Microsoft''s extensions to C++, be warned that you may have to change your code.
Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
g++ manuals are available at gcc.gnu.org.
Go there, and compare their implementation of the language with Microsoft''s.
If you''re using Microsoft''s extensions to C++, be warned that you may have to change your code.
Documents [ GDNet | MSDN | STL | OpenGL | Formats | RTFM | Asking Smart Questions ]
C++ Stuff [ MinGW | Loki | SDL | Boost. | STLport | FLTK | ACCU Recommended Books ]
"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
Ok I''ve fixed all the basic problems, now I just get errors with these:
free(TextureImage->data);
and
rand()%60;
whats the Dev-C++ equivalents?
I''ve looked at gcc.gnu.org but I couldn''t find anything of any use.
Thanks.
free(TextureImage->data);
and
rand()%60;
whats the Dev-C++ equivalents?
I''ve looked at gcc.gnu.org but I couldn''t find anything of any use.
Thanks.
The free and rand functions are in stdlib.h, are you including it?
BTW: You really shouldn''t use modulo to clamp random numbers, it affects the probability distribution. You can find information about this online, I''m sick of explaining it over and over again
.

BTW: You really shouldn''t use modulo to clamp random numbers, it affects the probability distribution. You can find information about this online, I''m sick of explaining it over and over again


Excellent! thanks a lot guys,
just one more question :-S
It only works when I put the GLaux.dll file in the application path, otherwise a msgbox comes up saying it can''t find it, can u help with this please?
Cheers
just one more question :-S
It only works when I put the GLaux.dll file in the application path, otherwise a msgbox comes up saying it can''t find it, can u help with this please?
Cheers
Dev-C++ links the libraries statically, while Visual C++ links them dynamically (meaning the necessary functions are compiled into the .exe). For Dev-C++ programs, the .dll must be located on the computer. This is true for opengl32.dll and glu32.dll, but these are already located in the Windows/system folder. GLaux.dll is not, so you will need to send it out with any programs you create.
Better yet, get rid of the AUX library altogether. NeHe has code for loading TGA files, and "OpenGL Game Programming" has code for loading BMP and TGA files (without glaux). Or you can use an image library. Personally, I use DevIL, but then you''ll still run into the problem of including DLL''s with your EXE.
Better yet, get rid of the AUX library altogether. NeHe has code for loading TGA files, and "OpenGL Game Programming" has code for loading BMP and TGA files (without glaux). Or you can use an image library. Personally, I use DevIL, but then you''ll still run into the problem of including DLL''s with your EXE.
DLLs always have to be somewhere where your app can find them. This is not compiler-specific, it''s a Windows thing.
So, if your DLL is a system one like OpenGL32.dll or GLU32.dll, they should be in one of the Windows system dirs already. If not, you should put them in your app dir.
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
So, if your DLL is a system one like OpenGL32.dll or GLU32.dll, they should be in one of the Windows system dirs already. If not, you should put them in your app dir.
Helpful links:
How To Ask Questions The Smart Way | Google can help with your question | Search MSDN for help with standard C or Windows functions
Actually, this is a compiler specific problem, like I originally said. Try compiling the same program (using glaux functions) in MSVC and Dev-C++ and you''ll see that one will run and the other will complain about not being able to find a DLL. This is due to how the compilers link to libraries.
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement