Building a PJSIP project: VC++ 2008 can't find isalnum, isalpha, etc.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Alan,

Many thanks for your detailed explanation.
Since the SDKs get installed "in parallel" in C:\Program
Files\Microsoft SDKs\Windows,
how does PJSIP or other things that use the MS Windows Platform SDK
recognize which one to use, and how can I make sure that the correct
one will be used?
Do you have any idea why I am getting all these linker errors now?

Best regards,
George

---------- Original message ----------
From: Alan J. Bond <alan.bond@xxxxxxxxxxxxx>
Date: Fri, Jun 13, 2008 at 10:09 PM
Subject: Re: Building a PJSIP project: VC++ 2008 can't find
isalnum, isalpha, etc.
To: pjsip list <pjsip at lists.pjsip.org>

>> Is that right?
No,

The SDK in question is Windows SDK for Windows 2008 (6001.18000.367)
From: http://www.microsoft.com/downloads/details.aspx?familyid=E6E1C3DF-A74F-4207-8586-711EBE331CDC&displaylang=en
(please note this may no longer point to the same file I downloaded a
couple of weeks ago but probably does)

It installs in C:\Program Files\Microsoft SDKs\Windows\v6.1

You are using the Vista update to 6.0, which from what you say does
not have this problem so please ignore this.

For anyone else encountering this, the PJSIP project will not build
with this SDK version until iphlpapi.h is corrected.  Nor will
anything else using iphlpapi.h with _WIN32_WINNT defined as 0x4000.
It will throw up at this point in iphlpapi.h

#if (NTDDI_VERSION >= NTDDI_XP)
ULONG
WINAPI
GetIpStatisticsEx(
   OUT PMIB_IPSTATS Statistics,
   IN ULONG Family
   );

... complaining that PMIB_IPSTATS is undefined.  This is because it
erroneously enters this #if block because NTDDI_XP (which should be
NTDDI_WINXP) is undefined.  The NTDDI_xxx symbols are all defined in
sdkddkver.h

You are having problems building apps outside the scope of the
PJPROJECT, I apologise for not picking up your main thrust initially.
I do not use the approach at the link you provide. Instead I create a
separate directory with traditional include and lib subdirectories
into which I copy the headers and lib files from the PJPROJECT
directory using a simple script, renaming them to their base names in
the process (with d suffix for debug variants per VC conventions) and
flattening out the header structure as much as possible.

I then reference this include and lib directory in app development
projects.  This provides a useful buffer between apps and things
changing at the library level and avoids a lot of the
naming/subdirectory confusion.

For apps I put what I need in a pre-compiled header in the normal VC
manner, complete with #ifdef _DEBUG dependent #pragma comment(lib,)
statements for libraries instead of messing around in project settings
dialogs.  This makes it easier to carry over all this stuff from one
project to another.

In view of this personal approach it's best I stay out of this discussion.

Rgds,
Alan.

-----Original Message-----
From: pjsip-bounces@xxxxxxxxxxxxxxx
[mailto:pjsip-bounces at lists.pjsip.org] On Behalf Of G Orley
Sent: 13 June 2008 20:31
To: pjsip list
Subject: Re: Building a PJSIP project: VC++ 2008 can't find
isalnum, isalpha, etc.

Hi Alan,

Is that right? Although it is my very best determination, it is the
result of a sufficient number of suppositions, that although each
supposition seems reasonable, I am not at all comfortable
that it is right. Please confirm.

Best regards,
George

---------- Original message ----------
From: G Orley <geo.orley@xxxxxxxxx>
Date: Fri, Jun 13, 2008 at 4:18 PM
Subject: Re: Building a PJSIP project: VC++ 2008 can't find
isalnum, isalpha, etc.
To: pjsip list <pjsip at lists.pjsip.org>

Hi Alan,

