Computing.Net > Forums > Programming > Classes - PLEASE HELP

Classes - PLEASE HELP

Reply to Message Icon

Original Message
Name: Andrew
Date: April 14, 2003 at 19:08:05 Pacific
Subject: Classes - PLEASE HELP
OS: Windows NT 5.1[xp] corp.
CPU/Ram: 2.66ghz/512@333mhz
Comment:

I am having serios trouble with every compiler on my system.... i get errors when i do thigs with classes i have used for years. I recently built a new pc, and put in windows xp with sp1, but i also used the compilers on VirtualPC(windows 95,98..) and same errors....
Here is the program... it should work, no problem.

#include
#include "apstring.h"

int main()
{
apstring str;
int num;
num = str.length();
return 0;
}
.... but i get these errors,
MS Visual C++ 6:
--------------------Configuration: apstring length - Win32 Debug--------------------
Compiling...
apstring length.cpp
Linking...
apstring length.obj : error LNK2001: unresolved external symbol "public: __thiscall apstring::~apstring(void)" (??1apstring@@QAE@XZ)
apstring length.obj : error LNK2001: unresolved external symbol "public: int __thiscall apstring::length(void)const " (?length@apstring@@QBEHXZ)
apstring length.obj : error LNK2001: unresolved external symbol "public: __thiscall apstring::apstring(void)" (??0apstring@@QAE@XZ)
Debug/apstring length.exe : fatal error LNK1120: 3 unresolved externals
Error executing link.exe.

apstring length.exe - 4 error(s), 0 warning(s)

Borland C++ 5.02:

Linking C:\.....(file name)
Error: Unresolved external 'apsting::~apstring()' refrance from C:\...(file name)
Error: Unresolved external 'apsting::apstring()' refrance from C:\...(file name)
Error: Unresolved external 'apsting::length()' refrance from C:\...(file name)

Now i dont think this is an error under me. I have reinstalled the compilers numorouse times under windows and in verital pc... and brougt up working files and the classes i had with them... nothing.. could this have to do with my new motherboard/cpu? PLEASE help...


Report Offensive Message For Removal

Response Number 1
Name: kev
Date: April 14, 2003 at 19:10:01 Pacific
Subject: Classes - PLEASE HELP
Reply: (edit)

Where did you get apstring.h?

Kev


Report Offensive Follow Up For Removal

Response Number 2
Name: kev
Date: April 14, 2003 at 19:12:30 Pacific
Subject: Classes - PLEASE HELP
Reply: (edit)

After thought:

When using apstring.h, you have to include the .cpp into your project, then compile. But, leave the .h file out of the project (it should appear under external dependencies)

Kev


Report Offensive Follow Up For Removal

Response Number 3
Name: andrew
Date: April 14, 2003 at 19:24:58 Pacific
Subject: Classes - PLEASE HELP
Reply: (edit)

thanx for the help guys. I told you though, i am doing NOTHING different thatn what i did before. achived folders in the same directory, because of usernames, will not work as thgey did before. it is nothing with my code, the way i wrote it works in school, on my old pc... what can it be? its not me lol.... i have the 7.68kb version of apmatrix.


Report Offensive Follow Up For Removal

Response Number 4
Name: andrew
Date: April 14, 2003 at 19:28:06 Pacific
Subject: Classes - PLEASE HELP
Reply: (edit)

OOPS... i ment apstring... not apmatrix... but that reminds me... this is with ALLLLLLL calsses!!!!!!!1


Report Offensive Follow Up For Removal

Response Number 5
Name: kev
Date: April 14, 2003 at 20:36:04 Pacific
Subject: Classes - PLEASE HELP
Reply: (edit)

Well? Did you try what I suggested? You never specifically said that my suggestion didn't work, but since you didn't say that it did, I'll assume that it didn't. Also, doing what I said doesn't involve changing any code, just the way your project is set up.

Can't think of anything now - whenever I have those problems with apstring, apmatrix, etc..., I just mess with the way they're included into my project.

Kev


Report Offensive Follow Up For Removal


Response Number 6
Name: borelli34
Date: April 14, 2003 at 23:06:52 Pacific
Subject: Classes - PLEASE HELP
Reply: (edit)

