Particle's Custom RPG

Assistance => Assistance & Feedback => Topic started by: GStricto on October 21, 2004 01:54 pm CDT

Title: C++ help needed
Post by: GStricto on October 21, 2004 01:54 pm CDT
I have Borland C++ (the command-line compiler) and it works fine for all of my needs except for now.  I have a situation where I need to create a DLL file.  I know Visual C++ can handle such a situation, but seeing as I have no money, and don't really need VC++, I would hope that someone here can tell me how I can get Borland to handle the compile.

i.e. is there a command line argument I could use to specify that I want a DLL produced, or is it something within the .cpp file itself?
Title:
Post by: Lidge Farkley on October 25, 2004 10:53 am CDT
This might help:

http://community.borland.com/article/0, ... 97,00.html (http://community.borland.com/article/0,1410,20997,00.html)
Title:
Post by: GStricto on October 25, 2004 02:21 pm CDT
Thanks for the help, I think I've seen that page before, but its not really anything new...

As we speak WinMX is running and im 33rd in line for my copy of Visual C++.  Thanks anyways though.
Title:
Post by: Lidge Farkley on October 26, 2004 04:58 pm CDT
hehe.. Yeah I'm not a programer.. I did and do help out with figuring some codes out, but that's a bit different from ever usign a compiler or knowing how compiler commands work.

I left my C++ book at home... or I could have checked it for you!
Doh!

Peace.
Title:
Post by: UnderGod on November 2, 2004 12:28 pm CST
Use Bloodshed Dev ++... It is exactly like visual C++ except it is free, and has better documentation as well as is updated to the most recent standard.

I use that for C++

I also use Crimson Editor / notepad for Java, which is a language you might want to look into if you are interested in expanding your programming knowledge.
Title:
Post by: GStricto on November 2, 2004 08:52 pm CST
Thanks for the advice... but I already "acquired" Visual C++ if you catch what I mean...  As for Java, I've already taken a year of it and got a 4 on that AP test and now I'm one of 2 people in my entire county to be in independent study for... yep, you guessed it, a 2nd year of Java.

(my school system is not small by any means, it has more funding than Rhode Island.  Yes, it spends more on students that a state does for existing)

Ozzy if you really like Java, I can very happily recommend BlueJ.  It's a Java compiler that has some really usefull features.  (Visual representation of class relations and heirarchy along with expanded debug info past the malarkeyty, cryptic messages most compilers give.)  Also, for the really interesting side of Java, look up JOGL.  JavaOpenGL, someone has no life and ported OpenGL libraries to Java in full and last time I heard, it was going to be addopted as the standard by SunMicrosystems.  Fun stuff.  (Think full Winows/Linux/Mac programs in 3D using the same source code.)
Title:
Post by: UnderGod on November 3, 2004 06:34 am CST
I like crimson editor just because it color codes items and uses a tad more memory than notepad. I use the standard javac. Just seems to work for me =/.

As for books... Well I have a membership to books24x7.com
Title:
Post by: GStricto on November 19, 2004 04:05 pm CST
Well, for anyone that cares to know, I've been working on my project (although today was the first time I've gotten to really sit down and hammer out some problems in a long while.)