I just downloaded the latest Windows Platform SDK, ver
6.1.6000.16384.10, from
http://www.microsoft.com/downloads/details.aspx?FamilyID=ff6467e6-5bba-4bf5-b562-9199be864d29&DisplayLang=en
,
and installed it, but did not find a line reading
#if (NTDDI_VERSION >= NTDDI_XP)
in IPHlpApi.h in
C:\Program Files\Microsoft SDKs\Windows\v6.0\Include\ IPHlpApi.h .
I did find a line reading:
#if (NTDDI_VERSION >= NTDDI_XPSP1), however. Is that the one that
should be changed to #if (NTDDI_VERSION >= NTDDI_WINXPSP1),
I guess?
Also, for some reason, the install folder is v6.0, which is odd, given
that I just downloaded and installed 6.1.6000.16384.10. I already
had a v6.0A folder. I did have a line or lines reading
#if (NTDDI_VERSION >= NTDDI_XPSP1)
in IPHlpApi.h in
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\ IPHlpApi.h .
Could those have been changed to #if (NTDDI_VERSION >= NTDDI_WINXPSP1)
if I had been fast enough on the uptake before doing the install of the
latest Windows Platform SDK?

I'll try changing my lines reading "#if (NTDDI_VERSION >= NTDDI_XPSP1)"
to #if (NTDDI_VERSION >= NTDDI_WINXPSP1)...

Best regards,
George

---------- Original message ----------
From: G Orley <geo.orley@xxxxxxxxx>
Date: Fri, Jun 13, 2008 at 1:01 PM
Subject: Re: Building a PJSIP project: VC++ 2008 can't find
isalnum, isalpha, etc.
To: pjsip list <pjsip at lists.pjsip.org>

Hi Alan,

My Platform SDK, or MS Windows SDK, is v6.0A . I found
IPHlpApi.h in
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Include\ IPHlpApi.h .
I also have
C:\Program Files\Microsoft SDKs\Windows\v5.0\Include\ IPHlpApi.h .

My DirectX is 9.22.1284, March 2008.
I downloaded dxsdk_march2008.exe and renamed it right away
to dxsdk_ver_9.22.1284_march2008.exe, so the original
"dxsdk_march2008.exe" name is from my memory.

I don't seem to have that typo in iphlpapi.h
The lines I have that begin with "#if (NTDDI_VERSION" are
#if (NTDDI_VERSION >= NTDDI_LONGHORN)
#if (NTDDI_VERSION < NTDDI_LONGHORN)
#if (NTDDI_VERSION >= NTDDI_WIN2K)
#if (NTDDI_VERSION >= NTDDI_XPSP1)
#if (NTDDI_VERSION >= NTDDI_WIN2KSP1)

