Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Aardwolf

Linker errors :(

This topic is 6049 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

There was an example program that''s made for Microsoft Visual Studio (you know, this way to expensive compiler for a poor student like me), but the author said it should also work with other compilers. So I compile it, and I get the following linker errors: C:\WINDOWS\TEMP\ccntWcgb.o(.text+0xca):ddsamp.cpp: undefined reference to `DDInit(HWND__ *)'' C:\WINDOWS\TEMP\ccntWcgb.o(.text+0xff):ddsamp.cpp: undefined reference to `DDCreateSurfaces(bool)'' C:\WINDOWS\TEMP\ccntWcgb.o(.text+0x1ce):ddsamp.cpp: undefined reference to `CheckSurfaces(void)'' C:\WINDOWS\TEMP\ccntWcgb.o(.text+0x1e1):ddsamp.cpp: undefined reference to `DDDone(void)'' C:\WINDOWS\TEMP\ccntWcgb.o(.text+0x43b):ddsamp.cpp: undefined reference to `CheckSurfaces(void)'' C:\WINDOWS\TEMP\ccntWcgb.o(.text+0x451):ddsamp.cpp: undefined reference to `g_pDDSBack'' C:\WINDOWS\TEMP\ccntWcgb.o(.text+0x457):ddsamp.cpp: undefined reference to `DDClear(IDirectDrawSurface *, int, int, int, int)'' C:\WINDOWS\TEMP\ccntWcgb.o(.text+0x4ed):ddsamp.cpp: undefined reference to `g_pDDSBack'' C:\WINDOWS\TEMP\ccntWcgb.o(.text+0x4f3):ddsamp.cpp: undefined reference to `DDPutPixel(IDirectDrawSurface *, int, int, int, int, int)'' C:\WINDOWS\TEMP\ccntWcgb.o(.text+0x517):ddsamp.cpp: undefined reference to `DDFlip(void)'' What just happened and what can I do about this? Thanks.

Share this post


Link to post
Share on other sites
Advertisement
Guest Anonymous Poster
Yeah, I forgot: I use Dev-C++ 4

The functions the errors refer to are inside another file, dd.cpp, that''s in the same folder.

Share this post


Link to post
Share on other sites
Guest Anonymous Poster
you have to go to project options, and in ''Further object files or linker options'' write ''-l???????'', where ''???????'' is what ever the directx library is called, probably directx but maybe not.

Share this post


Link to post
Share on other sites
I wish I could, but since it was a Visual Studio project, I can''t open the project file, and so I can''t use the project settings...

Share this post


Link to post
Share on other sites
I managed to get rid of most of the linker errors by merging both cpp files into one file, now it only give an error about

DirectDrawCreate:

C:\WINDOWS\TEMP\ccBmEcgb.o(.text+0x5bf):ddsamp.cpp: undefined reference to `DirectDrawCreate@12''


So I guess this isn''t in the included dd.cpp file, but then where is it. Did any of you meet this function before? DirectDrawCreate?

Thanks

Share this post


Link to post
Share on other sites
don''t make problems for yourself in the future by mangling files together, simple include the header files and and the library files in your project and compile them all together

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!