WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: stdlib.h not found after upgrade to 6.0  (Read 7162 times)

Offline vbs

  • Newbie
  • *
  • Posts: 21
stdlib.h not found after upgrade to 6.0
« on: January 24, 2015, 08:50:36 AM »
I just upgraded to TC 6.0 and while I am trying to install some Perl modules I got this error when installing XML::Parser:
Code: [Select]
cp Parser/Encodings/big5.enc blib/lib/XML/Parser/Encodings/big5.enc
cp Parser.pm blib/lib/XML/Parser.pm
cp Parser/Encodings/iso-8859-7.enc blib/lib/XML/Parser/Encodings/iso-8859-7.enc
make[1]: Entering directory '/root/.cpan/build/XML-Parser-2.44-hHh8w9/Expat'
cp Expat.pm ../blib/lib/XML/Parser/Expat.pm
Running Mkbootstrap for XML::Parser::Expat ()
chmod 644 "Expat.bs"
"/tmp/tcloop/perl5/usr/local/bin/perl" "/usr/local/lib/perl5/5.20.0/ExtUtils/xsubpp" -noprototypes -typemap "/usr/local/lib/perl5/5.20.0/ExtUtils/typemap" -typemap "typemap"  Expat.xs > Expat.xsc && mv Expat.xsc Expat.c
gcc -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe -c   -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"2.44\" -DXS_VERSION=\"2.44\" -fPIC "-I/usr/local/lib/perl5/5.20.0/i486-linux/CORE"   Expat.c
In file included from Expat.xs:12:0:
/usr/local/include/expat.h:17:20: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
                    ^

So it says it cannot find stdlib.h.

I have this modules installed and loaded:
Code: [Select]
tc@fhem:/mnt/sda1/tce/optional$ ls -la gcc*
-rw-r--r--    1 tc       staff     23740416 Jan 24 14:38 gcc.tcz
-rw-r--r--    1 tc       staff           65 Jan 24 14:38 gcc.tcz.dep
-rw-r--r--    1 tc       staff           42 Jan 24 14:38 gcc.tcz.md5.txt
-rw-r--r--    1 tc       staff       606208 Jan 24 14:38 gcc_base-dev.tcz
-rw-r--r--    1 tc       staff           51 Jan 24 14:38 gcc_base-dev.tcz.md5.txt
-rw-r--r--    1 tc       staff         4096 Jan 24 14:38 gcc_libs-dev.tcz
-rw-r--r--    1 tc       staff           13 Jan 24 14:38 gcc_libs-dev.tcz.dep
-rw-r--r--    1 tc       staff           51 Jan 24 14:38 gcc_libs-dev.tcz.md5.txt
-rw-r--r--    1 tc       staff       602112 Jan 24 14:38 gcc_libs.tcz
-rw-r--r--    1 tc       staff           47 Jan 24 14:38 gcc_libs.tcz.md5.txt

Also I have the header in some C++ include dir:
Code: [Select]
tc@fhem:/usr/local$ find -name stdlib.h
./include/c++/4.9.1/tr1/stdlib.h

I simplified the problem by compiling a simple program:
Code: [Select]
#include <stdlib.h>

int main(int argc, char* argv[]) {
        return 1;
}

But it also fails:
Code: [Select]
tc@fhem:~$ gcc test.cpp
test.cpp:1:20: fatal error: stdlib.h: No such file or directory
 #include <stdlib.h>
                    ^
compilation terminated.

Well, any hints please?  :-\

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: stdlib.h not found after upgrade to 6.0
« Reply #1 on: January 24, 2015, 09:05:04 AM »
Use the perl_xml_parser extension, maybe ;)

BTW, to compile you need to use the compiletc extension rather than gcc*
« Last Edit: January 24, 2015, 09:07:39 AM by Juanito »

Offline vbs

  • Newbie
  • *
  • Posts: 21