I've had similar behaviour before and it came down to the IDE settings. Take a look around and see if anything stands out as something you would normally have set/unset but is different than usual. Other than that it's tough to say. Oh yeah...if we knew where you got apstring from then maybe some of us could cut and paste it into our compilers just to see what happens and then compare settings and environments. I KNOW, I KNOW. "I'VE DONE NOTHING DIFFERENT". Look, it is worth the effort to find out why and believe it or not, there may be something you havn't considered...or is their another reason you ask the question in the first place?

borelli34


Report Offensive Follow Up For Removal

Response Number 7
Name: SN
Date: April 14, 2003 at 23:27:01 Pacific
Subject: Classes - PLEASE HELP
Reply: (edit)

I agree wholeheartedly with kev and borelli...How many times have I sworn I've done nothing different, and gotten completely different results (particularly with assembly language), but there's always something I didn't think of, usually small.

I'm noticing that Borland spits out "apsting" instead of "apstring"...Is there a typo somewhere? I'm guessing this isn't copied and pasted from borland, and it's just a typo from the compiler into the forum, but if it's not it could be worth investigating.

Best of Luck,
-SN


Report Offensive Follow Up For Removal

Response Number 8
Name: andrew
Date: April 15, 2003 at 08:40:48 Pacific
Subject: Classes - PLEASE HELP
Reply: (edit)

that was a typo.... but guys heres my theroy. I had a zipped folder. It was Cplus. at school, we have that directory so i made it my home directoy here. i zipped the folder, and it was under xp. so the gfull path was C:\documents and setting\andy\andy's documents\cplus. Now, the directories are the same astheyu used to be. The only thing thats changed is the motherboard/cpu type, and sp1 is in. Now, sp1 for windows xp cant effect anything, becuase i used it under virtaul pc, wndows 98 and 95. Can one of you guys send me a copy of the bc++ 5.02 config file? i am about to try this on my old system. If it is the motherboard/cpu, i will be sooooo pissed... cuz i will have to get of my lazy #@$#%& every time i wana do cpp. peace.


Report Offensive Follow Up For Removal

Response Number 9
Name: andrew
Date: April 15, 2003 at 08:42:45 Pacific
Subject: Classes - PLEASE HELP
Reply: (edit)

i got apstring from filesearching.com, AND... i tried the one i zipped from school. THey are all the same. But this happens with all classes. I am trying to write a GUI os with guilib20, and i thought i was doing somthing wrong, then i figured WTF, i will se if apstring and all my other classes work, and NO classes work! lol... so its not me, and i tried t on other systems.


Report Offensive Follow Up For Removal

Response Number 10
Name: andrew
Date: April 15, 2003 at 08:47:16 Pacific
Subject: Classes - PLEASE HELP
Reply: (edit)

INCLUDING apstring.cpp worked! but were dose that leave me with all the other classes? using .h used to work. I cant fgure out how to get the mouse to work in bgi graphics, and i have a class but i get the same errors with apstring.h. its called mouse.h and mouse.hpp.... well, atlease i know this works, but i am not going to be happy till i know why apstring.h dosnt work here, but it dose on the same comiler on other systems.


Report Offensive Follow Up For Removal

Response Number 11
Name: kev
Date: April 15, 2003 at 13:07:35 Pacific
Subject: Classes - PLEASE HELP
Reply: (edit)

Booya.

I'm telling you, it's just the way your project is set up! I use apstring.h/.cpp as well and I always have to include the .h and then include the .cpp in the project as well. But, if the line #include[apstring.cpp] is in the .h file, then that messes everything up.

It might be possible that the settings on the compiler on one system are different than the settings on the same compiler on a different system, so that might be causing problems.

Kev


Report Offensive Follow Up For Removal

Response Number 12
Name: SN
Date: April 15, 2003 at 13:24:52 Pacific
Subject: Classes - PLEASE HELP
Reply: (edit)

Props to kev.
-SN


Report Offensive Follow Up For Removal

Response Number 13
Name: andrew
Date: April 18, 2003 at 22:19:03 Pacific
Subject: Classes - PLEASE HELP
Reply: (edit)

booya to you too! you dont need the cpp file at school/on my old system... there is a solution somewere anad when i find it... lol.. booya to you!!@#@!#!@#


Report Offensive Follow Up For Removal






Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Classes - PLEASE HELP

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software