Wrong typescript generated file - protobuf.js

The typescript generated file is no more valid
The enums are generated into a namespace
And the interface are no more included
I am using typescript 6.8.9 but I think it is a dependancy issue.
Are you also experiencing this issue ?

Related

Import .tlb, Generated .tlh Gives: forward declaration of enum type is nonstandard

I'm reusing a code I wrote couple years ago on a different version of Visual Studio, now Im trying to do it in VS 2017. The code aims to connect different applications using server-client arrangement.I'm accessing the .tlb of one application but I cannot establish the connection (either error of non-accessible .tlh or just no identification of different application methods/properties) , among 254 others.
The question is similar to this one: Import .TLB file gives "cannot open source file x.tlh"
I have tried adding the .tlb file in additional library directories but even when the error disappears, the code still doesnot recognize many methods that were fine before. #import statement shows no errors, yet the generated .tlh file has the following error:
forward declaration of enum type is nonstandard
Hence, It doesnot compile
Other issues also appeared, such as this:
no instance of function template "IID_PPV_ARGS_Helper" matches the argument list
for this line:
HRESULT hr = hyStream->QueryInterface(IID_PPV_ARGS(&Strm));
Now, the whole project was running seamlessly back then. I copied three classes with their headers to a new project, so maybe dependencies are the source of errors? Should I add .tlb file in library dependencies of the project?
Any comment is highly appreciated..

Including multiple proto files on to one project causes protobuf_AssignDescriptorsOnce() already has a body

I have got multiple proto files from the server created under the same package. When I add more than one of those proto files on to a project, each proto file is generating its own .pb.cc and .h files and each generated file has the below two methods. I need to include some of the generated .cc files to one of my projects which causes multiple definitions of the below two functions.
auto-generated functions causing "the function already has a body" issues are
1. protobuf_AssignDescriptorsOnce()
2. protobuf_RegisterTypes(const ::std::string&)
Making changes in the package name is obviously solving this issue but the proto file was given by the server and any change on that file could cause huge change in all the other dependant clients.
Any help to address this issue would be much appreciated.
Regards,
Abilash.G
The issue was simple and not related to protobuf. I've included all the generated pb.cc files directly on to my 'stdafx.cpp' instead of adding the generated files as a part of projects which was causing the 'already has a body' error for the global functions.

Integrating Box2d in Swift project gets cassert file not found error

I want to integrate Box2d in my OS X application, so I've used the following Podfile to grab it:
pod 'box2d'
And the version of box2d is 2.3.0. In the xcworkspace I got from pod install, I've created a bridge header to interoperate with the C++ APIs (according to doc, developer cannot import C++ projects directly from Swift lang, you should create a ObjC bridge).
And when I hit build button, I got a compiler error:
<unknown>:0: error: /path/to/project/Pods/Headers/Box2D/Common/b2Settings.h:22: 'cassert' file not found
So I wonder how can I fix this?
Finally I figured it out by myself.
I've already created the bridging file as mentioned in apple's doc, but the content I was putting there was:
//
// Use this file to import your target's public headers that you would like to expose to Swift.
//
#import <Box2d/Box2d.h>
This is the root for the compiler error. So, I have to create a new Objective-C class, rename the .m file to .mm, and put the line of import in the .mm file. NOTE: putting the import line in .h file does not solve the compiler error.
And that's it, now it compiles happily.

C++ and Objc Build Errors

I have been trying to add MobileSynth to my application for some time now and I am only running into errors.
I have followed the steps here which explain how to add a project into another one.
When I compile, both projects are compiled correctly without errors, but the moment I try import the code into my objective C source code I get a large number of errors.
This is a screenshot of the errors.
Im sure there are more errors than these as there seems to be something wrong with the dependencies.
I also approved Xcodes recommendation to convert the project 2 (containing the objective C viewcontrollers with .mm extensions and the .cpp files) from an old 3.something version to the version 4 project type, and made the snapshot. Didnt seem to change anything.
I am not sure how to solve these issues. I would really appreciate any help.
Use using namespace instead of namespace.
You're aware that files that use C++ need the .mm extension. You also need to consider import dependencies. Since this header contains C++, any other file that imports it will also need to have the .mm extension. I'm almost positive that's what's happening to you.
I generally try to keep C++ quarantined to the implementation files for this very reason.
Also, for clarification on previous advice:
// Correct
namespace synth { class something; }
// Incorrect
using namespace synth { class something; }
// Optional
namespace synth { class something; }
using namespace synth;

including C/C++ headers in Xcode 4

I've been using a C++ library without problems on projects built with Xcode 3, but I'm now getting build problems on projects built with Xcode 4.
Drop the library into the Xcode 4 project and it builds fine, but as soon as I #include it, I get a "Lexical or Preprocessor Issue" error, more specifically " 'string' file not found, on line 4 of its main header file.
On closer inspection, the error specifies that 'string' file not found in ~/my project's directory/include/mainheader.h
I've tried the solutions listed here, but none worked.
So it thinks that header file is in my project directory, but it's obviously a C/C++ header… How can I tell Xcode to look for these C/C++ headers?
The problematic #include was at the top of my ViewController.mm, which I had already turned into Objective-C++ by giving it .mm as its extension. But ViewController.mm gets eventually imported by AppDelegate.m, which is Objective-C by default – and I had forgotten to make it Objective-C++, hence the problem.
So renaming AppDelegate.m to AppDelegate.mm solved the problem.
I think #include is a c++ class template..so you need to used using namespace std in your header file and also rename your source file .m format to .mm format.
it works for me :) try this...