I did create config_site.h; the build of the PJSIP 0.8.0 download
required it; I did the complete build of PJSIP pjproject-0.8.0
and all its applications, sample projects, etc., successfully,
before starting this thread. Now I'm trying a project/application
of my own (see http://www.pjsip.org/using.htm#using ).

Best regards,
George

---------- Original message ----------
From: Alan J. Bond <alan.bond@xxxxxxxxxxxxx>
Date: Fri, Jun 13, 2008 at 3:49 AM
Subject: Re: Building a PJSIP project: VC++ 2008 can't find
isalnum, isalpha, etc.
To: pjsip list <pjsip at lists.pjsip.org>

George,

I use VC++ 2008 also and had a few problems like this with 0.8.0.

I've just done a complete refresh from trunk.  I copied
config_site_sample.h to config_site.h (which is effectively the same
as just creating a blank file), opened the VC8 project, ran through
conversion to VC9 and it built without change.  test_pjsip gave me
it's usual encouraging message :-).

This was trunc at changeset 2014

What version Platform SDK and DirectX SDK are you using?

In Platform SDK Version 6.1 (the latest AFAIK) there is a typo in
iphlpapi.h as follows:

#if (NTDDI_VERSION >= NTDDI_XP)

... should read

#if (NTDDI_VERSION >= NTDDI_WINXP)

Rgds,
Alan.

-----Original Message-----
From: pjsip-bounces@xxxxxxxxxxxxxxx
[mailto:pjsip-bounces at lists.pjsip.org] On Behalf Of G Orley
Sent: 12 June 2008 23:11
To: pjsip list
Subject: Re: Building a PJSIP project: VC++ 2008 can't find
isalnum, isalpha, etc.

Hi Jim,

Thanks for that; what you have sent certainly seem like
things that might make it work. I'd also like to thank Benny
for that link way down the page
( http://www.pjsip.org/using.htm#using )
that contained useful
instructions that certainly appeared to be up the right alley:
"8. Using PJPROJECT with Applications" -- perhaps that
could be retitled or subtitled, in full caps: "VITAL
INFORMATION YOU NEED TO KNOW TO BUILD WITH
*YOUR* COMPILER". Without his post, it would have
been a long time indeed before I would have thought to
scroll down so far and then check to see if there was
any useful information under such a title. Human nature,
I guess -- can anything be done to make all this information
less overwhelming and point people to what they need to
know without having to read everything in detail? Obviously
not an easy thing to do.

However, it still doesn't compile; I'm still getting about the
same number of errors (88 now). The only thing left to
try is duplicating your command line in detail and that
seems pretty tedious.
I wonder if you could just email me your working solution
in a zip file, with nothing in your source but a call to some
PJSIP function, to preserve the confidentiality of your
work. Then I could compare a lot of details that would
be tedious for you to find and explain.
However, understanding is important, and I will probably
still go over each compile option in the command line.
Still, that might end up barking up the wrong tree, when
a small declaration who-knows-where in your setup might
be just the thing. If I could see your whole solution, I
might spot some difference where I didn't think to look
before.

Best regards,
George

---------- Original message ----------
From: Jim Gomes <Jim.Gomes@xxxxxxxxxxxxx>
Date: Thu, Jun 12, 2008 at 5:15 PM
Subject: Re: Building a PJSIP project: VC++ 2008 can't find
isalnum, isalpha, etc.
To: pjsip list <pjsip at lists.pjsip.org>

Hi George,

Since you are starting from the ground up, I suspect that you may not
have the proper config_site.h stuff set up.  Try this:

At the _very_ beginning of your source file (before the header
#include's) add the following:

#define PJ_HAS_CTYPE_H  1

If that doesn't work, change the #define to 0.

Regards,
Jim Gomes

> -----Original Message-----
> From: pjsip-bounces@xxxxxxxxxxxxxxx
[mailto:pjsip-bounces at lists.pjsip.org] On Behalf Of
> G Orley
> Sent: Thursday, 12 June, 2008 12:25 PM
> To: pjsip list
> Subject: Re: Building a PJSIP project: VC++ 2008 can't find
isalnum,isalpha, etc.
>
> I should also mention that previous to my original message in this
> thread, I successfully built the entire PJSIP download, including
> pjsip_simple. The only trick there was installing DirectX so that
> dsound.h was found. There I used the VS 2008 solution that was
> included with the download of PJSIP. Now I'm trying to create my
> own VS 2008 solution from scratch (creating that Win32 console
> application) and build-in the PJSIP libraries. I was inspired by
> the page "Getting started 2":
> http://trac.pjsip.org/repos/wiki/Getting_Started_Using --
> It is actually titled "Building Application using PJSIP with GNU
Tools"
> when you bring up the page and the only line of any relevance,
> at all, to VS 2008 seemed to be
> "2. Create a directory outside the PJSIP sources for your project and
> place your source files there."
> Hence I thought I would stumble along, creating my own VS 2008
> solution using the VS 2008 project/solution creation wizard from
> File - New - Project totally from scratch, just specifying the paths
> to the PJSIP header files and libraries.
>
> So I wonder if I should instead, open up the PJSIP solution that
> it came with and that I previously had success with, and try adding
> my project within *that* context? I think I'll give that a shot.
> As has been commented on the PJSIP website, there certainly isn't
> a lot of "for dummies" information available about this...
> As usual, there are obviously many approaches that will mess up,
> but only one or two that will work. It's amazing the many creative
ways
> that people will find to mess up...
>
> I guess I should ask: what is the correct approach to building a
> PJSIP project with VS 2008?
>
> Best regards,
> George
>
> ---------- Original message ----------
> From: G Orley <geo.orley@xxxxxxxxx>
> Date: Thu, Jun 12, 2008 at 3:12 PM
> Subject: Re: Building a PJSIP project: VC++ 2008 can't find
> isalnum, isalpha, etc.
> To: pjsip list <pjsip at lists.pjsip.org>
>
> I should mention that the only modifications I made to my
> solution after creating the Win32 Console project was to add
> those PJSIP include and library paths in VC++ 2008
> Project - Properties (Alt+F7) - Configuration
> Properties - C/C++ - General - "Additional Include Directories",
> as shown in my original message "Sent: Thursday, 12 June,
> 2008 9:06 AM".
> I have previously successfully built many VC++ 2008
> projects with the same computer setup that I have now,
> but this is my first time trying to include the PJSIP
> libraries.
>
> ---------- Original message ----------
> From: G Orley <geo.orley@xxxxxxxxx>
> Date: Thu, Jun 12, 2008 at 2:52 PM
> Subject: Re: Building a PJSIP project: VC++ 2008 can't find
> isalnum, isalpha, etc.
> To: pjsip list <pjsip at lists.pjsip.org>
>
> Hi Jim,
>
> >I'm trying to figure out which project
> >you are compiling, but it's not clear from your original message.
>
> I also created my own custom self-maintained project.
> The solution and project name are both PJSIP080612, and my .cpp file
is
> also called PJSIP080612.cpp. It is made from selected copy-
> and-pastes from pjproject-0.8.0\pjsip-apps\src\samples\ simpleua.c ; I
am
> only after the PJMedia code. The entire listing of PJSIP080612.cpp
> is shown in my original message; I created no .h files or other
> source files. I made it a Win32 console project, only intended
> to run in a DOS Window/Command prompt, if I can ever get
> it to compile!
> My project was in C:\Documents and Settings\
>  User\My
Documents\Xxxxxx\XXXX_XXX_XXX\_My_VS2008_projects\PJSIP080612\ .
> and I had PJSIP in C:\Documents and Settings\User\My
> Documents\Xxxxxx\XXXX_XXX_XXX\pjproject-0.8.0\ .
> I moved my PJSIP080612 "solution" (to be
> precise) to C:\Projects that I created and PJSIP (that is,
> the pjproject-0.8.0 folder) to C:\SomeLibs\ that I also created,
> making the modifications to the paths in
> Project - Properties (Alt+F7) - Configuration
> Properties - C/C++ - General - "Additional Include Directories",
> but got exactly the same results. Then I moved my
> PJSIP080612 solution folder to be a subdir of pjproject-0.8.0,
> (i.e., right in the pjproject-0.8.0 folder), fixing up the paths
> in Project - Properties (Alt+F7) - Configuration
> Properties - C/C++ - General - "Additional Include Directories"
> again (this time using relative paths), but still got exactly
> the same results of 83 errors.
>
> I'm now going to go over the settings that you sent, to
> see if I can adopt them.
>
> Could you email me your whole solution, in a "zip" file,
> so that I can work from your settings? Of course, please
> cut down your source to maybe just one PJSIP API call
> that still compiles, so that you don't divulge your
> confidential work.
>
> Thanks so much for your assistance.
>
> Best regards,
> George
>
> ---------- Original message ----------
> From: Jim Gomes <Jim.Gomes@xxxxxxxxxxxxx>
> Date: Thu, Jun 12, 2008 at 1:54 PM
> Subject: Re: Building a PJSIP project: VC++ 2008 can't find
> isalnum, isalpha, etc.
> To: pjsip list <pjsip at lists.pjsip.org>
>
> Hi,
>
> I also compile with VS2008, and I have created my own custom
> self-maintained project files.  I'm trying to figure out which project
> you are compiling, but it's not clear from your original message.  So,
> I'll just start with some general trouble-shooting advice based on the
> assumption that you are building pjsip_simple.
>
> My pre-processor definitions are as follows:
>
> Debug:  _DEBUG;PJ_WIN32=1;PJ_M_I386=1;WIN32;_LIB;PJ_CONFIG_DEBUG
>
> Release: NDEBUG;PJ_WIN32=1;PJ_M_I386=1;WIN32;_LIB;PJ_CONFIG_SHIPPING
>
> Here is my entire command line:
>
> /O2 /Ob2 /Oi /Ot /GL /I "../include" /I "../../pjlib-util/include" /I
> "../../pjlib/include" /D "NDEBUG" /D "PJ_WIN32=1" /D "PJ_M_I386=1" /D
> "WIN32" /D "_LIB" /D "PJ_CONFIG_SHIPPING" /D "_VC80_UPGRADE=0x0600" /D
> "_MBCS" /GF /FD /EHsc /MD /Gy
/Fp"Release\pjsip_simple\pjsip_simple.pch"
> /Fo"Release\pjsip_simple\\" /Fd"Release\pjsip_simple\vc90.pdb" /W3
> /nologo /c /Gz /TP /errorReport:prompt
>
> You can compare that to your entire command-line, and if you have
> questions as to which property pages turn on which option, then we can
> go through each setting.
>
> Regards,
> Jim Gomes
>
> > -----Original Message-----
> > From: pjsip-bounces@xxxxxxxxxxxxxxx
> [mailto:pjsip-bounces at lists.pjsip.org] On Behalf Of
> > G Orley
> > Sent: Thursday, 12 June, 2008 9:06 AM
> > To: pjsip at lists.pjsip.org
> > Subject: Building a PJSIP project: VC++ 2008 can't find
> isalnum,isalpha, etc.
> >
> > Hi All,
> >
> > I'm having trouble with #includes, seemingly, to find the library
> functions
> > needed by \pjproject-0.8.0\pjlib\include\pj\ctype.h . The compiler
> can't
> > find isalnum, isalpha, etc.
> >
> > I'm using Visual Studio 2008 (Windows XP SP2) . My project is in
> > C:\Documents and Settings\User\My
> > Documents\Xxxxxx\XXXX_XXX_XXX\_My_VS2008_projects\PJSIP080612\ .
> >
> > I've put PJSIP in
> > C:\Documents and Settings\User\My
> Documents\Xxxxxx\XXXX_XXX_XXX\pjproject-
> > 0.8.0\
> >
> > in VS 2008 (VC++ 2008) Project - Properties (Alt+F7) - Configuration
> > Properties - C/C++ -
> > General - "Additional Include Directories" I've added the following:
> > (which made a major
> > improvement in getting as far as I have)
> >
> > C:\Documents and Settings\User\My
> > Documents\Xxxxxx\XXXX_XXX_XXX\pjproject-0.8.0\pjsip\include
> > C:\Documents and Settings\User\My
> > Documents\Xxxxxx\XXXX_XXX_XXX\pjproject-0.8.0\pjsip\lib
> > C:\Documents and Settings\User\My
> > Documents\Xxxxxx\XXXX_XXX_XXX\pjproject-0.8.0\pjmedia\include
> > C:\Documents and Settings\User\My
> > Documents\Xxxxxx\XXXX_XXX_XXX\pjproject-0.8.0\pjmedia\lib
> > C:\Documents and Settings\User\My
> > Documents\Xxxxxx\XXXX_XXX_XXX\pjproject-0.8.0\pjlib-util\include
> > C:\Documents and Settings\User\My
> > Documents\Xxxxxx\XXXX_XXX_XXX\pjproject-0.8.0\pjlib-util\lib
> > C:\Documents and Settings\User\My
> > Documents\Xxxxxx\XXXX_XXX_XXX\pjproject-0.8.0\pjlib\include
> > C:\Documents and Settings\User\My
> > Documents\Xxxxxx\XXXX_XXX_XXX\pjproject-0.8.0\pjlib\lib
> > C:\Documents and Settings\User\My
> > Documents\Xxxxxx\XXXX_XXX_XXX\pjproject-0.8.0\pjlib\include\pj
> >
> > I tried adding the following includes as in the listing that
follows:
> >
> > #include <ctype.h>    // attempt for isalnum()
> > #include <tchar.h>    // attempt for isalnum()
> > #include <locale>     // attempt for isalnum()
> > #include <stdlib> , stdlib.h.
> >
> > -but they didn't help clear up any errors, seemingly (maybe some
> > changes further down, but not
> > to the first few compile errors).
> >
> > Please see the program listing and build log output, below. How can
I
> > clean up these first few
> > errors? The code is selected from the example in
> > pjproject-0.8.0\pjsip-apps\src\samples\ simpleua.c .
> >
> > Best regards,
> > -George
> >
> > --------------------------Program listing--------------------------
> [snip]
> > --------------------------Program listing--------------------------
> > --------------------------build log--------------------------
> [snippety]
> > --------------------------build log--------------------------

_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip at lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

_______________________________________________
Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip at lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org



[Index of Archives]     [Asterisk Users]     [Asterisk App Development]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [Linux API]
  Powered by Linux