Puppy Linux Discussion Forum Forum Index Puppy Linux Discussion Forum
Puppy HOME page : puppylinux.com
"THE" alternative forum : puppylinux.info
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

The time now is Fri 25 Apr 2014, 05:00
All times are UTC - 4
 Forum index » Off-Topic Area » Programming
Declaration for an object? [Solved]
Post new topic   Reply to topic View previous topic :: View next topic
Page 1 of 1 [4 Posts]  
Author Message
tasmod


Joined: 04 Dec 2008
Posts: 1461
Location: North Lincolnshire. UK

PostPosted: Wed 11 Aug 2010, 16:54    Post subject:  Declaration for an object? [Solved]  

EDIT: See next post.

Trust that is correct title?

I've reached the point where a compiling error is now referencing an .h custom library which has me baffled for now. I'm not familiar yet with what is happening with the error messages in the compiler regarding a library.
Anyway here's a contracted description.

Instructions with the library are to add a line to the 'int main' function thus:
Code:
  psession* mysession;


where mysession is an object(?)

There is a struct in the library:

Code:
typedef struct { blah blah blah } psession;



Now, I have a function that uses mysession so I figured that the psession* mysession should be in that function (all examples supplied with the library use 'main')

That threw up an error during compiling about undefined references in the library.
Putting it back in 'main' then only threw up one error, 'mysession' undeclared, in my code 'function'.

Now, I'm not sure how to declare it. I've tried finding help references through the 'net regarding
Code:
 blah* blah2
shall we say,but I have had no joy.

None of the examples supplied with the library use anything but a code sample using 'int main' only.
There are executables of each example and the corresponding .c file to go with it.

Interestingly trying to compile an example .c file threw up just such a first error regarding undefined referencing to the library call functions (i.e. functions in library, not in the code)???
Yet the example executables work?

Anyone any ideas from this cryptic clue puzzle?

_________________
Rob
-
The moment after you press "Post" is the moment you actually see the typso Cool

Last edited by tasmod on Sat 14 Aug 2010, 09:47; edited 1 time in total
Back to top
View user's profile Send private message Visit poster's website 
tasmod


Joined: 04 Dec 2008
Posts: 1461
Location: North Lincolnshire. UK

PostPosted: Thu 12 Aug 2010, 05:28    Post subject:  

Well a complete change.

Reading the one page text manual I realised the sample code line calling 'mysession' was different to the manual.

the manual had

Code:
err = pbegin(vertoo, blutoo, lamp, psession** &mysession);


Where the sample code had ' psession** ' missing.

So, I inserted the ' psession** ' into my function err line and also added the line
Code:
psession* mysession
in my function instead of in 'int main'

Now it errors in compiler with the message " expected expression before psession** "

_________________
Rob
-
The moment after you press "Post" is the moment you actually see the typso Cool
Back to top
View user's profile Send private message Visit poster's website 
tasmod


Joined: 04 Dec 2008
Posts: 1461
Location: North Lincolnshire. UK

PostPosted: Thu 12 Aug 2010, 18:50    Post subject:  

OK, code is incorrect in manual but correct in examples.

popsession** is not needed in the line.

The rest of my compile errors are down to the compiler not recognising the lib? Or my ineptitude in using it!

This according to the helpful guys on the C forum.

Aren't compiler error messages so descriptive, NOT !!!

_________________
Rob
-
The moment after you press "Post" is the moment you actually see the typso Cool
Back to top
View user's profile Send private message Visit poster's website 
tasmod


Joined: 04 Dec 2008
Posts: 1461
Location: North Lincolnshire. UK

PostPosted: Fri 13 Aug 2010, 06:22    Post subject:  

OK for any readers interested. It was a compiling error. Although erroneous documentation doesn't help.

The library I intended to use had multiple compiling options at creation and I had chosen the wrong one. It left out of the library some of the functions I was calling. Embarassed

Recompiled the library to suit and my app compiles without error.

_________________
Rob
-
The moment after you press "Post" is the moment you actually see the typso Cool
Back to top
View user's profile Send private message Visit poster's website 
Display posts from previous:   Sort by:   
Page 1 of 1 [4 Posts]  
Post new topic   Reply to topic View previous topic :: View next topic
 Forum index » Off-Topic Area » Programming
Jump to:  

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group
[ Time: 0.0428s ][ Queries: 12 (0.0043s) ][ GZIP on ]