Compiling simple console based Visual Studio C++ app with PNacl for chrome

288 views
Skip to first unread message

Sheikh Khalil

unread,
Jun 18, 2014, 6:44:44 AM6/18/14
to native-cli...@googlegroups.com
Hello,
            I am trying to compile simple app (testappconsole.cpp) with PNacl and I get this error given below ( SDKDDKVer.h is included by Visual Studio when I built the wizard application)

Command that I use
pnacl-clang++ testappconsole.cpp  -I nacl_sdk\pepper_35/include -LC: nacl_sdk\pepper_35/lib/pnacl/Release  -o testappconsole.pexe -g -O2 -lppapi_cpp -lppapi

Error
In file included from testappconsole.cpp:4:
In file included from ./stdafx.h:8:
./targetver.h:8:10: fatal error: 'SDKDDKVer.h' file not found
#include <SDKDDKVer.h>
         ^
1 error generated.


Also whole Idea is to port Visual Studio client application (written in Visual C++) responsible for decoding and streaming audio and video over LAN and WAN. The application is running fine on windows operating system, We need to port it for chrome, Is PNacl a good, stable tool for this?


Regards,

Sheikh

Victor Khimenko

unread,
Jun 18, 2014, 7:21:44 AM6/18/14
to Native Client Discuss
Depends on your code. PNaCl is quite stable today, but of couse it could not provide and does not provide proprietary Windows APIs (they are not portable by definition). Your program must use PPAPI ( https://developer.chrome.com/native-client/pepper_stable/index ) instead. If your programs has MacOS or Linux ports then you could be interested in nacl_io which supports subset of POSIX APIs ( https://developer.chrome.com/native-client/devguide/coding/nacl_io ).

If you need/want to use dynamic libarries, code generation or low-level assembler tricks then you'll need to use NaCl, not PNaCl, but then your applications will be limited to Chrome Web Store.
 

Regards,

Sheikh

Sheikh Khalil

unread,
Jun 18, 2014, 7:29:20 AM6/18/14
to native-cli...@googlegroups.com
My Visual C++ solution is developed in "Visual Stuio 2013 express edition", APIs responsible for decoding and rendering streaming data (video and audio) are available in the form of DLLs. According to this link (https://developer.chrome.com/native-client/devguide/devcycle/vs-addin) I can only use Visual Stuio 2010 SP1 to integrate Native Client SDK with Visual Studio?

Sheikh Khalil

unread,
Jun 18, 2014, 7:31:41 AM6/18/14
to native-cli...@googlegroups.com
My target platform is chrome browser running on windows, and then I can later think of porting it for linux and mac


On Wednesday, 18 June 2014 12:21:44 UTC+1, khim wrote:

JF Bastien

unread,
Jun 18, 2014, 7:39:19 AM6/18/14
to native-cli...@googlegroups.com
I think you misunderstand: porting to Chrome means it'll work on all other platforms within Chrome.

You can use Visual Studio as an IDE, but the Windows APIs aren't supported as-is. You can see the PPAPIs that Victor pointed at to see which APIs are available from within Chrome.


--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at http://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/d/optout.

Victor Khimenko

unread,
Jun 18, 2014, 7:48:41 AM6/18/14
to Native Client Discuss
On Wed, Jun 18, 2014 at 3:29 PM, Sheikh Khalil <sheikh...@gorillabox.net> wrote:
My Visual C++ solution is developed in "Visual Stuio 2013 express edition", APIs responsible for decoding and rendering streaming data (video and audio) are available in the form of DLLs.

If they are only available in the form of DLLs then they could not be used with Chrome period. You'll have time till about the end of year to invent portable solution if you already have an extensions in the Chrome Web Store (new extensions with NPAPI are no longer accepted) but after that point it's either portable HTML5/NaCl/PNaCl or no Chrome support, sorry.

According to this link (https://developer.chrome.com/native-client/devguide/devcycle/vs-addin) I can only use Visual Stuio 2010 SP1 to integrate Native Client SDK with Visual Studio?

Visual Studio Express don't support addons, thus it's impossible to use it to develop NaCl/PNaCl applications, but Visual Studio is not required to develop them, you could use any text editor and NaCl SDK.
 
On Wednesday, 18 June 2014 12:21:44 UTC+1, khim wrote:


On Wed, Jun 18, 2014 at 2:44 PM, Sheikh Khalil <sheikh...@gorillabox.net> wrote:
Hello,
            I am trying to compile simple app (testappconsole.cpp) with PNacl and I get this error given below ( SDKDDKVer.h is included by Visual Studio when I built the wizard application)

Command that I use
pnacl-clang++ testappconsole.cpp  -I nacl_sdk\pepper_35/include -LC: nacl_sdk\pepper_35/lib/pnacl/Release  -o testappconsole.pexe -g -O2 -lppapi_cpp -lppapi

Error
In file included from testappconsole.cpp:4:
In file included from ./stdafx.h:8:
./targetver.h:8:10: fatal error: 'SDKDDKVer.h' file not found
#include <SDKDDKVer.h>
         ^
1 error generated.


Also whole Idea is to port Visual Studio client application (written in Visual C++) responsible for decoding and streaming audio and video over LAN and WAN. The application is running fine on windows operating system, We need to port it for chrome, Is PNacl a good, stable tool for this?

Depends on your code. PNaCl is quite stable today, but of couse it could not provide and does not provide proprietary Windows APIs (they are not portable by definition). Your program must use PPAPI ( https://developer.chrome.com/native-client/pepper_stable/index ) instead. If your programs has MacOS or Linux ports then you could be interested in nacl_io which supports subset of POSIX APIs ( https://developer.chrome.com/native-client/devguide/coding/nacl_io ).

If you need/want to use dynamic libarries, code generation or low-level assembler tricks then you'll need to use NaCl, not PNaCl, but then your applications will be limited to Chrome Web Store.
 

Regards,

Sheikh

Sheikh Khalil

unread,
Jun 18, 2014, 7:52:08 AM6/18/14
to native-cli...@googlegroups.com
Ok I am confused now, Let me reiterate what I want.

- I have a Client application developed in Visual Studio 2013 Express that decodes (live streaming data
 containing Server desktop) and shows it on client window, encoder used are FFmpeg, AMF etc. 
- Mainly Client application decode and renders the stream. Decoding and streaming are done by third party
  DLL that are used in simple test client App.
- I want to run same client application in chrome browser with same operating system(Windows)
- How do I port it for browser using google API. solution needs to be quickest and easiest  

Victor Khimenko

unread,
Jun 18, 2014, 7:52:18 AM6/18/14
to Native Client Discuss
On Wed, Jun 18, 2014 at 3:39 PM, 'JF Bastien' via Native-Client-Discuss <native-cli...@googlegroups.com> wrote:
I think you misunderstand: porting to Chrome means it'll work on all other platforms within Chrome.

Indeed. "Chrome browser running on windows" is no longer an option. It's either cross-platform or nothing at all.

For less resource-intensive tasks there are solution: you could develop native windows applications and call it via Native Messaging API ( https://developer.chrome.com/extensions/messaging#native-messaging ). But for video encoding/decoding it'll not work because of bandwidth requirements.

Victor Khimenko

unread,
Jun 18, 2014, 7:56:29 AM6/18/14
to Native Client Discuss
On Wed, Jun 18, 2014 at 3:52 PM, Sheikh Khalil <sheikh...@gorillabox.net> wrote:
Ok I am confused now, Let me reiterate what I want.

- (1) I have a Client application developed in Visual Studio 2013 Express that decodes (live streaming data
 containing Server desktop) and shows it on client window, encoder used are FFmpeg, AMF etc. 
- (2) Mainly Client application decode and renders the stream. Decoding and streaming are done by third party
  DLL that are used in simple test client App.
- (3) I want to run same client application in chrome browser with same operating system(Windows)
- (4) How do I port it for browser using google API. solution needs to be quickest and easiest  

Requirements (2) (third party DLLs) and (3) (Chrome browser window) are incompatible. NPAPI is deprecated and slated to be removed exactly because it too hard to support this combination (this is not THE reason, but certainly A reason to do that).

Pick one of these and then we could talk.
 

On Wednesday, 18 June 2014 12:39:19 UTC+1, JF Bastien wrote:
I think you misunderstand: porting to Chrome means it'll work on all other platforms within Chrome.

You can use Visual Studio as an IDE, but the Windows APIs aren't supported as-is. You can see the PPAPIs that Victor pointed at to see which APIs are available from within Chrome.



Sheikh Khalil

unread,
Jun 18, 2014, 7:59:17 AM6/18/14
to native-cli...@googlegroups.com
We do have source code available for Third party DLLs. They are all written in C/C++, does that make it possible now?

Sheikh Khalil

unread,
Jun 18, 2014, 9:09:49 AM6/18/14
to native-cli...@googlegroups.com
Also, Client application contains Windows APIs as well things like "GetAsyncKeyState", "WaitForSingleObject"etc ( I do have the source source for DLLs as mentioned above). There are some external libraries used (glew, sdl). Please confirm if there is any way to port this code in google chrome??

Regards.

Sheikh.

JF Bastien

unread,
Jun 18, 2014, 9:15:32 AM6/18/14
to native-cli...@googlegroups.com
As we've stated before, Windows APIs are not available. You'll need to use the PPAPIs instead. Other libraries like glew and sdl can work, please look at naclports for this.


Sheikh Khalil

unread,
Jun 18, 2014, 9:25:09 AM6/18/14
to native-cli...@googlegroups.com

Hello,
            I am trying to compile simple app (testappconsole.cpp) with PNacl and I get this error given below ( SDKDDKVer.h is included by Visual Studio when I built the wizard application)

Command that I use
pnacl-clang++ testappconsole.cpp  -I nacl_sdk\pepper_35/include -LC: nacl_sdk\pepper_35/lib/pnacl/Release  -o testappconsole.pexe -g -O2 -lppapi_cpp -lppapi

Error
In file included from testappconsole.cpp:4:
In file included from ./stdafx.h:8:
./targetver.h:8:10: fatal error: 'SDKDDKVer.h' file not found
#include <SDKDDKVer.h>
         ^
1 error generated.


Also whole Idea is to port Visual Studio client application (written in Visual C++) responsible for decoding and streaming audio and video over LAN and WAN. The application is running fine on windows operating system, We need to port it for chrome, Is PNacl a good, stable tool for this?

Depends on your code. PNaCl is quite stable today, but of couse it could not provide and does not provide proprietary Windows APIs (they are not portable by definition). Your program must use PPAPI ( https://developer.chrome.com/native-client/pepper_stable/index ) instead. "So where I am using windows APIs, I need to use PPAPI API for my client application to be portable" ?

Victor Khimenko

unread,
Jun 18, 2014, 9:32:59 AM6/18/14
to Native Client Discuss
On Wed, Jun 18, 2014 at 5:25 PM, Sheikh Khalil <sheikh...@gorillabox.net> wrote:


Hello,
            I am trying to compile simple app (testappconsole.cpp) with PNacl and I get this error given below ( SDKDDKVer.h is included by Visual Studio when I built the wizard application)

Command that I use
pnacl-clang++ testappconsole.cpp  -I nacl_sdk\pepper_35/include -LC: nacl_sdk\pepper_35/lib/pnacl/Release  -o testappconsole.pexe -g -O2 -lppapi_cpp -lppapi

Error
In file included from testappconsole.cpp:4:
In file included from ./stdafx.h:8:
./targetver.h:8:10: fatal error: 'SDKDDKVer.h' file not found
#include <SDKDDKVer.h>
         ^
1 error generated.


Also whole Idea is to port Visual Studio client application (written in Visual C++) responsible for decoding and streaming audio and video over LAN and WAN. The application is running fine on windows operating system, We need to port it for chrome, Is PNacl a good, stable tool for this?

Depends on your code. PNaCl is quite stable today, but of couse it could not provide and does not provide proprietary Windows APIs (they are not portable by definition). Your program must use PPAPI ( https://developer.chrome.com/native-client/pepper_stable/index ) instead. "So where I am using windows APIs, I need to use PPAPI API for my client application to be portable" ?

Either PPAPI or POSIX API (which is supported by MacOS, Linux and NaCl via nacl_io). GetAsynkKeyState and WaitForSingleObect are obviously used for synshcronization. NaCl supports subset of pthreads_api which could be used for that. 
 
 
If your programs has MacOS or Linux ports then you could be interested in nacl_io which supports subset of POSIX APIs ( https://developer.chrome.com/native-client/devguide/coding/nacl_io ).

If you need/want to use dynamic libarries, code generation or low-level assembler tricks then you'll need to use NaCl, not PNaCl, but then your applications will be limited to Chrome Web Store.
 

Regards,

Sheikh

Sheikh Khalil

unread,
Jun 18, 2014, 10:02:28 AM6/18/14
to native-cli...@googlegroups.com
So I need to rewrite my client application and whereever I am using windows API I need to replace it with PAPPI or posix?

JF Bastien

unread,
Jun 18, 2014, 10:06:36 AM6/18/14
to native-cli...@googlegroups.com
So I need to rewrite my client application and whereever I am using windows API I need to replace it with PAPPI or posix?

Yes. 

Sheikh Khalil

unread,
Jun 18, 2014, 10:07:45 AM6/18/14
to native-cli...@googlegroups.com
Thanks for the help, Its bit stupid of me to think that google APIs would support Win32 ... :)

JF Bastien

unread,
Jun 18, 2014, 10:12:24 AM6/18/14
to native-cli...@googlegroups.com
The goal is portability, we can't offer Windows APIs on other platforms.


--

Sheikh Khalil

unread,
Jun 18, 2014, 10:29:29 AM6/18/14
to native-cli...@googlegroups.com
The goal is portability, we can't offer Windows APIs on other platforms.

Not even for chrome running on windows platform?


Darin Fisher

unread,
Jun 18, 2014, 10:34:00 AM6/18/14
to Native-Client-Discuss

Programs would not be portable if they used such APIs.

Regards,
-Darin

On Jun 18, 2014 7:29 AM, "Sheikh Khalil" <sheikh...@gorillabox.net> wrote:
The goal is portability, we can't offer Windows APIs on other platforms.

Not even for chrome running on windows platform?


Reply all
Reply to author
Forward
0 new messages