|
Besides linking dynamically (which then require you to redistribute dlls), then you can check out /OPT:REF /OPT:ICF[^]
|
|
|
|
|
Please consider the following simple OpenGL program:
<br />
<br />
#include <GL/glut.h><br />
<br />
<br />
int main(int argc, char** argv)<br />
{<br />
glutInit(&argc, argv);<br />
<br />
glutMainLoop();<br />
return 0;<br />
}<br />
<br />
<br />
I am using Microsoft Visual Stdio for my development. The above program compiles and links but dies out at runtime with the message glut32.dll was not found. I have the file glut32.dll on the system. I suspect that I need to modiy my project file to tell Visual Stdio where to look for the file glut32.dll. If this is the case, I am not sure how to do so. I am hoping somebody here can tell me how to fix this problem.
Thanks
Bob
|
|
|
|
|
Is glut32.dll in your Windows/System32 folder? I know you said it's 'on your system', but where? L u n a t i c F r i n g e
|
|
|
|
|
Copy glut32.dll to Windows\System32 folder or alternatively copy it to same directory as the executable.
-Saurabh
|
|
|
|
|
Thanks for the two responses. I copied the file glut32.dll to the same directory as my executable at it worked. Problem solved. However, I am wondering if there is a way for me to set an environment variable or something so that it would pick it up there. I am wondering if setting the environment variable PATH would help.
Thanks
Bob
|
|
|
|
|
'When Windows needs to load a DLL module before running a program that requires it, the library file must be stored in the directory containing the .EXE program, the current directory, the Windows system directory, the Windows directory, or a directory accessible through the PATH string in the MS-DOS environment. (The directories are searched in that order.)'
Petzold - Programming WindowsL u n a t i c F r i n g e
|
|
|
|
|
Create a shortcut to your program, edit it and in the field Start in, set the folder to your Dll. That will work... Remember, clicking the shortcut will run your program correctly, but clicking the program will give the errormessage..
|
|
|
|
|
Hello everyone,
Just so its known this question is related to my programming class. Here is the question out of the book:
"Is it reasonable to create a CHawk by deriving from CBird? How about a COstrich? Justify your
answers. Derive an avian hierarchy that can cope with both of these birds."
class CBird
{
protected:
int wingSpan;
int eggSize;
int airSpeed;
int altitude;
public:
virtual void fly() { altitude = 100; }
};
I thought that the class has to be declared first. Like #include CBird.h goes in the include list. If I am wrong, then the question from the book is YES, CHawk and COstrich can be inherited from CBird.
Can anyone provide me with clarification to classes related to OOP?
Thanks in advance.
V/R
Rob
|
|
|
|
|
I think the question is trying to check if you understand when you can inherit from a class. I will only provide you a hint - Hawk can fly but Ostrich can't.
-Saurabh
|
|
|
|
|
Thank you very much for the prompt response.
So I take it that the non-flying birds will not and can not inherit CBird class. So there would have to be another class to define CNonbird correct?
|
|
|
|
|
Guess you don't know much about biology either. To see if something should fit in a class hierarchy, does it have an "is-a" relationship? You measure democracy by the freedom it gives its dissidents, not the freedom it gives its assimilated conformists.
|
|
|
|
|
As Tim said you should check for is-a relationship. Ostrich *is a* bird but it cannot fly, this suggests that you need to think about how can you organize birds.
-Saurabh
|
|
|
|
|
rbwest86 wrote: "Is it reasonable to create a CHawk by deriving from CBird? How about a COstrich? Justify your
answers. Derive an avian hierarchy that can cope with both of these birds."
Both ostrich and hawk belong to the Aves class, so they are both birds. While an ostrich belongs to the Struthioniformes (flightless) order, it's a bird nonetheless."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
Hello,
Well, I think the answer is in:
rbwest86 wrote: Justify your
answers
That means in this case that nearly any answer will do, provided you can argue the point.
I would say that they all can be derrived from CBird, they all potentially have eggSize, airSpeed and altitude. You distinguish their flying behaviour by overriding the Virtual Function 'fly' In the case of COstrich, I would say:
#include 'Bird.h"
class COstrich : public CBird{
void COstrich::fly(){altitude=0;}
Beyond that, what springs to mind is, that one fool can ask more questions...etc.
Regards,
Bram van Kampen
|
|
|
|
|
I'm trying to figure out how to locate and use the IP Address/Default Gateway in a C++ program. This is so that a simple program can be universal on any network. I have been able to run "ipconfig /all" and output all the information to a text file, but I can't make it usable in the same program.
|
|
|
|
|
If you already have it in a txt, you can open and read it with files management as other stuff.
About the use... maybe this[^] can help you.Regards.
--------
M.D.V.
If something has a solution... Why do we have to worry about?. If it has no solution... For what reason do we have to worry about?
Help me to understand what I'm saying, and I'll explain it better to you
Rating helpfull answers is nice, but saying thanks can be even nicer.
|
|
|
|
|
I thought about that, and while I can get it down to the correct line, I couldn't get it to retrieve only the gateway. Had some issues using the find command. Its safe to say I'm pretty amateur.
|
|
|
|
|
gamefreak2291 wrote: I'm trying to figure out how to locate and use the IP Address/Default Gateway in a C++ program. This is so that a simple program can be universal on any network.
Not sure why you need this information for a simple networking program. Have a look at the API Helper API[^]. There can be multiple network interfaces in your system, you can use GetAdaptersInfo()[^] to get IP address/netmask/etc for all of them.
Hope this helps!
/M
|
|
|
|
|
See if this helps."One man's wage rise is another man's price increase." - Harold Wilson
"Fireproof doesn't mean the fire will never come. It means when the fire comes that you will be able to withstand it." - Michael Simmons
"Man who follows car will be exhausted." - Confucius
|
|
|
|
|
I'm looking to create a pair of buttons with the look of a Windows spin control. That is, two small buttons with an up arrowhead on one and a down arrowhead on the other. So far I'm unable to show the arrowhead characters as the button labels.
I'm using Visual Studio 2008 v9.0, C++, MFC. The project is compiled with the D "_MBCS" option. Switching to Unicode would require many hundreds of changes to the code base.
How can I use that character in my button label? Thanks in advance!
Dave.
|
|
|
|
|
|
Could do, but I thought it might be simpler to use an existing character. Problem is, these characters are proving difficult to access. I will use a bitmap if I have to.
Dave.
|
|
|
|
|
There is something for that in the Windows API somewhere. I've used it when I had to owner-draw cells in a (lousy) grid control to show that they would be dropdown combo boxes when editing the cell. Unfortunately, I can't seem to find the reference and am not around that code right now. Please do not read this signature.
|
|
|
|
|
Why don't you change the button font (for instance, you may use Symbols characters 173, 175 )?
If the Lord God Almighty had consulted me before embarking upon the Creation, I would have recommended something simpler.
-- Alfonso the Wise, 13th Century King of Castile.
This is going on my arrogant assumptions. You may have a superb reason why I'm completely wrong.
-- Iain Clarke
[My articles]
|
|
|
|
|
Not sure how that's going to help...?
|
|
|
|