Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
?
Solved

compiles in one place, not in another

Posted on 2004-11-09
8
Medium Priority
?
309 Views
Last Modified: 2013-12-03
I've downloaded an opensource library (pwlib from voxgratia.org, in case you're curious).  It's a little complicated to get compiling, but I eventually got it working.  Now, I'm trying to build a library of my own (in Visual Studio .NET) using this library.  When I try to compile my library, I get a compile error caused in pwlib.  Actually, I get a lot of compile errors.  Typical "I can't figure out what this object is" sort of compiler errors (not linker errors, at not least yet).  I've set the following under Librarian->General->Additional Dependencies:
openh323d.lib ptlibd.lib ptclibd.lib ptlibsd.lib

Any suggestions?
0
Comment
Question by:rwinkler
  • 4
  • 4
8 Comments
 
LVL 16

Expert Comment

by:nonubik
ID: 12543356
>I've set the following under Librarian->General->Additional Dependencies:
>openh323d.lib ptlibd.lib ptclibd.lib ptlibsd.lib

This is the linking part. You're getting compiling errors (which is before linking).
It seems that you need to include some headers in order to "figure out what this object is". Please post some compile errors to get more help.
0
 
LVL 1

Author Comment

by:rwinkler
ID: 12544481
Although you are correct that this seems to be a compile error, I can move my C++ class into one of the sample projects provided with the openh323 library (which is why I'm using pwlib... openh323 needs it) and it compiles just fine.  In fact, my class is just a modification of one provided in the openh323 samples.

I don't have the exact errors in front of me at the moment (I'm at home at the moment), but the first one was something to the effect of:
PObject unrecognized class

If you really think it would help, I'll post part of the compile error list, but I'm skeptical that it will be useful.
0
 
LVL 16

Expert Comment

by:nonubik
ID: 12544757
If you are so skeptical, maybe it just need some 'Additional Include directories' to be set in the settings, maybe the wrong headers with the same name are included.
But this would raise "could not open xxx.h file" error....
0
Restore individual SQL databases with ease

Veeam Explorer for Microsoft SQL Server delivers an easy-to-use, wizard-driven interface for restoring your databases from a backup. No expert SQL background required. Web interface provides a complete view of all available SQL databases to simplify the recovery of lost database

 
LVL 1

Author Comment

by:rwinkler
ID: 12550345
I thought that may have had merit, but the additional include directories are both the same (completely empty).  All those college courses on programming, but not one even offered on how to get IDE's to do what you want.  Bah.
0
 
LVL 16

Expert Comment

by:nonubik
ID: 12553178
Still, by posting the errors, you may get more help..
0
 
LVL 1

Author Comment

by:rwinkler
ID: 12554500
There's more where this came from, but here's about the first fifth of the output (it maxes out after about 100 errors):
c:\dev\pwlib\include\ptclib\dtmf.h(34) : error C2504: 'PObject' : base class undefined
c:\dev\pwlib\include\ptclib\dtmf.h(35) : error C2061: syntax error : identifier 'PObject'
c:\dev\pwlib\include\ptclib\dtmf.h(37) : error C2143: syntax error : missing ';' before 'public'
c:\dev\pwlib\include\ptclib\dtmf.h(37) : warning C4183: 'PCLASSINFO': missing return type; assumed to be a member function returning 'int'
c:\dev\pwlib\include\ptclib\dtmf.h(39) : error C2146: syntax error : missing ';' before identifier 'Decode'
c:\dev\pwlib\include\ptclib\dtmf.h(39) : error C2501: 'PDTMFDecoder::PString' : missing storage-class or type specifiers
c:\dev\pwlib\include\ptclib\dtmf.h(39) : error C2061: syntax error : identifier 'PINDEX'
c:\dev\pwlib\include\ptclib\dtmf.h(39) : warning C4183: 'Decode': missing return type; assumed to be a member function returning 'int'
c:\dev\pwlib\include\ptlib\semaphor.h(126) : error C2226: syntax error : unexpected type 'BOOL'
c:\dev\pwlib\include\ptlib\semaphor.h(126) : error C2238: unexpected token(s) preceding ';'
c:\dev\pwlib\include\ptlib\semaphor.h(137) : error C2143: syntax error : missing ';' before '&'
c:\dev\pwlib\include\ptlib\semaphor.h(137) : error C2501: 'PWaitAndSignal::PSemaphore' : missing storage-class or type specifiers
c:\dev\pwlib\include\ptlib\semaphor.h(137) : error C2501: 'PWaitAndSignal::semaphore' : missing storage-class or type specifiers
c:\dev\pwlib\include\ptlib\semaphor.h(175) : error C2504: 'PObject' : base class undefined
c:\dev\pwlib\include\ptlib\semaphor.h(176) : error C2061: syntax error : identifier 'PObject'
c:\dev\pwlib\include\ptlib\semaphor.h(176) : warning C4183: 'PCLASSINFO': missing return type; assumed to be a member function returning 'int'
c:\dev\pwlib\include\ptlib\semaphor.h(214) : error C2143: syntax error : missing ',' before '&'
c:\dev\pwlib\include\ptlib\mutex.h(99) : warning C4183: 'PCLASSINFO': missing return type; assumed to be a member function returning 'int'
c:\dev\pwlib\include\ptlib\channel.h(191) : error C2504: 'streambuf' : base class undefined
0
 
LVL 16

Accepted Solution

by:
nonubik earned 1000 total points
ID: 12554532
>c:\dev\pwlib\include\ptclib\dtmf.h(34) : error C2504: 'PObject' : base class undefined

Seems the PObject class is not defined before dtmf.h is included.
Try to include the definition file of PObject class in the dtmf.h file or wherever the dtmf.h is included (right above it).
0
 
LVL 1

Author Comment

by:rwinkler
ID: 12555583
This is where I was saying, it compiles fine by itself.  And in all the sample projects.  Then again, I don't compile all of the pwlib projects to build the libs (as per the instructions) and some of the others don't actually compile.  I figured they weren't important for the usage of pwlib.  Maybe that's where the problem lies.  It's only when I create a new project and try to use the library (and, apparently, something that doesn't) that I get this error.  Modifying the library ~shouldn't~ be the solution.  Especially since it compiles fine in other projects.  

On the other hand, I posted to the openh323 newsgroup, and they said the same thing.  It worked.  I guess I should have given that a try before posting.  Ah, the complexities of it all.  I hope they fix that in the next source dist.  Thanks for the help.

in case someone finds this solution useful, this is the include necessary:
#include <ptlib.h>
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This article shows a few slightly more advanced techniques for Windows 7 gadget programming, including how to save and restore user settings for your gadget and how to populate the "details" panel that is displayed in the Windows 7 gadget gallery.  …
With most software applications trying to cater to multiple user needs nowadays, the focus is to make them as configurable as possible. For e.g., when creating Silverlight applications which will connect to WCF services, the service end point usuall…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

581 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question