🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

Problems with C++/DJGPP

Started by
6 comments, last by Bob 24 years, 5 months ago
Hi all. I''ve been programming BASIC for a long time, but about a few weeks ago I started learning C. I''m catching on pretty fast, but recently after reading some articles I discovered I would be better learning C++, so I made the switch. Problem is though, the compiler I''m using (DJGPP) gives me the following error message when building C++ programs, although it didn''t when building C programs. Error: c:/djgpp/bin/ld.exe: cannot open -lstdcx: No such file or directory (ENOENT) If anyone can help me out with this I would be very grateful.
Advertisement
DJGPP used to be my Compiler of Choice, until I changed to VC++. I think it might be your PATH, set in you autoexec.bat file. Or you didnt install DJGPP for C++, when you downloaded it, make sure you got the right zip''s for C++. Also, you might want to go straight to VC++, your choice
Yes, the path and missing files were the first things I thought of. But after checking, I discovered I did have all nessesary files and the path settings the Autoexec.bat were correct.
I''ve never used that compiler before but perhaps this might help. Are you sure that you are compiling for C++ and not just C. In most compilers you have to tell it which of them to the generate code for. Might be a comand line switch.

As well, you might have to make sure that the extention is .cpp and not just .c.

NOTE: This advice might be totally wrong, as I have mentioned above that I have no knowledge of that compiler. This is just an informative what/if response to try and offer some sort of solution.
William Reiach - Human Extrodinaire

Marlene and Me


hmmmmm... I use RHIDE, DJGPP's IDE - I think maybe I do have to tell it which language I'm compiling - the only difference between compiling c and c++ in my programs has been the .cpp extenstion. If you do need to tell it, I can't seem to work out how.

Edited by - Bob on 1/17/00 10:30:34 PM
You should not have to tell it if it is C or C++, as you thought it tells by the extention, but Ive always invoked the compiler from command line, for example:
gcc test1.cpp -o test1.exe -lm
try that and see if it works
Yep, that worked. I was letting RHIDE compile the program, and when I looked closely at what RHIDE was doing, I realised it was this:

gpp cpptest.cpp -o cpptest.exe -lstdcx
not
gpp cpptest.cpp -o cpptest.exe -lm (which worked)

Thanks guys!
Finally something I said worked!

This topic is closed to new replies.

Advertisement