Essentially, it comes to this:  With Trillian (http://www.ceruleanstudios.com (http://www.ceruleanstudios.com)), all incomming messages are in html format so that the mediums can be consistent client side (AIM, MSN, etc have a single format from html).  This is supposed to be useful but for my ideas it was horrific.

First problem solved: I have a function that strips html code from incomming messages.  (Some of you may laugh, but it's all done with pointers to char arrays, for statements, and some other trickery).  This wouldn't have been so bad, but every compile to test, I had to build a DLL, enable it with Trillian, load Trillian back when it crashed (index out of bounds), disable the DLL to re-compile, then test again.  It's a very slow method.

So anyways, the main point:  If you haven't talked to me recently, I'm making an AIM screen name (GladioStricto) which will be a Trillian plugin/port of Tokath.  My main purpose in comming here is to ask what people want to see for this bot.  I have madlibs planned, jibberish, top5, quote, and about 10 other things planned out and ready to get started.  All I'm asking is for new ideas (don't be retarded).  Any ideas that are not easily tranferred to a text based interface, any ideas that are insane in difficulty, or any ideas posted by Jonah will be ignored.  (Unless of course he can stop being a moron for 30 sec and give useful ideas.)
Title:
Post by: Sinister on November 19, 2004 05:17 pm CST
Lol about Jonah!  Dude, that sounds sweet!

Oh yeah, btw, the exp system doesn't work on the thing you gave me.  Ppl cant level.  Everything else seems to work ok.
Title:
Post by: GStricto on November 19, 2004 10:48 pm CST
lmao, I'm not sure where I left off in that code, but one nifty thing that I know for sure that works is if you use admin to #sethp on someone, then immediately #cast advheal or massheal or advfullheal (I think I created that last spell).  Anyways, if you are within a certain range in terms of levels from the person you heal, you will gain EXP (assuming your class has D Cast at all :-P)
Title:
Post by: GStricto on November 20, 2004 03:52 pm CST
Ozzy or Part, check over this for me, I'm still working on it as I'm writing this so I may figure it out before you read it, but any help is appreciated.

Quote from: "Compiler"
--------------------Configuration: Gladio Bot - Win32 Debug--------------------
Compiling resources...
Compiling...
gladio_main.c
c:\gladio bot\source\gladio.h(81) : error C2061: syntax error : identifier 'gladio_util_compare'
c:\gladio bot\source\gladio.h(81) : error C2059: syntax error : ';'
c:\gladio bot\source\gladio.h(81) : error C2059: syntax error : 'type'
gladio_util.c
c:\gladio bot\source\gladio.h(81) : error C2061: syntax error : identifier 'gladio_util_compare'
c:\gladio bot\source\gladio.h(81) : error C2059: syntax error : ';'
c:\gladio bot\source\gladio.h(81) : error C2059: syntax error : 'type'
c:\gladio bot\source\gladio_util.c(216) : warning C4018: '<' : signed/unsigned mismatch
c:\gladio bot\source\gladio_util.c(238) : error C2061: syntax error : identifier 'gladio_util_compare'
c:\gladio bot\source\gladio_util.c(238) : error C2059: syntax error : ';'
c:\gladio bot\source\gladio_util.c(238) : error C2059: syntax error : 'type'
c:\gladio bot\source\gladio_util.c(257) : warning C4029: declared formal parameter list different from definition
c:\gladio bot\source\gladio_util.c(258) : warning C4013: 'gladio_util_compare' undefined; assuming extern returning int
gladio_windows.c
c:\gladio bot\source\gladio.h(81) : error C2061: syntax error : identifier 'gladio_util_compare'
c:\gladio bot\source\gladio.h(81) : error C2059: syntax error : ';'
c:\gladio bot\source\gladio.h(81) : error C2059: syntax error : 'type'
Error executing cl.exe.

Gladio Bot.dll - 12 error(s), 3 warning(s)
(The util at line 216 is not a problem, I know the logic flows correctly at that point.)

In the .h file where I pre-define all functions (this is the only one that does not work):

Quote from: "Code in Question"
bool gladio_util_compare(char *input, char[] parse);

In the .c or .cpp file where I formally define all functions:

Quote from: "Code in Question"
bool gladio_util_compare( char *input, char[] parse)
{
   bool consistent = false;
   int i;

   if( strlen(input) == strlen(parse)) {
      consistent = true;
      for( i = 0; i <= strlen(input); i++) {
         if( input != parse) {
            consistent = false;
            break;
         }
      }
   }

   return consistent;
}


Based on what the error is returning, I'm really going out on a limb (ok, not really) and thinking that it doesn't like something about how I declared the function and then defined the function.  But, like I sad previously, the other functions I declare and define in the same way (namely copy and paste the function and add the ; at the end).  So I'm at a loss for what the problem is.
Title:
Post by: GStricto on November 20, 2004 09:07 pm CST
Go out to dinner, get in fight with parents, come back home and...  Realize that char[] name is not the syntax for arrays, its char name[].  Also, does anyone know why Visual C++ has a problem with functions of type bool?  I changed it over to int and just return 1 or 0 so its the exact same as it would have been, but I just don't like it...
Title:
Post by: GStricto on November 21, 2004 09:32 pm CST
Alright, I have myself a new problem...

(http://http://home.ripway.com/2003-9/25470/Gladio-Bot-Sig.gif)

This is the buddy icon I made with intent on using it for my bot.  If you right click, you can see that its size is much larger than the 7k allowed by AIM.  If anyone knows how to shrink this down approx 1/7th its original size and not lose quality/frames, I will send you the PSD file I used in ImageReady.  (Personally, I have tried all I know and I don't think it can be done.)
Title:
Post by: UnderGod on November 24, 2004 06:54 am CST
I don't use Visual C++ for the reason that is is made by Microsoft. If something is made by Microsoft, it is managed by Microsoft and isn't updated to the ANSI standard.

To answer your question, your best bet is going to a web site I used to go to for C++. They have forums with experienced professional coders that could easily help you with that. Now that I go back to that web site, I see the forums have been taken down for some reason. The web site was http://www.cplusplus.com (http://www.cplusplus.com).

At any rate, I'm sure your question could also be answered at http://msdn.microsoft.com/visualc/ (http://msdn.microsoft.com/visualc/) if you looked through it. Microsoft can provide good documentation sometimes.

EDIT: Sorry the webiste for the forums was not the one I was talking about.. The real site is http://cboard.cprogramming.com/ (http://cboard.cprogramming.com/) and it is still running. These guys there know their stuff.
Title:
Post by: GStricto on November 24, 2004 04:05 pm CST
Thanks for the forums for the help.  Also, Visual C++ is a necessary evil because it's the only compiler that creates DLLs...  Hence, I have to go to the dark side.
Title:
Post by: UnderGod on November 24, 2004 06:07 pm CST
BloodShed's Dev-C++ IDE will create DLL files as well.
Title:
Post by: GStricto on November 24, 2004 10:17 pm CST
Oooohh... Why didn't you tell me this when I first asked about Visual C++ and DLLs?  :wink:
Title:
Post by: UnderGod on November 25, 2004 05:25 pm CST
Quote from: "UnderGod"
Use Bloodshed Dev ++... It is exactly like visual C++ except it is free, and has better documentation as well as is updated to the most recent standard.


I did.
Title:
Post by: Frantic on November 25, 2004 06:44 pm CST
Quote from: "GStricto"
Oooohh... Why didn't you tell me this when I first asked about Visual C++ and DLLs?  :wink:

Quote from: "UnderGod"
Use Bloodshed Dev ++... It is exactly like visual C++
except it is free, and has better documentation as well as is updated to the most recent standard.

I use that for C++
Title:
Post by: GStricto on November 25, 2004 10:20 pm CST
Yes, thank you Jonah, go be an asshole somewhere else...  I don't need you quoting what Ozzy just said to me.  Waste your time elsewhere since you are obviously not able to contribute anything worthwhile to anything.
Title:
Post by: Frantic on November 25, 2004 11:30 pm CST
Quote from: "GStricto"
go be an asshole somewhere else...  I don't need you quoting what Ozzy just said to me.  Waste your time elsewhere since you are obviously not able to contribute anything worthwhile to anything.


I had to get back at you for making me look like "a babbling 3 year old".



 :wink:
Title:
Post by: GStricto on November 26, 2004 05:59 pm CST
Quote from: "Frantic"
I had to get back at you for making me look like "a babbling 3 year old".



 :wink:
Title:
Post by: Frantic on November 26, 2004 06:17 pm CST
Quote from: "GStricto"
Heh, nothing against you personally, you caught me at a bad time that night, just check the poll, people hate you more than they like my sigs.  :wink:


People hate me on an online message board, how will I go on?
Title:
Post by: GStricto on November 26, 2004 07:25 pm CST
I'm not sure, maybe you should just DIE!!!one!!1

On a side not, I didn't intend on this thread becomming a place for you to piss people off, so do the first nice thing I have ever seen you do and kindly leave this thread alone.  I am actually trying to get real help from it.

You leave me alone, and I won't start polls or unsavory woman back with you.  A kind of peace, if you will.
Title:
Post by: Frantic on November 26, 2004 07:39 pm CST
Quote from: "GStricto"
You leave me alone, and I won't start polls or ***** back with you.  A kind of peace, if you will.


Because I care so much about your polls  :lol:
Title:
Post by: GStricto on November 28, 2004 03:48 pm CST
Ozzy, I downloaded a copy of the BloodShed C++ like you talked about, but it won't even compile what was stable with Visual C++.  For some reason, code that works fine with Visual C++ generates 30+ errors, not warnings, with BloodShed.  That being said, I went back to visual C++ (I think the Trillian designers wanted it done with VC++ anyways).  Any ideas on why fstream.h does not seem to load as a header file?  Every other header I have used without problem, and I made sure this one was explicitly looked for on compile and I can look at the file in the \lib directory...  So frustrating.
Title:
Post by: UnderGod on November 28, 2004 04:58 pm CST
That is because Bloodshed is updated to the latest standard like namespaces.. fstream.h may not work but how about just fstream without the h?

Visual C++ doesn't even know what a namespace is.
Title:
Post by: GStricto on November 28, 2004 05:36 pm CST
Quote from: "UnderGod"
That is because Bloodshed is updated to the latest standard like namespaces.. fstream.h may not work but how about just fstream without the h?

Visual C++ doesn't even know what a namespace is.


Good point, I will try again...

*edit*
Thanks for your help, I'm starting to see where some problems were (once I figured out some of the more cryptic error messages).  It sure is nice to have a compiler that finally conforms to what I had learned.  Now I have to go re-write half the code Visual C++ generated (but hey, at least its only half).
Title:
Post by: GStricto on December 23, 2004 07:22 pm CST
I've just gotten some time to start back working on this...  Does anyone know what replaced fstream.h as the ANSI/ISO standard for handling files?  I've eliminated about 50+ errors that BloodShed generates and that Visual C++ completely ignored, but BloodShed is telling me this header is out of date/depreciated.  Also, does anyone have a copy of the ANSI/ISO standards or know where I can get a copy (without paying the $20)?

If there isn't a way to find out the new header file, I guess I will just supress the warnings for now even though I hate that idea...
Title:
Post by: UnderGod on December 23, 2004 08:22 pm CST
#include <fstream>

You can find the standard header file list here (http://http://www.cplusplus.com/doc/ansi/hfiles.html).
Title:
Post by: GStricto on December 27, 2004 05:57 pm CST
Code: [Select]
Unable to open object file C:\Gladio Bot\Source\dlltool Bot.dll
 C:\Gladio Bot\Source\Makefile.win [Build Error]  ["Gladio] Error 1


After about 30 min of figuring out some of the little bits that Visual C++ allows that BloodShed doesn't, I finally got it to compile...  Or I would have, that was the only message I recieved.  I'm completely lost here.

Ozzy, maybe you should give me some way to contact you besides here...  Like AIM or something, I think my info is in my profile.
Title:
Post by: GStricto on May 29, 2005 03:57 pm CDT
Here I go with a bump again...

I'm posting this on a few different forums hoping someone can help me out.
I switched the build back from Bloodshed to Visual C++ and everything "compiles" - the .obj files are built, but then when they should be linked to a .dll this junk comes from nowhere (note that the compile does not even have warnings):

Code: [Select]
--------------------Configuration: gladio_plugin - Win32 Debug--------------------
Compiling...
gladio_main.cpp
gladio_util.cpp
gladio_windows.cpp
Linking...
gladio_util.obj : error LNK2005: "struct HWND__ * mMainWnd" (?mMainWnd@@3PAUHWND__@@A) already defined in gladio_main.obj
gladio_util.obj : error LNK2005: "int (__cdecl* plugin_send)(char *,char *,void *)" (?plugin_send@@3P6AHPAD0PAX@ZA) already defined in gladio_main.obj
gladio_windows.obj : error LNK2005: "int __cdecl prefDialog(struct HWND__ *,unsigned int,unsigned int,long)" (?prefDialog@@YAHPAUHWND__@@IIJ@Z) already defined in gladio_main.obj
gladio_windows.obj : error LNK2005: "struct HWND__ * __cdecl myCreateDialog(struct HINSTANCE__ *,char const *,struct HWND__ *,int (__stdcall*)(struct HWND__ *,unsigned int,unsigned int,long))" (?myCreateDialog@@YAPAUHWND__@@PAUHINSTANCE__@@PBDPAU1@P
6GH2IIJ@Z@Z) already defined in gladio_main.obj
gladio_windows.obj : error LNK2005: "void __cdecl myDestroyWindow(struct HWND__ *)" (?myDestroyWindow@@YAXPAUHWND__@@@Z) already defined in gladio_main.obj
gladio_windows.obj : error LNK2005: "struct HWND__ * prefs_window" (?prefs_window@@3PAUHWND__@@A) already defined in gladio_main.obj
gladio_windows.obj : error LNK2005: "struct HWND__ * mMainWnd" (?mMainWnd@@3PAUHWND__@@A) already defined in gladio_main.obj
gladio_windows.obj : error LNK2005: "int (__cdecl* plugin_send)(char *,char *,void *)" (?plugin_send@@3P6AHPAD0PAX@ZA) already defined in gladio_main.obj
.\gladio.def : fatal error LNK1119: invalid ordinal number "0"
LINK : fatal error LNK1141: failure during build of exports file
Error executing link.exe.

gladio.dll - 10 error(s), 0 warning(s)

Again, please note that this is not compile, this is linking that this stuff comes up.  I have searched all source for the functions it is claiming I already used, and they each appear only once (no reusing the name in other files or overloading).