Results 1 to 14 of 14

Thread: Weird compiler errors

  1. #1
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Weird compiler errors

    Hi to all, I must recompile som source tree under debian 3.1 unstable/testing, gcc 3.3.6! When i issue and ./configure, i get:
    Qt Code:
    1. make[4]: Entering directory `/home/frelihm/projects/Qtopia/PopupMenu/source/fonav/services/gtalk/libjingle-0.3.0/talk/base'
    2. if /bin/sh ../../libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I../.. -DPOSIX -g -O2 -MT [...] openssladapter.cc; \
    3. then mv -f ".deps/openssladapter.Tpo" ".deps/openssladapter.Plo"; else rm -f ".deps/openssladapter.Tpo"; exit 1; fi
    4. openssladapter.cc: In member function `bool
    5. cricket::OpenSSLAdapter::SSLPostConnectionCheck(SSL*, const char*)':
    6. openssladapter.cc:651: error: invalid conversion from `unsigned char**' to `
    7. const unsigned char**'
    8. openssladapter.cc:653: error: invalid conversion from `unsigned char**' to `
    9. const unsigned char**'
    10. openssladapter.cc: In static member function `static SSL_CTX*
    11. cricket::OpenSSLAdapter::SetupSSLContext()':
    12. openssladapter.cc:775: error: invalid conversion from `unsigned char**' to `
    13. const unsigned char**'
    14. make[4]: *** [openssladapter.lo] Error 1
    15. make[4]: Leaving directory `/home/frelihm/projects/Qtopia/PopupMenu/source/fonav/services/gtalk/libjingle-0.3.0/talk/base'
    16. make[3]: *** [all-recursive] Error 1
    17. make[3]: Leaving directory `/home/frelihm/projects/Qtopia/PopupMenu/source/fonav/services/gtalk/libjingle-0.3.0/talk'
    18. make[2]: *** [all-recursive] Error 1
    19. make[2]: Leaving directory `/home/frelihm/projects/Qtopia/PopupMenu/source/fonav/services/gtalk/libjingle-0.3.0'
    20. make[1]: *** [all] Error 2
    21. make[1]: Leaving directory `/home/frelihm/projects/Qtopia/PopupMenu/source/fonav/services/gtalk/libjingle-0.3.0'
    22. make: *** [libjingle] Error 1
    To copy to clipboard, switch view to plain text mode 
    Under gcc 3.3.5 and fedora 4 the identical source tree compiles without errors. Does enyone has some idea what to do?

    I use qtopia 2.2.0 on debian 3.1 and gcc 3.3.6!
    Last edited by jacek; 10th June 2006 at 11:29. Reason: shortened the quote, so it doesn't break the page layout
    Qt 5.3 Opensource & Creator 3.1.2

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Weird compiler errors

    Quite strange, could you post lines 640--660 from that openssladapter.cc? Do these machines have the same version of OpenSSL library installed?

  3. #3
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Weird compiler errors

    OpenSSL is included in source tree, so there is only one version. To be sure, I also installed same openssl version via apt-get, same result. There is something very fishy in this lines:

    Qt Code:
    1. OpenSSLAdapter::SSLPostConnectionCheck(SSL* ssl, const char* host) {
    2. if (!host)
    3. return false;
    4.  
    5. // Checking the return from SSL_get_peer_certificate here is not strictly
    6. // necessary. With our setup, it is not possible for it to return
    7. // NULL. However, it is good form to check the return.
    8. X509* certificate = SSL_get_peer_certificate(ssl);
    9. if (!certificate)
    10. return false;
    11.  
    12. #ifdef _DEBUG
    13. {
    14. LOG(LS_INFO) << "Certificate from server:";
    15. BIO* mem = BIO_new(BIO_s_mem());
    16. X509_print_ex(mem, certificate, XN_FLAG_SEP_CPLUS_SPC, X509_FLAG_NO_HEADER);
    17. BIO_write(mem, "\0", 1);
    18. char* buffer;
    19. BIO_get_mem_data(mem, &buffer);
    20. LOG(LS_INFO) << buffer;
    21. BIO_free(mem);
    22.  
    23. char* cipher_description =
    24. SSL_CIPHER_description(SSL_get_current_cipher(ssl), NULL, 128);
    25. LOG(LS_INFO) << "Cipher: " << cipher_description;
    26. OPENSSL_free(cipher_description);
    27. }
    28. #endif
    29.  
    30. bool ok = false;
    31. int extension_count = X509_get_ext_count(certificate);
    32. for (int i = 0; i < extension_count; ++i) {
    33. X509_EXTENSION* extension = X509_get_ext(certificate, i);
    34. int extension_nid = OBJ_obj2nid(X509_EXTENSION_get_object(extension));
    35.  
    36. if (extension_nid == NID_subject_alt_name) {
    37. X509V3_EXT_METHOD* meth = X509V3_EXT_get(extension);
    38. if (!meth)
    39. break;
    40.  
    41. void* ext_str = NULL;
    42. if (meth->it) {
    43. ext_str = ASN1_item_d2i(NULL, &(extension->value->data), extension->value->length,
    44. ASN1_ITEM_ptr(meth->it));
    45. } else {
    46. ext_str = meth->d2i(NULL, &(extension->value->data), extension->value->length);
    47. }
    48.  
    49. STACK_OF(CONF_VALUE)* value = meth->i2v(meth, ext_str, NULL);
    50. for (int j = 0; j < sk_CONF_VALUE_num(value); ++j) {
    51. CONF_VALUE* nval = sk_CONF_VALUE_value(value, j);
    52. if (!strcmp(nval->name, "DNS") && !strcmp(nval->value, host)) {
    53. ok = true;
    54. break;
    55. }
    56. }
    57. }
    58. if (ok)
    59. break;
    60. }
    61.  
    62. char data[256];
    63. X509_name_st* subject;
    64. if (!ok
    65. && (subject = X509_get_subject_name(certificate))
    66. && (X509_NAME_get_text_by_NID(subject, NID_commonName,
    67. data, sizeof(data)) > 0)) {
    68. data[sizeof(data)-1] = 0;
    69. if (_stricmp(data, host) == 0)
    70. ok = true;
    71. }
    72.  
    73. X509_free(certificate);
    74.  
    75. if (!ok && ignore_bad_cert()) {
    76. LOG(LS_WARNING) << "TLS certificate check FAILED. "
    77. << "Allowing connection anyway.";
    78. ok = true;
    79. }
    80.  
    81. if (ok)
    82. ok = (SSL_get_verify_result(ssl) == X509_V_OK);
    83.  
    84. if (!ok && ignore_bad_cert()) {
    85. LOG(LS_INFO) << "Other TLS post connection checks failed.";
    86. ok = true;
    87. }
    88.  
    89. return ok;
    90. }
    91.  
    92. #if _DEBUG
    93.  
    94. // We only use this for tracing and so it is only needed in debug mode
    95.  
    96. void
    97. OpenSSLAdapter::SSLInfoCallback(const SSL* s, int where, int ret) {
    98. const char* str = "undefined";
    99. int w = where & ~SSL_ST_MASK;
    100. if (w & SSL_ST_CONNECT) {
    101. str = "SSL_connect";
    102. } else if (w & SSL_ST_ACCEPT) {
    103. str = "SSL_accept";
    104. }
    105. if (where & SSL_CB_LOOP) {
    106. LOG(LS_INFO) << str << ":" << SSL_state_string_long(s);
    107. } else if (where & SSL_CB_ALERT) {
    108. str = (where & SSL_CB_READ) ? "read" : "write";
    109. LOG(LS_INFO) << "SSL3 alert " << str
    110. << ":" << SSL_alert_type_string_long(ret)
    111. << ":" << SSL_alert_desc_string_long(ret);
    112. } else if (where & SSL_CB_EXIT) {
    113. if (ret == 0) {
    114. LOG(LS_INFO) << str << ":failed in " << SSL_state_string_long(s);
    115. } else if (ret < 0) {
    116. LOG(LS_INFO) << str << ":error in " << SSL_state_string_long(s);
    117. }
    118. }
    119. }
    120.  
    121. #endif // _DEBUG
    122.  
    123. int
    124. OpenSSLAdapter::SSLVerifyCallback(int ok, X509_STORE_CTX* store) {
    125. #if _DEBUG
    126. if (!ok) {
    127. char data[256];
    128. X509* cert = X509_STORE_CTX_get_current_cert(store);
    129. int depth = X509_STORE_CTX_get_error_depth(store);
    130. int err = X509_STORE_CTX_get_error(store);
    131.  
    132. LOG(LS_INFO) << "Error with certificate at depth: " << depth;
    133. X509_NAME_oneline(X509_get_issuer_name(cert), data, sizeof(data));
    134. LOG(LS_INFO) << " issuer = " << data;
    135. X509_NAME_oneline(X509_get_subject_name(cert), data, sizeof(data));
    136. LOG(LS_INFO) << " subject = " << data;
    137. LOG(LS_INFO) << " err = " << err
    138. << ":" << X509_verify_cert_error_string(err);
    139. }
    140. #endif
    141.  
    142. // Get our stream pointer from the store
    143. SSL* ssl = reinterpret_cast<SSL*>(
    144. X509_STORE_CTX_get_ex_data(store,
    145. SSL_get_ex_data_X509_STORE_CTX_idx()));
    146.  
    147. OpenSSLAdapter* stream =
    148. reinterpret_cast<OpenSSLAdapter*>(SSL_get_app_data(ssl));
    149.  
    150. if (!ok && stream->ignore_bad_cert()) {
    151. LOG(LS_WARNING) << "Ignoring cert error while verifying cert chain";
    152. ok = 1;
    153. }
    154.  
    155. return ok;
    156. }
    157.  
    158. SSL_CTX*
    159. OpenSSLAdapter::SetupSSLContext() {
    160. SSL_CTX* ctx = SSL_CTX_new(TLSv1_client_method());
    161. if (ctx == NULL)
    162. return NULL;
    163.  
    164. // Add the root cert to the SSL context
    165. unsigned char* cert_buffer
    166. = EquifaxSecureGlobalEBusinessCA1_certificate;
    167. size_t cert_buffer_len = sizeof(EquifaxSecureGlobalEBusinessCA1_certificate);
    168. X509* cert = d2i_X509(NULL, &cert_buffer, cert_buffer_len);
    169. if (cert == NULL) {
    170. SSL_CTX_free(ctx);
    171. return NULL;
    172. }
    173. if (!X509_STORE_add_cert(SSL_CTX_get_cert_store(ctx), cert)) {
    174. X509_free(cert);
    175. SSL_CTX_free(ctx);
    176. return NULL;
    177. }
    178.  
    179. #ifdef _DEBUG
    180. SSL_CTX_set_info_callback(ctx, SSLInfoCallback);
    181. #endif
    182.  
    183. SSL_CTX_set_verify(ctx, SSL_VERIFY_PEER, SSLVerifyCallback);
    184. SSL_CTX_set_verify_depth(ctx, 4);
    185. SSL_CTX_set_cipher_list(ctx, "ALL:!ADH:!LOW:!EXP:!MD5:@STRENGTH");
    186.  
    187. return ctx;
    188. }
    189.  
    190. } // namespace cricket
    To copy to clipboard, switch view to plain text mode 
    Qt 5.3 Opensource & Creator 3.1.2

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Weird compiler errors

    Quote Originally Posted by MarkoSan
    There is something very fishy in this lines:
    Which are those lines number 651 and 653?

  5. #5
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Weird compiler errors

    Quote Originally Posted by jacek
    Which are those lines number 651 and 653?
    Line 44 is line 651 in code. Please help!!!
    Qt 5.3 Opensource & Creator 3.1.2

  6. #6
    Join Date
    Jan 2006
    Location
    travelling
    Posts
    1,116
    Thanks
    8
    Thanked 127 Times in 121 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Weird compiler errors

    Qt Code:
    1. openssladapter.cc:651: error: invalid conversion from `unsigned char**` to `const unsigned char**`
    2. [COLOR=#666666][/COLOR]
    To copy to clipboard, switch view to plain text mode 
    What sounds very weird is not the code, it's the message outputted by gcc! AFAIK there is no need of any cast to convert T** to const T**... Looks like troubles are coming from your compiler...
    Current Qt projects : QCodeEdit, RotiDeCode

  7. #7
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Weird compiler errors

    Quote Originally Posted by fullmetalcoder
    Qt Code:
    1. openssladapter.cc:651: error: invalid conversion from `unsigned char**` to `const unsigned char**`
    To copy to clipboard, switch view to plain text mode 
    What sounds very weird is not the code, it's the message outputted by gcc! AFAIK there is no need of any cast to convert T** to const T**... Looks like troubles are coming from your compiler...
    I am aware of that, are there any guidelines/ideas, what could be wrong???
    Qt 5.3 Opensource & Creator 3.1.2

  8. #8
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Weird compiler errors

    I guess it's the problem with g++ 3.3.6. Following program compiles without any problems on g++ 4.1.2:
    Qt Code:
    1. void func( const unsigned char **c )
    2. {
    3. }
    4.  
    5. int main()
    6. {
    7. unsigned char *a = 0;
    8. func( &a );
    9. return 0;
    10. }
    To copy to clipboard, switch view to plain text mode 
    while g++ 3.3.6 reports the same error as in libjingle code.

    Read this:https://sourceforge.net/tracker/inde...94&atid=794428

  9. #9
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Weird compiler errors

    Where did you get 4.1.2 version? I cannot find it anywhere. I downloaded the latest version of gcc, same shit.
    Qt 5.3 Opensource & Creator 3.1.2

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Weird compiler errors

    Quote Originally Posted by MarkoSan
    Where did you get 4.1.2 version?
    It might be a snapshot, not an official release, but it's the default compiler in the Th release of PLD Linux (actually Th is still under development).

    I downloaded the latest version of gcc, same shit.
    Try g++ 3.3.5 or patch libjingle sources.

  11. #11
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Weird compiler errors

    I've downloaded tha patch file for libjingle, how do I now pach the libjingle source in the source tree?
    Qt 5.3 Opensource & Creator 3.1.2

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Weird compiler errors

    Quote Originally Posted by MarkoSan
    I've downloaded tha patch file for libjingle, how do I now pach the libjingle source in the source tree?
    See `man patch`.

    In short: Make sure that the main directory of libjingle sources is the current one and type:
    patch -p1 < /path/to/patch/something.patch

  13. #13
    Join Date
    Jan 2006
    Location
    Ljubljana
    Posts
    687
    Thanks
    111
    Thanked 4 Times in 4 Posts
    Qt products
    Qt5 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows Android

    Default Re: Weird compiler errors

    I've upgraded to gcc ver 4.1.1., now I got this shit:
    Qt Code:
    1. make[4]: Entering directory `/home/frelihm/projects/Qtopia/PopupMenu/source/fonav/services/gtalk/libjingle-0.3.0/talk/base'
    2. if /bin/sh ../../libtool --silent --tag=CXX --mode=compile g++ -DHAVE_CONFIG_H -I../.. -I/home/frelihm/projects/Qtopia/PopupMenu/source/fonav/work/include -DPOSIX -g -O2 -MT openssladapter.lo -MD -MP -MF ".deps/openssladapter.Tpo" -c -o openssladapter.lo openssladapter.cc; \
    3. then mv -f ".deps/openssladapter.Tpo" ".deps/openssladapter.Plo"; else rm -f ".deps/openssladapter.Tpo"; exit 1; fi
    4. ../../talk/base/stringutils.h:258: error: extra qualification 'cricket::Traits<char>::' on member 'empty_str'
    5. openssladapter.cc: In member function 'bool cricket::OpenSSLAdapter::SSLPostConnectionCheck(SSL*, const char*)':
    6. openssladapter.cc:651: error: invalid conversion from 'unsigned char**' to 'const unsigned char**'
    7. openssladapter.cc:651: error: initializing argument 2 of 'ASN1_VALUE* ASN1_item_d2i(ASN1_VALUE**, const unsigned char**, long int, const ASN1_ITEM*)'
    8. openssladapter.cc:653: error: invalid conversion from 'unsigned char**' to 'const unsigned char**'
    9. openssladapter.cc: In static member function 'static SSL_CTX* cricket::OpenSSLAdapter::SetupSSLContext()':
    10. openssladapter.cc:775: error: invalid conversion from 'unsigned char**' to 'const unsigned char**'
    11. openssladapter.cc:775: error: initializing argument 2 of 'X509* d2i_X509(X509**, const unsigned char**, long int)'
    12. make[4]: *** [openssladapter.lo] Error 1
    13. make[4]: Leaving directory `/home/frelihm/projects/Qtopia/PopupMenu/source/fonav/services/gtalk/libjingle-0.3.0/talk/base'
    14. make[3]: *** [all-recursive] Error 1
    15. make[3]: Leaving directory `/home/frelihm/projects/Qtopia/PopupMenu/source/fonav/services/gtalk/libjingle-0.3.0/talk'
    16. make[2]: *** [all-recursive] Error 1
    17. make[2]: Leaving directory `/home/frelihm/projects/Qtopia/PopupMenu/source/fonav/services/gtalk/libjingle-0.3.0'
    18. make[1]: *** [all] Error 2
    19. make[1]: Leaving directory `/home/frelihm/projects/Qtopia/PopupMenu/source/fonav/services/gtalk/libjingle-0.3.0'
    20. make: *** [libjingle] Error 1
    To copy to clipboard, switch view to plain text mode 

    I am desperate!!!!
    Qt 5.3 Opensource & Creator 3.1.2

  14. #14
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Weird compiler errors

    Apply that patch or downgrade to gcc 3.3.5.

Similar Threads

  1. Linker Errors
    By MarkoSan in forum Qt Programming
    Replies: 5
    Last Post: 7th March 2006, 18:30
  2. Qt 4.1.0 - static examples run with errors!
    By Elder Orb in forum Qt Programming
    Replies: 1
    Last Post: 12th January 2006, 09:40

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.