Skip to main content
gamedev.net
🔒 Locked

Evil Linker

Started by OrigamiMan64 Apr 18, 2004 at 6:09 PM 9 replies 550+ views
Original Post
OrigamiMan64
OrigamiMan64
I am working in .NET 2003. My solution consists of 4 Win32 static library projects and one Win32 executable. When I build one of the libraries, there are no errors. However, when I build my main executable, I get a linker error that a function referanced by that library has not been defined. How is this possible? The full project can be referanced at www.ezequal.com/OrigamiMan64/DOS3D.zip if it helps.
OrigamiMan64
OrigamiMan64
yah, I noticed without the referances in the DOS3D project, there were a lot more linker errors. However, I added referances to all 4 other projects, and I still get 2 linker errors.
zealouselixir
zealouselixir
Yeah, I got those two as well. But it seems as if they might be legitimate; I couldn''t find a definition for LoadBitmap(char const *, Color). The other one seems to have been caused by a macro replacement of "DrawTextA" for "DrawText" (caused by WinGDI, I suspect). Consider renaming the DrawText function.

Later,
ZE.
[twitter]warrenm[/twitter]
OrigamiMan64
OrigamiMan64
LoadBitmap is defined in Bitmap.cpp, in project Draw
OrigamiMan64
OrigamiMan64
haha, they were both window''s fault! I #undef''d their function names in my implementation files, and now everything links fine :D Thanks a bunch.
mfawcett
mfawcett
That's not Windows' fault, that's yours for not using a namespace, AND for using commonly known API function names as your own.


[edited by - mfawcett on April 18, 2004 10:06:12 PM]
--Michael Fawcett
OrigamiMan64
OrigamiMan64
no, the problem was really that windows used the preprocessor to define their functions, and even if I did use a namespace the stupid text replace would have nullified it. I have as much right to those function names as windows does :-P
psamty10
psamty10
Interestingly, some of my students ran into the exact same problem in class today... goddamn #defines It absolutely is not your fault, but its a common mistake....

And yeah, even if you did use a namespace youd still be screwed.... the legacy of #defines destroying perfectly good code continues

[edited by - psamty10 on April 20, 2004 12:12:56 AM]
NLDEV
NLDEV
quote:
Original post by Code_Dark
Arrgh, Dev-C++ is horrible for DirectX and OpenGL because of it's hellish linking problems. It's horrible!


- CD



// Brought to you by Code_Dark
| [( Politics Forum Beta-Test )]



That's odd. I have no problem using OpenGL with GCC. What kind of errors do you get?

[edited by - MikeMJH on April 21, 2004 1:24:01 AM]

Topic Locked

This topic has been locked by a moderator. New replies are not allowed.

Sign in to reply to this topic.