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

Fixed #if directives #15

Closed
wants to merge 1 commit into from
Closed

Conversation

ahmetcanik
Copy link

I wanted to use h323plus just to parse h323 binary packets. So audio and video codecs are not required.

./configure --disable-h46018 --disable-h46023 --disable-t38 --disable-h239 \
      --disable-audio --disable-video --disable-file --disable-tls
make -j bothdepend
make -j bothnoshared

However due to directive errors, last step could not be completed. So I've made the following changes and then make succeeded.

  • Replaced NO_H323_AUDIO_CODECS with H323_AUDIO_CODECS since there is no definition of NO_H323_AUDIO_CODECS (maybe obsolete)
  • check for also H323_AUDIO_CODECS and H323_VIDEO where H323_FRAMEBUFFER is checked
  • Replaced P_SSL with H323_TLS since P_SSL is not configurable

- NO_H323_AUDIO_CODECS => H323_AUDIO_CODECS since there is no definition of NO_H323_AUDIO_CODECS (maybe obsolete)
- check for also H323_AUDIO_CODECS and H323_VIDEO where H323_FRAMEBUFFER is checked
- P_SSL => H323_TLS since P_SSL is not configurable
@willamowius
Copy link
Owner

Thanks for raising the issue that H323Plus doesn't compile with all those features available.
But I prefer to fix that with less changes.

Please check the latest commit and let me know if it fixes your issues.

@ahmetcanik
Copy link
Author

I've pulled last commit, but no luck.
Without #ifdef H323_AUDIO_CODECS in opalvxml.h, this file won't compile.

output of make bothnoshared with same configure above:

