Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stub impl naming conflicts #139

Closed
DRFrederik opened this issue Sep 28, 2018 · 1 comment
Closed

stub impl naming conflicts #139

DRFrederik opened this issue Sep 28, 2018 · 1 comment

Comments

@DRFrederik
Copy link

Example:
kdwsdl2cpp -namespace events_ver10 -o events_ver10.h -server https://www.onvif.org/ver10/events/wsdl/event.wsdl

kdwsdl2cpp -namespace events_ver10 -impl events_ver10.h -o private/events_ver10.cpp -server https://www.onvif.org/ver10/events/wsdl/event.wsdl

Trying to build events_ver10.o results in an error in events_ver10.cpp line 5976 and 6179:
events_ver10::WSNT__Notify notify;// converter_serverstub.cpp:127
notify.deserialize(_request);// converter_complextype.cpp:394
notify(notify);

The PVM function notify must be called passing a WSNT__Notify.
In this case however operator () of WSNT__Notify is being called.
Because WSNT__Notify has no operator() we get:
events_ver10.cpp: error: type 'events_ver10::WSNT__Notify' does not provide a call operator
The solution is to add this-> to the notify function call.

Every stub function call should be preceded by "this->" or "classname::" to prevent such name clashing.

@dfaure-kdab
Copy link
Member

Hmm, I'm trying to add a unittest for this WSDL file, but I hit another problem before this one: kdwsdl2cpp says ERROR: Already having a class called "events_ver10::RenewJob" and then
wsdl_event.cpp:5009:1: error: prototype for ‘events_ver10::RenewJob::RenewJob(events_ver10::SubscriptionManagerBindingService*, QObject*)’ does not match any in class ‘events_ver10::RenewJob’ , apparently because the .h got one RenewJob signature and the .cpp got the other (could be random, if it depends on qhash ordering). I'm looking into it.

dfaure-kdab added a commit that referenced this issue Oct 18, 2018
* Don't generate two job classes with the same name, when two bindings have the same operation name. Prefix one of them with the binding name
* Prepend this-> in method class to avoid compilation error when the variable and the method have the same name

Fixes github issue #139
dfaure-kdab added a commit that referenced this issue Mar 5, 2020
This fixes issue #207 (licensing of onvif.org wsdl files)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants