|
From: Santiago P. C. <San...@yd...> - 2002-10-10 08:13:19
|
Hi Greg,
You should NOT include a '.cpp' file within another '.cpp' file (this is, of
course, valid for main.cpp also), you should only include "header" files:
'.h'/'.hpp'/'.hxx'/... These are files for class/functions/types/...
definitions, and '.cpp'/'.c' files are for class/functions/...
implementation.
So, I think your problem is that 'apstring' class definition is in
'apstring.h'/'apstring.hpp'/apstring.hxx'/whatever file, but NOT in
'apstring.cpp' file (remember: that file should contain the implementation,
but not the definition).
So you should include the appropriate header file and add the 'apstring.cpp'
file to the project (within Dev-C++ environment).
OTOH, you should:
1st -
Use the line
#include <iostream> // C++ style
Instead of using
#include "iostream.h" // C style for NON-SYSTEM headers
2nd -
Return some value from main function... It is declared as 'int main()'.
Hope this helps,
Santy
-----Original Message-----
From: Gregory Hart [mailto:gr...@fr...]
Sent: jueves, 10 de octubre de 2002 1:29
To: dev...@li...
Subject: [Dev-C++] Apstring
I'm having trouble using apstring in Dev-C++. My code is: #include
"iostream.h" #include "apstring.cpp"
int main ()
{
apstring testString = "test";
if (testString == "test"){
cout << apstring
}
}
I get 6 C:\Dev-Cpp\projects\irs\test.cpp `apstring' undeclared (first use
this function). When I put apsting.cpp into the function, the first error is
the ::. Any suggestions? -Greg
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf _______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
--------------------------------------------------------------------------------------
This message and any files transmitted with it are confidential and intended solely
for the use of the individual or entity to whom they are addressed. No confidentiality
or privilege is waived or lost by any wrong transmission.
If you have received this message in error, please immediately destroy it and kindly
notify the sender by reply email.
You must not, directly or indirectly, use, disclose, distribute, print, or copy any
part of this message if you are not the intended recipient. Opinions, conclusions and
other information in this message that do not relate to the official business of
Ydilo Advanced Voice Solutions, S.A. shall be understood as neither given nor endorsed by it.
--------------------------------------------------------------------------------------
|
|
From: Santiago P. C. <San...@yd...> - 2002-10-10 08:40:22
|
Hi again Greg,
I forgot to tell you that the following statement is wrong:
cout << apstring // ???
1st - apstring is a class, isn't it? So you can not use it like an object,
it is 'a type of object' but NOT an object itself.
2nd - you must output something valid and fully informational (a greeting,
an error string, or something).
3rd - you must end the statement with ';' if you want to avoid compiler
errors.
BTW, it should be fine also if you put the statement
using namespace std;
after your '#include' statements.
Just my 2 cents!
Best regards,
Santy
-----Original Message-----
From: Gregory Hart [mailto:gr...@fr...]
Sent: jueves, 10 de octubre de 2002 1:29
To: dev...@li...
Subject: [Dev-C++] Apstring
I'm having trouble using apstring in Dev-C++. My code is: #include
"iostream.h" #include "apstring.cpp"
int main ()
{
apstring testString = "test";
if (testString == "test"){
cout << apstring
}
}
I get 6 C:\Dev-Cpp\projects\irs\test.cpp `apstring' undeclared (first use
this function). When I put apsting.cpp into the function, the first error is
the ::. Any suggestions? -Greg
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf _______________________________________________
Dev-cpp-users mailing list
Dev...@li...
TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
--------------------------------------------------------------------------------------
This message and any files transmitted with it are confidential and intended solely
for the use of the individual or entity to whom they are addressed. No confidentiality
or privilege is waived or lost by any wrong transmission.
If you have received this message in error, please immediately destroy it and kindly
notify the sender by reply email.
You must not, directly or indirectly, use, disclose, distribute, print, or copy any
part of this message if you are not the intended recipient. Opinions, conclusions and
other information in this message that do not relate to the official business of
Ydilo Advanced Voice Solutions, S.A. shall be understood as neither given nor endorsed by it.
--------------------------------------------------------------------------------------
|
|
From: Daniel G. <sp...@ho...> - 2002-10-10 17:14:21
|
I think we need to see apstring.cpp
I don't think you've declared apstring as a class in a header file have you?
>From: "Gregory Hart" <gr...@fr...>
>Reply-To: "Gregory Hart" <gr...@fr...>
>To: <dev...@li...>
>Subject: [Dev-C++] Apstring
>Date: Wed, 9 Oct 2002 16:28:49 -0700
>
>I'm having trouble using apstring in Dev-C++. My code is:
>#include "iostream.h"
>#include "apstring.cpp"
>
>int main ()
>{
> apstring testString = "test";
> if (testString == "test"){
> cout << apstring
> }
>}
>I get 6 C:\Dev-Cpp\projects\irs\test.cpp `apstring' undeclared (first use
>this function).
>When I put apsting.cpp into the function, the first error is the ::.
>Any suggestions?
>-Greg
>
>
>
>
>-------------------------------------------------------
>This sf.net email is sponsored by:ThinkGeek
>Welcome to geek heaven.
>http://thinkgeek.com/sf
>_______________________________________________
>Dev-cpp-users mailing list
>Dev...@li...
>TO UNSUBSCRIBE: http://www.noicys.cjb.net/devcpp/ub.htm
>https://lists.sourceforge.net/lists/listinfo/dev-cpp-users
_________________________________________________________________
MSN Photos is the easiest way to share and print your photos:
http://photos.msn.com/support/worldwide.aspx
|