Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Code wouldn't Compile 1

Status
Not open for further replies.

chuch2002

Technical User
Mar 28, 2005
2
US
Hey there, I'm a newbie to microsoft visual c++ and I am having some problems compiling this example code provided by a company called Analytical Graphics for their STK software. Here's the quote from their help files that I can't fully understand:

"All AgConnect applications must be compiled with the AGCONNECT system/ preprocessor definition. The _AFXDLL preprocessor definition is also required. If the AGCONNECT flag isn't defined, the compiler doesn't recognize several internal variable types defined in AgUtMsgCommon.h. In addition to source and header files, AgConnect is shipped with a library file, AgConnect.lib that must be linked when generating any AgConnect executables. "

I have all the header files included in the folder with the source code. I have also fooled around with entering the preprocessor things, _AFXDLL, in the options under project settings, and also linked the .lib file. But I also have a .dll and .exp file that I don't know what to do with.

I'm having the compiling errors in exactly the file it says in the quote, AgUtMsgcommon.h. The example code I'm using doesn't have any errors in itself. Can anyone help me out in getting this to work. Thanks in advance.

 
Make sure you insert #define AGCONNECT and #define _AFXDLL before including AgUtMsgCommon.h. This should fix compiler errors.

Also, when they say "AgConnect.lib must be linked" they mean that your program must link with it. This is usually done by adding "AgConnect.lib" to Object/Library Modules in project settings.

Of course also make sure that the header and library are somewhere in your searth path for headers & libraries.

I REALLY hope that helps.
Will
 
That did it. All I had to do was define AGCONNECT, and it compiles. I don't know how I missed that one little thing when it was right in front of me. Thanks so much for the help.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top