Re: stdlib.h not found after upgrade to 6.0
« Reply #2 on: January 24, 2015, 09:13:32 AM »
Thanks for fast reply but this is not about Perl XML::Parser in particular. I have similar problems with other modules also. When trying to install Net::SSLeay:
Code: [Select]
cp lib/Net/SSLeay.pod blib/lib/Net/SSLeay.pod
Running Mkbootstrap for Net::SSLeay ()
chmod 644 "SSLeay.bs"
"/tmp/tcloop/perl5/usr/local/bin/perl" "-Iinc" "/usr/local/lib/perl5/5.20.0/ExtUtils/xsubpp"  -typemap "/usr/local/lib/perl5/5.20.0/ExtUtils/typemap" -typemap "typemap"  SSLeay.xs > SSLeay.xsc && mv SSLeay.xsc SSLeay.c
gcc -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe -c   -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"1.68\" -DXS_VERSION=\"1.68\" -fPIC "-I/usr/local/lib/perl5/5.20.0/i486-linux/CORE"   SSLeay.c
In file included from SSLeay.xs:141:0:
/usr/local/lib/perl5/5.20.0/i486-linux/CORE/perl.h:643:23: fatal error: sys/types.h: No such file or directory
 #include <sys/types.h>
                       ^

So it seems it cannot find lots of base headers. Also I cound not find a TCE for Net::SSLeay :(

EDIT:
I tried to install compiletc but it says its already there.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: stdlib.h not found after upgrade to 6.0
« Reply #3 on: January 24, 2015, 09:45:10 AM »
Are you doing this from the uncompressed source (Net-SSLeay-1.68.tar.gz):
Code: [Select]
$ perl Makefile.PL
$ make
« Last Edit: January 24, 2015, 09:48:59 AM by Juanito »

Offline vbs

  • Newbie
  • *
  • Posts: 21
Re: stdlib.h not found after upgrade to 6.0
« Reply #4 on: January 24, 2015, 09:58:41 AM »
I usually do it by "cpan Net::SSLeay" but I have the same error when doing it manually:

Gives me the same error:
Code: [Select]
tc@fhem:~$ wget http://search.cpan.org/CPAN/authors/id/M/MI/MIKEM/Net-SSLeay-1.68.tar.gz
Connecting to search.cpan.org (207.171.7.59:80)
Connecting to www.cpan.org (94.242.223.198:80)
Net-SSLeay-1.68.tar. 100% |******************************************************************************************************************************************|   375k  0:00:00 ETA
tc@fhem:~$ tar xvfz Net-SSLeay-1.68.tar.gz
Net-SSLeay-1.68/
Net-SSLeay-1.68/ppport.h
Net-SSLeay-1.68/LICENSE
Net-SSLeay-1.68/typemap
Net-SSLeay-1.68/README
Net-SSLeay-1.68/Changes
Net-SSLeay-1.68/QuickRef
Net-SSLeay-1.68/lib/
Net-SSLeay-1.68/lib/Net/
Net-SSLeay-1.68/lib/Net/SSLeay/
Net-SSLeay-1.68/lib/Net/SSLeay/Handle.pm
Net-SSLeay-1.68/lib/Net/SSLeay.pm
Net-SSLeay-1.68/lib/Net/SSLeay.pod
Net-SSLeay-1.68/Credits
Net-SSLeay-1.68/helper_script/
Net-SSLeay-1.68/helper_script/regen_openssl_constants.pl
Net-SSLeay-1.68/inc/
Net-SSLeay-1.68/inc/Module/
Net-SSLeay-1.68/inc/Module/Install.pm
Net-SSLeay-1.68/inc/Module/Install/
Net-SSLeay-1.68/inc/Module/Install/Base.pm
Net-SSLeay-1.68/inc/Module/Install/PRIVATE/
Net-SSLeay-1.68/inc/Module/Install/PRIVATE/Net/
Net-SSLeay-1.68/inc/Module/Install/PRIVATE/Net/SSLeay.pm
Net-SSLeay-1.68/inc/Module/Install/Metadata.pm
Net-SSLeay-1.68/inc/Module/Install/WriteAll.pm
Net-SSLeay-1.68/inc/Module/Install/Makefile.pm
Net-SSLeay-1.68/inc/Module/Install/Win32.pm
Net-SSLeay-1.68/inc/Module/Install/Fetch.pm
Net-SSLeay-1.68/inc/Module/Install/External.pm
Net-SSLeay-1.68/inc/Module/Install/Can.pm
Net-SSLeay-1.68/META.yml
Net-SSLeay-1.68/README.Win32
Net-SSLeay-1.68/t/
Net-SSLeay-1.68/t/local/
Net-SSLeay-1.68/t/local/34_x509_crl.t
Net-SSLeay-1.68/t/local/06_tcpecho.t
Net-SSLeay-1.68/t/local/02_pod_coverage.t
Net-SSLeay-1.68/t/local/39_pkcs12.t
Net-SSLeay-1.68/t/local/03_use.t
Net-SSLeay-1.68/t/local/30_error.t
Net-SSLeay-1.68/t/local/32_x509_get_cert_info.t
Net-SSLeay-1.68/t/local/05_passwd_cb.t
Net-SSLeay-1.68/t/local/37_asn1_time.t
Net-SSLeay-1.68/t/local/07_sslecho.t
Net-SSLeay-1.68/t/local/61_threads-cb-crash.t
Net-SSLeay-1.68/t/local/04_basic.t
Net-SSLeay-1.68/t/local/kwalitee.t
Net-SSLeay-1.68/t/local/31_rsa_generate_key.t
Net-SSLeay-1.68/t/local/20_autoload.t
Net-SSLeay-1.68/t/local/41_alpn_support.t
Net-SSLeay-1.68/t/local/36_verify.t
Net-SSLeay-1.68/t/local/21_constants.t
Net-SSLeay-1.68/t/local/15_bio.t
Net-SSLeay-1.68/t/local/40_npn_support.t
Net-SSLeay-1.68/t/local/50_digest.t
Net-SSLeay-1.68/t/local/38_priv-key.t
Net-SSLeay-1.68/t/local/42_info_callback.t
Net-SSLeay-1.68/t/local/35_ephemeral.t
Net-SSLeay-1.68/t/local/01_pod.t
Net-SSLeay-1.68/t/local/08_pipe.t
Net-SSLeay-1.68/t/local/62_threads-ctx_new-deadlock.t
Net-SSLeay-1.68/t/local/33_x509_create_cert.t
Net-SSLeay-1.68/t/external/
Net-SSLeay-1.68/t/external/20_cert_chain.t
Net-SSLeay-1.68/t/external/ocsp.t
Net-SSLeay-1.68/t/external/08_external.t
Net-SSLeay-1.68/t/external/15_altnames.t
Net-SSLeay-1.68/t/handle/
Net-SSLeay-1.68/t/handle/local/
Net-SSLeay-1.68/t/handle/local/05_use.t
Net-SSLeay-1.68/t/handle/external/
Net-SSLeay-1.68/t/handle/external/10_destroy.t
Net-SSLeay-1.68/t/handle/external/50_external.t
Net-SSLeay-1.68/t/data/
Net-SSLeay-1.68/t/data/key.pem.e
Net-SSLeay-1.68/t/data/verisign.crl.pem
Net-SSLeay-1.68/t/data/cert_paypal.crt.pem
Net-SSLeay-1.68/t/data/cert_paypal.crt.pem_dump
Net-SSLeay-1.68/t/data/pkcs12-no-passwd.p12
Net-SSLeay-1.68/t/data/testcert_extended.crt.pem
Net-SSLeay-1.68/t/data/testcert_simple.crt.pem
Net-SSLeay-1.68/t/data/testcert_strange.crt.pem_dump
Net-SSLeay-1.68/t/data/test_CA1.key.der
Net-SSLeay-1.68/t/data/testcert_cdp.crt.pem_dump
Net-SSLeay-1.68/t/data/test_CA1.encrypted_key.pem
Net-SSLeay-1.68/t/data/testcert_cdp.crt.pem
Net-SSLeay-1.68/t/data/test_CA1.crt.der
Net-SSLeay-1.68/t/data/test_CA1.crl.der
Net-SSLeay-1.68/t/data/testreq1.der
Net-SSLeay-1.68/t/data/testcert_simple.crt.der
Net-SSLeay-1.68/t/data/pkcs12-full.p12
Net-SSLeay-1.68/t/data/cert_twitter.crt.pem_dump
Net-SSLeay-1.68/t/data/binary-test.file
Net-SSLeay-1.68/t/data/test_CA1.crt.pem
Net-SSLeay-1.68/t/data/testcert_simple.crt.pem_dump
Net-SSLeay-1.68/t/data/testcert_extended.crt.pem_dump
Net-SSLeay-1.68/t/data/key.pem
Net-SSLeay-1.68/t/data/testcert_strange.crt.pem
Net-SSLeay-1.68/t/data/pkcs12-no-chain.p12
Net-SSLeay-1.68/t/data/cert_twitter.crt.pem
Net-SSLeay-1.68/t/data/test_CA1.key.pem
Net-SSLeay-1.68/t/data/cert.pem
Net-SSLeay-1.68/t/data/verisign.crl.der
Net-SSLeay-1.68/t/data/testreq1.pem
Net-SSLeay-1.68/MANIFEST
Net-SSLeay-1.68/constants.c
Net-SSLeay-1.68/SSLeay.xs
Net-SSLeay-1.68/README.VMS
Net-SSLeay-1.68/Makefile.PL
Net-SSLeay-1.68/examples/
Net-SSLeay-1.68/examples/https-proxy-snif.pl
Net-SSLeay-1.68/examples/cb-testi.pl
Net-SSLeay-1.68/examples/server_key.pem
Net-SSLeay-1.68/examples/ephemeral.pl
Net-SSLeay-1.68/examples/passwd-cb.pl
Net-SSLeay-1.68/examples/tcpcat.pl
Net-SSLeay-1.68/examples/sslcat.pl
Net-SSLeay-1.68/examples/bio.pl
Net-SSLeay-1.68/examples/cli-cert.pl
Net-SSLeay-1.68/examples/ssl-inetd-serv.pl
Net-SSLeay-1.68/examples/callback.pl
Net-SSLeay-1.68/examples/get_page_cert.pl
Net-SSLeay-1.68/examples/get_page.pl
Net-SSLeay-1.68/examples/tcpecho.pl
Net-SSLeay-1.68/examples/x509_cert_details.pl
Net-SSLeay-1.68/examples/bulk.pl
Net-SSLeay-1.68/examples/req.conf
Net-SSLeay-1.68/examples/sslecho.pl
Net-SSLeay-1.68/examples/makecert.pl
Net-SSLeay-1.68/examples/get_authenticated_page.pl
Net-SSLeay-1.68/examples/ssl_diff.pl
Net-SSLeay-1.68/examples/minicli.pl
Net-SSLeay-1.68/examples/stdio_bulk.pl
tc@fhem:~$ cd Net-SSLeay-1.68/
tc@fhem:~/Net-SSLeay-1.68$ perl Makefile.PL
Checking if your kit is complete...
Looks good
Warning: Guessing NAME [Net-SSLeay] from current directory name.
Warning: NAME must be a package name
*** Found OpenSSL-1.0.1i installed in .
*** Be sure to use the same compiler and options to compile your OpenSSL, perl,
    and Net::SSLeay. Mixing and matching compilers is not supported.
Do you want to run external tests?
These tests *will* *fail* if you do not have network connectivity. [n]
Checking if your kit is complete...
Looks good
Warning: -L. changed to -L/home/tc/Net-SSLeay-1.68/.
Warning: -L./lib changed to -L/home/tc/Net-SSLeay-1.68/./lib
Generating a Unix-style Makefile
Writing Makefile for Net::SSLeay
Writing MYMETA.yml and MYMETA.json
tc@fhem:~/Net-SSLeay-1.68$ make
cp lib/Net/SSLeay.pm blib/lib/Net/SSLeay.pm
AutoSplitting blib/lib/Net/SSLeay.pm (blib/lib/auto/Net/SSLeay)
blib/lib/Net/SSLeay.pm: some names are not unique when truncated to 8 characters:
 directory blib/lib/auto/Net/SSLeay:
  do_https3.al, do_https2.al, do_https4.al, do_https.al truncate to do_https
  do_httpx3.al, do_httpx2.al, do_httpx4.al truncate to do_httpx
  get_https.al, get_https3.al, get_https4.al, get_http.al, get_http3.al, get_http4.al, get_httpx.al, get_httpx3.al, get_httpx4.al truncate to get_http
  head_https.al, head_https3.al, head_https4.al, head_http.al, head_http3.al, head_http4.al, head_httpx.al, head_httpx3.al, head_httpx4.al truncate to head_htt
  post_https.al, post_https3.al, post_https4.al, post_http.al, post_http3.al, post_http4.al, post_httpx.al, post_httpx3.al, post_httpx4.al truncate to post_htt
  put_https.al, put_https3.al, put_https4.al, put_http.al, put_http3.al, put_http4.al, put_httpx.al, put_httpx3.al, put_httpx4.al truncate to put_http
  ssl_read_all.al, ssl_read_until.al, ssl_read_CRLF.al truncate to ssl_read
  ssl_write_all.al, ssl_write_CRLF.al truncate to ssl_writ
  tcp_read_all.al, tcp_read_until.al, tcp_read_CRLF.al truncate to tcp_read
  tcp_write_all.al, tcp_write_CRLF.al truncate to tcp_writ
cp lib/Net/SSLeay.pod blib/lib/Net/SSLeay.pod
cp lib/Net/SSLeay/Handle.pm blib/lib/Net/SSLeay/Handle.pm
Running Mkbootstrap for Net::SSLeay ()
chmod 644 "SSLeay.bs"
"/tmp/tcloop/perl5/usr/local/bin/perl" "-Iinc" "/usr/local/lib/perl5/5.20.0/ExtUtils/xsubpp"  -typemap "/usr/local/lib/perl5/5.20.0/ExtUtils/typemap" -typemap "typemap"  SSLeay.xs > SSLeay.xsc && mv SSLeay.xsc SSLeay.c
gcc -flto -fuse-linker-plugin -march=i486 -mtune=i686 -Os -pipe -c   -fwrapv -fno-strict-aliasing -pipe -fstack-protector -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2   -DVERSION=\"1.68\" -DXS_VERSION=\"1.68\" -fPIC "-I/usr/local/lib/perl5/5.20.0/i486-linux/CORE"   SSLeay.c
In file included from SSLeay.xs:141:0:
/usr/local/lib/perl5/5.20.0/i486-linux/CORE/perl.h:643:23: fatal error: sys/types.h: No such file or directory
 #include <sys/types.h>
                       ^
compilation terminated.
Makefile:359: recipe for target 'SSLeay.o' failed
make: *** [SSLeay.o] Error 1
tc@fhem:~/Net-SSLeay-1.68$

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: stdlib.h not found after upgrade to 6.0
« Reply #5 on: January 24, 2015, 10:27:21 AM »
perl_xml_parser certainly compiles without errors on tc-6.x - I'll have a look at Net-SSLeay tomorrow.

Offline vbs

  • Newbie
  • *
  • Posts: 21
Re: stdlib.h not found after upgrade to 6.0
« Reply #6 on: January 24, 2015, 11:16:32 AM »
Ok thank you. But I dont think the problem is specific to SSLeay since even my tiny test program did not compile:
Code: [Select]
#include <stdlib.h>

int main(int argc, char* argv[]) {
        return 1;
}

Also this http://search.cpan.org/CPAN/authors/id/T/TO/TODDR/XML-Parser-2.44.tar.gz does not compile with the error from my original post.

Maybe something related to my upgrade?

Offline vbs

  • Newbie
  • *
  • Posts: 21
Re: stdlib.h not found after upgrade to 6.0
« Reply #7 on: January 24, 2015, 11:31:25 AM »
Tested again with a fresh 6.0 and then my test prog compiles fine... So what could be the reason? Some extensions I carried over not compatible with 6.0?

What can I do about it? Delete all extensions and redownload?

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11619
Re: stdlib.h not found after upgrade to 6.0
« Reply #8 on: January 24, 2015, 11:34:04 AM »
Hi vbs
You probably did not have  glibc_base-dev.tcz  installed. If you run  find  for  stdlib.h  again you'll probably see additional entries.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: stdlib.h not found after upgrade to 6.0
« Reply #9 on: January 24, 2015, 12:22:20 PM »
You can run a normal extension update using Apps. That will save bandwidth, with it only downloading changes.
The only barriers that can stop you are the ones you create yourself.

Offline vbs

  • Newbie
  • *
  • Posts: 21
Re: stdlib.h not found after upgrade to 6.0
« Reply #10 on: January 24, 2015, 12:42:34 PM »
I think I had glibc_base-dev.tcz and it also appeared in the file list in my first post. When I tried to install it again it said that it is already there. But ok, I went and deleted all extensions and mydata.tgz (backup before ofc). Then I reinstalled all extensions from scratch and now everything is working flawlessly.

Now I have several stdlib.h as Rich said:
Code: [Select]
tc@box:/usr$ find -name stdlib.h
./include/stdlib.h
./include/bits/stdlib.h
./local/include/c++/4.9.1/tr1/stdlib.h

So, in the end, dunno :) Maybe I messed up or upgrading from 5 to 6 was a bad idea in the first place. A fresh reinstall was easy enough... Anyway, thank for support guys!

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11619
Re: stdlib.h not found after upgrade to 6.0
« Reply #11 on: January 24, 2015, 12:55:44 PM »
Hi vbs
Quote
I think I had glibc_base-dev.tcz and it also appeared in the file list in my first post.
Look again. Your first post did not list  glibc_base-dev.tcz. Compiletc used to depend on  eglibc_base-dev.tcz. Depending on what you
upgraded from and how you performed that upgrade, something may have gotten mixed up there.

Offline vbs

  • Newbie
  • *
  • Posts: 21
Re: stdlib.h not found after upgrade to 6.0
« Reply #12 on: January 24, 2015, 01:07:13 PM »
Oh right, sorry.

Offline Juanito

  • Administrator
  • Hero Member
  • *****
  • Posts: 14815
Re: stdlib.h not found after upgrade to 6.0
« Reply #13 on: January 25, 2015, 01:44:50 AM »
BTW, if you could submit perl_net_ssleay and other extensions once built, it would be much appreciated  :)

Offline vbs

  • Newbie
  • *
  • Posts: 21
Re: stdlib.h not found after upgrade to 6.0
« Reply #14 on: January 25, 2015, 05:42:11 AM »
I will happily submit whatever you need but I have not much clue about TC packages. I installed a bunch of Perl modules by cpan now. Here is my directory structure now and I can upload what you need:
http://pastebin.com/7ZE0HeTx

One basic question please: Why do you guys craft these prebuilt Perl packages in the first place when users can install them by cpan anyway? The only advantage I can see is that you dont need a compiler?