h323pluginmgr.cxx:487:17: warning: ‘PBoolean SetCodecControl(const PluginCodec_Definition*, void*, const char*, const char*, const char*)’ defined but not used [-Wunused-function]
  487 | static PBoolean SetCodecControl(const PluginCodec_Definition * codec,
      |                 ^~~~~~~~~~~~~~~
[CC] guid.cxx
[CC] rtp2wav.cxx
[CC] h225ras.cxx
[CC] h323trans.cxx
[CC] h235auth.cxx
[CC] opalvxml.cxx
[CC] h235pluginmgr.cxx
In file included from opalvxml.cxx:36:
/home/projects/h323plus/include/opalvxml.h:47:1: error: expected class-name before ‘{’ token
   47 | {
      | ^
/home/projects/h323plus/include/opalvxml.h:51:31: error: expected ‘)’ before ‘dir’
   51 |     G7231_File_Codec(Direction dir);
      |                     ~         ^~~~
      |                               )
In file included from /home/projects/h323plus/../ptlib/include/ptlib/psync.h:43,
                 from /home/projects/h323plus/../ptlib/include/ptlib/critsec.h:34,
                 from /home/projects/h323plus/../ptlib/include/ptlib/contain.h:42,
                 from /home/projects/h323plus/../ptlib/include/ptlib.h:56,
                 from opalvxml.cxx:30:
/home/projects/h323plus/include/opalvxml.h: In member function ‘virtual PBoolean G7231_File_Codec::InternalIsDescendant(const char*) const’:
/home/projects/h323plus/include/opalvxml.h:48:32: error: ‘H323AudioCodec’ has not been declared
   48 |   PCLASSINFO(G7231_File_Codec, H323AudioCodec);
      |                                ^~~~~~~~~~~~~~
/home/projects/h323plus/../ptlib/include/ptlib/object.h:1055:54: note: in definition of macro ‘PCLASSINFO’
 1055 |       { return strcmp(clsName, cls::Class()) == 0 || par::InternalIsDescendant(clsName); } \
      |                                                      ^~~
/home/projects/h323plus/include/opalvxml.h: In member function ‘virtual const char* G7231_File_Codec::GetClass(unsigned int) const’:
/home/projects/h323plus/include/opalvxml.h:48:32: error: ‘H323AudioCodec’ has not been declared
   48 |   PCLASSINFO(G7231_File_Codec, H323AudioCodec);
      |                                ^~~~~~~~~~~~~~
/home/projects/h323plus/../ptlib/include/ptlib/object.h:1057:31: note: in definition of macro ‘PCLASSINFO’
 1057 |       { return ancestor > 0 ? par::GetClass(ancestor-1) : cls::Class(); } \
      |                               ^~~
/home/projects/h323plus/include/opalvxml.h: In member function ‘virtual PObject::Comparison G7231_File_Codec::CompareObjectMemoryDirect(const PObject&) const’:
/home/projects/h323plus/../ptlib/include/ptlib/object.h:1059:109: error: cannot convert ‘const G7231_File_Codec*’ to ‘const PObject*’
 1059 |       { return PObject::InternalCompareObjectMemoryDirect(this, dynamic_cast<const cls *>(&obj), sizeof(cls)); } \
      |                                                                                                             ^
/home/projects/h323plus/include/opalvxml.h:48:3: note: in expansion of macro ‘PCLASSINFO’
   48 |   PCLASSINFO(G7231_File_Codec, H323AudioCodec);
      |   ^~~~~~~~~~
In file included from /home/projects/h323plus/../ptlib/include/ptlib/psync.h:43,
                 from /home/projects/h323plus/../ptlib/include/ptlib/critsec.h:34,
                 from /home/projects/h323plus/../ptlib/include/ptlib/contain.h:42,
                 from /home/projects/h323plus/../ptlib/include/ptlib.h:56,
                 from opalvxml.cxx:30:
/home/projects/h323plus/../ptlib/include/ptlib/object.h:1222:23: note:   initializing argument 1 of ‘static PObject::Comparison PObject::InternalCompareObjectMemoryDirect(const PObject*, const PObject*, PINDEX)’
 1222 |       const PObject * obj1,
      |       ~~~~~~~~~~~~~~~~^~~~
opalvxml.cxx: In member function ‘virtual H323Codec* G7231_File_Capability::CreateCodec(H323Codec::Direction) const’:
opalvxml.cxx:103:40: error: no matching function for call to ‘G7231_File_Codec::G7231_File_Codec(H323Codec::Direction&)’
  103 |   return new G7231_File_Codec(direction);
      |                                        ^
In file included from opalvxml.cxx:36:
/home/projects/h323plus/include/opalvxml.h:46:7: note: candidate: ‘G7231_File_Codec::G7231_File_Codec()’
   46 | class G7231_File_Codec : public H323AudioCodec
      |       ^~~~~~~~~~~~~~~~
/home/projects/h323plus/include/opalvxml.h:46:7: note:   candidate expects 0 arguments, 1 provided
/home/projects/h323plus/include/opalvxml.h:46:7: note: candidate: ‘constexpr G7231_File_Codec::G7231_File_Codec(const G7231_File_Codec&)’
/home/projects/h323plus/include/opalvxml.h:46:7: note:   no known conversion for argument 1 from ‘H323Codec::Direction’ to ‘const G7231_File_Codec&’
/home/projects/h323plus/include/opalvxml.h:46:7: note: candidate: ‘constexpr G7231_File_Codec::G7231_File_Codec(G7231_File_Codec&&)’
/home/projects/h323plus/include/opalvxml.h:46:7: note:   no known conversion for argument 1 from ‘H323Codec::Direction’ to ‘G7231_File_Codec&&’
opalvxml.cxx: At global scope:
opalvxml.cxx:108:35: error: expected constructor, destructor, or type conversion before ‘(’ token
  108 | G7231_File_Codec::G7231_File_Codec(Direction dir)
      |                                   ^
opalvxml.cxx: In member function ‘PBoolean G7231_File_Codec::Read(BYTE*, unsigned int&, RTP_DataFrame&)’:
opalvxml.cxx:123:7: error: ‘rawDataChannel’ was not declared in this scope; did you mean ‘H323DataChannel’?
  123 |   if (rawDataChannel == NULL)
      |       ^~~~~~~~~~~~~~
      |       H323DataChannel
opalvxml.cxx:126:8: error: ‘rawDataChannel’ was not declared in this scope; did you mean ‘H323DataChannel’?
  126 |   if (!rawDataChannel->Read(buffer, 24)) {
      |        ^~~~~~~~~~~~~~
      |        H323DataChannel
opalvxml.cxx: In member function ‘PBoolean G7231_File_Codec::Write(const BYTE*, unsigned int, const RTP_DataFrame&, unsigned int&)’:
opalvxml.cxx:142:7: error: ‘rawDataChannel’ was not declared in this scope; did you mean ‘H323DataChannel’?
  142 |   if (rawDataChannel == NULL)
      |       ^~~~~~~~~~~~~~
      |       H323DataChannel
opalvxml.cxx:153:12: error: ‘rawDataChannel’ was not declared in this scope; did you mean ‘H323DataChannel’?
  153 |     return rawDataChannel->Write(silence, 24);
      |            ^~~~~~~~~~~~~~
      |            H323DataChannel
opalvxml.cxx:169:14: error: ‘rawDataChannel’ was not declared in this scope; did you mean ‘H323DataChannel’?
  169 |       return rawDataChannel->Write(silence, 24);
      |              ^~~~~~~~~~~~~~
      |              H323DataChannel
opalvxml.cxx:179:10: error: ‘rawDataChannel’ was not declared in this scope; did you mean ‘H323DataChannel’?
  179 |   return rawDataChannel->Write(buffer, writeLen);
      |          ^~~~~~~~~~~~~~
      |          H323DataChannel
make[2]: *** [/home/projects/h323plus/../ptlib/make/common.mak:96: /home/projects/h323plus/lib/obj_d_s/opalvxml.o] Error 1
make[2]: Leaving directory '/home/projects/h323plus/src'
make[1]: *** [/home/projects/h323plus/../ptlib/make/common.mak:317: debugnoshared] Error 2
make[1]: Leaving directory '/home/projects/h323plus/src'
make: *** [Makefile:91: debugnoshared] Error 2
make: *** Waiting for unfinished jobs....
[CC] rfc2833.cxx
[CC] /home/projects/h323plus/src/h224/h224.cxx
[CC] /home/projects/h323plus/src/h224/h281.cxx
[CC] h323h224.cxx
[CC] q922.cxx
[CC] /home/projects/h323plus/src/h224/t140.cxx
[CC] /home/projects/h323plus/src/h224/h284.cxx
[CC] h323pluginmgr.cxx
[CC] opalwavfile.cxx
[CC] rtp2wav.cxx
[CC] opalvxml.cxx
[CC] /home/projects/h323plus/src/h230/h230.cxx
[CC] h235auth1.cxx
[CC] svcctrl.cxx
h323pluginmgr.cxx:487:17: warning: ‘PBoolean SetCodecControl(const PluginCodec_Definition*, void*, const char*, const char*, const char*)’ defined but not used [-Wunused-function]
  487 | static PBoolean SetCodecControl(const PluginCodec_Definition * codec,
      |                 ^~~~~~~~~~~~~~~
[CC] /home/projects/h323plus/src/h341/h341.cxx
In file included from opalvxml.cxx:36:
/home/projects/h323plus/include/opalvxml.h:47:1: error: expected class-name before ‘{’ token
   47 | {
      | ^
/home/projects/h323plus/include/opalvxml.h:51:31: error: expected ‘)’ before ‘dir’
   51 |     G7231_File_Codec(Direction dir);
      |                     ~         ^~~~
      |                               )
In file included from /home/projects/h323plus/../ptlib/include/ptlib/psync.h:43,
                 from /home/projects/h323plus/../ptlib/include/ptlib/critsec.h:34,
                 from /home/projects/h323plus/../ptlib/include/ptlib/contain.h:42,
                 from /home/projects/h323plus/../ptlib/include/ptlib.h:56,
                 from opalvxml.cxx:30:
/home/projects/h323plus/include/opalvxml.h: In member function ‘virtual PBoolean G7231_File_Codec::InternalIsDescendant(const char*) const’:
/home/projects/h323plus/include/opalvxml.h:48:32: error: ‘H323AudioCodec’ has not been declared
   48 |   PCLASSINFO(G7231_File_Codec, H323AudioCodec);
      |                                ^~~~~~~~~~~~~~
/home/projects/h323plus/../ptlib/include/ptlib/object.h:1055:54: note: in definition of macro ‘PCLASSINFO’
 1055 |       { return strcmp(clsName, cls::Class()) == 0 || par::InternalIsDescendant(clsName); } \
      |                                                      ^~~
/home/projects/h323plus/include/opalvxml.h: In member function ‘virtual const char* G7231_File_Codec::GetClass(unsigned int) const’:
/home/projects/h323plus/include/opalvxml.h:48:32: error: ‘H323AudioCodec’ has not been declared
   48 |   PCLASSINFO(G7231_File_Codec, H323AudioCodec);
      |                                ^~~~~~~~~~~~~~
/home/projects/h323plus/../ptlib/include/ptlib/object.h:1057:31: note: in definition of macro ‘PCLASSINFO’
 1057 |       { return ancestor > 0 ? par::GetClass(ancestor-1) : cls::Class(); } \
      |                               ^~~
/home/projects/h323plus/include/opalvxml.h: In member function ‘virtual PObject::Comparison G7231_File_Codec::CompareObjectMemoryDirect(const PObject&) const’:
/home/projects/h323plus/../ptlib/include/ptlib/object.h:1059:109: error: cannot convert ‘const G7231_File_Codec*’ to ‘const PObject*’
 1059 |       { return PObject::InternalCompareObjectMemoryDirect(this, dynamic_cast<const cls *>(&obj), sizeof(cls)); } \
      |                                                                                                             ^
/home/projects/h323plus/include/opalvxml.h:48:3: note: in expansion of macro ‘PCLASSINFO’
   48 |   PCLASSINFO(G7231_File_Codec, H323AudioCodec);
      |   ^~~~~~~~~~
In file included from /home/projects/h323plus/../ptlib/include/ptlib/psync.h:43,
                 from /home/projects/h323plus/../ptlib/include/ptlib/critsec.h:34,
                 from /home/projects/h323plus/../ptlib/include/ptlib/contain.h:42,
                 from /home/projects/h323plus/../ptlib/include/ptlib.h:56,
                 from opalvxml.cxx:30:
/home/projects/h323plus/../ptlib/include/ptlib/object.h:1222:23: note:   initializing argument 1 of ‘static PObject::Comparison PObject::InternalCompareObjectMemoryDirect(const PObject*, const PObject*, PINDEX)’
 1222 |       const PObject * obj1,
      |       ~~~~~~~~~~~~~~~~^~~~
opalvxml.cxx: In member function ‘virtual H323Codec* G7231_File_Capability::CreateCodec(H323Codec::Direction) const’:
opalvxml.cxx:103:40: error: no matching function for call to ‘G7231_File_Codec::G7231_File_Codec(H323Codec::Direction&)’
  103 |   return new G7231_File_Codec(direction);
      |                                        ^
In file included from opalvxml.cxx:36:
/home/projects/h323plus/include/opalvxml.h:46:7: note: candidate: ‘G7231_File_Codec::G7231_File_Codec()’
   46 | class G7231_File_Codec : public H323AudioCodec
      |       ^~~~~~~~~~~~~~~~
/home/projects/h323plus/include/opalvxml.h:46:7: note:   candidate expects 0 arguments, 1 provided
/home/projects/h323plus/include/opalvxml.h:46:7: note: candidate: ‘constexpr G7231_File_Codec::G7231_File_Codec(const G7231_File_Codec&)’
/home/projects/h323plus/include/opalvxml.h:46:7: note:   no known conversion for argument 1 from ‘H323Codec::Direction’ to ‘const G7231_File_Codec&’
/home/projects/h323plus/include/opalvxml.h:46:7: note: candidate: ‘constexpr G7231_File_Codec::G7231_File_Codec(G7231_File_Codec&&)’
/home/projects/h323plus/include/opalvxml.h:46:7: note:   no known conversion for argument 1 from ‘H323Codec::Direction’ to ‘G7231_File_Codec&&’
opalvxml.cxx: At global scope:
opalvxml.cxx:108:35: error: expected constructor, destructor, or type conversion before ‘(’ token
  108 | G7231_File_Codec::G7231_File_Codec(Direction dir)
      |                                   ^
opalvxml.cxx: In member function ‘PBoolean G7231_File_Codec::Read(BYTE*, unsigned int&, RTP_DataFrame&)’:
opalvxml.cxx:123:7: error: ‘rawDataChannel’ was not declared in this scope; did you mean ‘H323DataChannel’?
  123 |   if (rawDataChannel == NULL)
      |       ^~~~~~~~~~~~~~
      |       H323DataChannel
opalvxml.cxx:126:8: error: ‘rawDataChannel’ was not declared in this scope; did you mean ‘H323DataChannel’?
  126 |   if (!rawDataChannel->Read(buffer, 24)) {
      |        ^~~~~~~~~~~~~~
      |        H323DataChannel
opalvxml.cxx: In member function ‘PBoolean G7231_File_Codec::Write(const BYTE*, unsigned int, const RTP_DataFrame&, unsigned int&)’:
opalvxml.cxx:142:7: error: ‘rawDataChannel’ was not declared in this scope; did you mean ‘H323DataChannel’?
  142 |   if (rawDataChannel == NULL)
      |       ^~~~~~~~~~~~~~
      |       H323DataChannel
opalvxml.cxx:153:12: error: ‘rawDataChannel’ was not declared in this scope; did you mean ‘H323DataChannel’?
  153 |     return rawDataChannel->Write(silence, 24);
      |            ^~~~~~~~~~~~~~
      |            H323DataChannel
opalvxml.cxx:169:14: error: ‘rawDataChannel’ was not declared in this scope; did you mean ‘H323DataChannel’?
  169 |       return rawDataChannel->Write(silence, 24);
      |              ^~~~~~~~~~~~~~
      |              H323DataChannel
opalvxml.cxx:179:10: error: ‘rawDataChannel’ was not declared in this scope; did you mean ‘H323DataChannel’?
  179 |   return rawDataChannel->Write(buffer, writeLen);
      |          ^~~~~~~~~~~~~~
      |          H323DataChannel
make[2]: *** [/home/projects/h323plus/../ptlib/make/common.mak:97: /home/projects/h323plus/lib/obj_s/opalvxml.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[2]: Leaving directory '/home/projects/h323plus/src'
make[1]: *** [/home/projects/h323plus/../ptlib/make/common.mak:295: optnoshared] Error 2
make[1]: Leaving directory '/home/projects/h323plus/src'
make: *** [Makefile:91: optnoshared] Error 2

@willamowius
Copy link
Owner

I added the #ifdef in opalvxml.h

@ahmetcanik
Copy link
Author

This time make bothnoshared works. But static linking with my own application fails as following.
The reason is NO_H323_AUDIO directives which are not controlled with configure. I had changed them to H323_AUDIO_CODECS in PR:

#ifndef NO_H323_AUDIO

/usr/bin/ld: lib/libh323.a(h323pluginmgr.o): in function `H323AudioCapability::~H323AudioCapability()':
/opt/h323plus/include/h323caps.h:647: undefined reference to `vtable for H323AudioCapability'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o): in function `H323AudioPluginCapability::H323AudioPluginCapability(PluginCodec_Definition*, PluginCodec_Definition*, unsigned int)':
/opt/h323plus/src/h323pluginmgr.cxx:2162: undefined reference to `H323AudioCapability::H323AudioCapability(unsigned int, unsigned int)'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o): in function `H323AudioCapability::H323AudioCapability(H323AudioCapability const&)':
/opt/h323plus/include/h323caps.h:647: undefined reference to `vtable for H323AudioCapability'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o):(.data.rel.ro._ZTV25H323AudioPluginCapability[_ZTV25H323AudioPluginCapability]+0x60): undefined reference to `H323AudioCapability::GetMainType() const'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o):(.data.rel.ro._ZTV25H323AudioPluginCapability[_ZTV25H323AudioPluginCapability]+0x80): undefined reference to `H323AudioCapability::GetDefaultSessionID() const'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o):(.data.rel.ro._ZTV25H323AudioPluginCapability[_ZTV25H323AudioPluginCapability]+0x88): undefined reference to `H323AudioCapability::SetTxFramesInPacket(unsigned int)'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o):(.data.rel.ro._ZTV25H323AudioPluginCapability[_ZTV25H323AudioPluginCapability]+0x90): undefined reference to `H323AudioCapability::GetTxFramesInPacket() const'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o):(.data.rel.ro._ZTV25H323AudioPluginCapability[_ZTV25H323AudioPluginCapability]+0x98): undefined reference to `H323AudioCapability::GetRxFramesInPacket() const'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o):(.data.rel.ro._ZTV25H323AudioPluginCapability[_ZTV25H323AudioPluginCapability]+0xc8): undefined reference to `H323AudioCapability::OnSendingPDU(H245_Capability&) const'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o):(.data.rel.ro._ZTV25H323AudioPluginCapability[_ZTV25H323AudioPluginCapability]+0xd0): undefined reference to `H323AudioCapability::OnSendingPDU(H245_DataType&) const'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o):(.data.rel.ro._ZTV25H323AudioPluginCapability[_ZTV25H323AudioPluginCapability]+0xd8): undefined reference to `H323AudioCapability::OnSendingPDU(H245_ModeElement&) const'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o):(.data.rel.ro._ZTV25H323AudioPluginCapability[_ZTV25H323AudioPluginCapability]+0xe0): undefined reference to `H323AudioCapability::OnReceivedPDU(H245_Capability const&)'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o):(.data.rel.ro._ZTV25H323AudioPluginCapability[_ZTV25H323AudioPluginCapability]+0xe8): undefined reference to `H323AudioCapability::OnReceivedPDU(H245_DataType const&, bool)'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o):(.data.rel.ro._ZTV25H323AudioPluginCapability[_ZTV25H323AudioPluginCapability]+0x158): undefined reference to `H323AudioCapability::OnSendingPDU(H245_AudioCapability&, unsigned int) const'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o):(.data.rel.ro._ZTV25H323AudioPluginCapability[_ZTV25H323AudioPluginCapability]+0x160): undefined reference to `H323AudioCapability::OnSendingPDU(H245_AudioCapability&, unsigned int, H323Capability::CommandType) const'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o):(.data.rel.ro._ZTV25H323AudioPluginCapability[_ZTV25H323AudioPluginCapability]+0x168): undefined reference to `H323AudioCapability::OnSendingPDU(H245_AudioMode&) const'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o):(.data.rel.ro._ZTV25H323AudioPluginCapability[_ZTV25H323AudioPluginCapability]+0x170): undefined reference to `H323AudioCapability::OnReceivedPDU(H245_AudioCapability const&, unsigned int&)'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o):(.data.rel.ro._ZTV25H323AudioPluginCapability[_ZTV25H323AudioPluginCapability]+0x178): undefined reference to `H323AudioCapability::OnReceivedPDU(H245_AudioCapability const&, unsigned int&, H323Capability::CommandType)'
/usr/bin/ld: lib/libh323.a(h323pluginmgr.o):(.data.rel.ro._ZTI25H323AudioPluginCapability[_ZTI25H323AudioPluginCapability]+0x18): undefined reference to `typeinfo for H323AudioCapability'
collect2: error: ld returned 1 exit status

@willamowius
Copy link
Owner

I changed the NO_H323_AUDIO

@ahmetcanik
Copy link
Author

Thanks. Now it's fixed. I'm closing the PR.

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

Successfully merging this pull request may close these issues.

None yet

2 participants