Help needed urgently
Login to reply to this topic.
Tue, 2005-12-20 07:32
Joined: 2005-12-20
Forum posts: 18
Hi ,

Greetings From Prakash.A I am working in Sybmian C++ env.. Now I have the following problem.


I have creted a userdefined class "CSocketsEngine" in a seperated file "SocketsEngine.h, .cpp" inside this class I created the function "NewL()" and "NewLC()" both are static fucntions and " ServerName(), SetPort()" these are ordinary functions.

I created the object for this class(CSocketsEngine) in "Socketappui.h" and try to call the above functions in "Socketappui.cpp".

It is compiled properly, but when I tried to build the above code the following error that " LNK 2001, unresolved external public static __this call NewL().." occurs. The same error occurs for "NewLC()" ,"ServerName()" ," SetPort()" these functions also.

I hope some libray files are missing in the .mmp files.. But I dont know the name of that libray file..so can you please tell me the exact library files to be inculded in the project or whether is there any other solutions is avaiable? If so please help me It is needed very urgently please. So please help me..

With Regards,
Prakash.A Sad

Try Try  Try , Until You Die


Tue, 2005-12-20 08:56
Joined: 2005-11-20
Forum posts: 1321
If two of your own classes cannot call each other this is probably not a problem with libraries, but some other problem which is hard to tell without looking at the relevant files. Maybe you can post your .mmp and the relevant parts of the 2 header and the 2 .cpp files here?

And, by the way, isn't everything in one's own life always very urgent? Especially if one needs help? Are you sure that your chances are higher to get an answer if you declare your problem "very urgent"?

René Brunner

Tue, 2005-12-20 09:06
Joined: 2005-08-11
Forum posts: 278
Hi ,
just check in your mmp file whether you've included these libaries or not :

in_sock.h
es_sock.h
..

(by the way please write in the subject wat you are asking..not urgent Help! )
Tue, 2005-12-20 09:23
Joined: 2004-12-03
Forum posts: 276
Did you included SocketsEngine.cpp in the .mmp file? The error is because the linker is not able to find the compiled code of SocketsEngine.cpp...

All the files of the project should be included in the .mmp file.

Dennis

Today is a gift by GOD, that's why it is called the present.

Tue, 2005-12-20 10:44
Joined: 2005-12-20
Forum posts: 18

Thanx dennis,


Ya I included all the .cpp files in .mmp files. But still the error occurs? Plase help me




Try Try  Try , Until You Die

Tue, 2005-12-20 11:56
Joined: 2005-11-20
Forum posts: 1321
So why don't you do now as I adviced you and post the relevant parts of your files here so people at least have a chance to find out what is your problem?

P l e a s e help us help you.

René Brunner

Tue, 2005-12-20 12:02
Joined: 2005-12-20
Forum posts: 18
Hi here,

I have attached the needed files. pleae do the need ful

With Regards,
Prakash.A
AttachmentSize
SocketsEngine.h6 KB
SocketsEngine.cpp9.22 KB

Try Try  Try , Until You Die

Tue, 2005-12-20 12:43
Joined: 2005-11-20
Forum posts: 1321
Well, I see nothing strange. NewL and NewLC are commented-out in the code that you posted, but since you told that the whole thing compiled, this may be some in-between-state of your source when you tried something.

I am not sure whether _LIT can be used outside of any method, like you do with _LIT(KDefaultServerName, "127.0.0.1") but this may be just a lack of my knowledge about Symbian, and has probably nothing to do with your problem.

Quote
I created the object for this class(CSocketsEngine) in "Socketappui.h"

Do you really mean this? You created the object in the .h file? How does this part of your code look like (only the part where you create the object and try to use it, anyway)?

René Brunner

Tue, 2005-12-20 13:37
Joined: 2004-09-14
Forum posts: 140
Can you post the exact error message you are getting as well as the MMP file.

If as you say in the original post you are getting errors with NewL() not being defined then this is correct, you do not have a function called NewL with no parameters, the NewL you defined takes a reference to some callback structure.

The errors almost certainly the result of not including SocketsEngine.cpp in your mmp file.

Paul Todd

Wed, 2005-12-21 04:44
Joined: 2005-12-20
Forum posts: 18
Thanx to pal and rbunner,

Actually in my program the "NewL()" and NewLC() functions are not comment.  After I tried all the possibilities then I sent that the final code. So in that file actually these 2 funcions are not commented.

Here with I have attached the original file. Please do the needful.

And in the .mmp file I included the SocketEngine.cpp file from the beginning onwards.  But the same erros occurs.

Note:
  And onething that If I declar the functions "SePort()" and "ServerName()" as virtual then the errors has gone.  It is the right way to declare as virtual. or any other way is available.?

Please do the needful

With Regards,
Prakash.A
AttachmentSize
SocketsEngine_0.h5.99 KB
SocketsEngine_0.cpp9.22 KB

Try Try  Try , Until You Die

Wed, 2005-12-21 07:07
Joined: 2005-11-20
Forum posts: 1321
My dear, it is really that hard? Please post the .mmp also, as you have been adviced already about 3 times. It's not a secret, that .mmp, or is it? Maybe you included your .cpp file in question there, but in a wrong way, that does not give an error while compiling but results in an error while linking.

And you did not answer my question whether you really tried (or not) to include code in your .h file. It would be really great if you would also post the relevant parts of the files that try to use your SocketsEngine class (the part of the .h and the part of the .cpp that reference it). Just cut and paste them as a part of your next message!

And no, I don't think it will be useful to declare those functions "virtual".

René Brunner

Wed, 2005-12-21 08:02
Joined: 2005-12-20
Forum posts: 18
Hi thanx for your response,

Here with I have attached all the necessary files including .mmp files.  Pleaes do the needful.

With Regards,
Prakaskh.A
AttachmentSize
Socket3.mmp1.48 KB
incsrc.zip22.19 KB

Try Try  Try , Until You Die

Wed, 2005-12-21 08:40
Joined: 2005-11-20
Forum posts: 1321
Thanks for the files.

Right now I am at work where I cannot compile Symbian projects. Probably this evening I will be able to do this.

But from my first look at your files, a question: Why are TimeOutNotifier.cpp and TimeOutTimer.cpp not in your .mmp file? You seem to use them, so you need them as well in your list of .cpp files in the .mmp file, if you ask me.

René Brunner

Wed, 2005-12-21 09:41
Joined: 2005-12-20
Forum posts: 18
Thanx rBrunner,

As I am very stranger to Symbian I am very struggle to do this. I am also try my best to make this as a successful thing..

With Regards,
Prakash.A

Try Try  Try , Until You Die

Wed, 2005-12-21 10:01
Joined: 2004-09-14
Forum posts: 140
I had a quick compile of the code.

A link error is being generated by the CSocketsAppViewL::NewL being commented out, not by the Socket engine's NewL.

Removing virtual has no effect.
I commented out the CAknGlobalNote in ErrorNotify and the timer code and it all seems to build okay.

I suggest you do a clean and then a full rebuild or reimport the mmp file back into the IDE

Paul Todd

Wed, 2005-12-21 10:51
Joined: 2005-12-20
Forum posts: 18
Thanx Paul,


If the things is OK.

can you please send the correct code...

Please


With Regards,
Prakash.A

Try Try  Try , Until You Die


copyright 2003-2009 NewLC SARL