[SOLVED] GCC- -native angstrom install


Kosmos

Member
Joined
Apr 10, 2012
Messages
228
I just upgrade to SZ1.55 from 1.52.

On SZ1.52 I used opkg to install the gcc tools and packages so I could compile from the command-line natively.   This worked flawlessly. However now on SZ 1.55 I install all the same packages but now when I run:

   $ g++ pause.cpp

     Pause.cpp 1:20: error: iostream, No such file or Directory.

What is missing that was not before? Why is the linker/compiler not finding the standard libraries.   Thank You.
 
Last edited by a moderator:

skeezix

Internal Development
Joined
Mar 11, 2003
Messages
8,064
Website
www.codejedi.com
Did the ipk get updated somewhere along the line?

ie: That error would suggest iostream is not found (the header); that in turn implies it doesn't exist, or at least is not in the path being looked for.

Assuming you don't have another g++ installed, I'd assume the g++ or other ipk's you've installed are broken (changed and missing the header, or otherwise failing to install properly.) You could get g++ to display its path(s) for seeking for headers, see if they make sense.

But again, assuming the ipk's have not changed, then .. something in the firmware would be causing conflict .. you could chase that down, but first I'd check if the ipk's have changed. (heck, you could boot an older version of the firmware from SD, and install the ipk's there, see if they break again, or if they work.. that'd tell you its the firmware, without figuring out why.)

...jeff
 

Kosmos

Member
Joined
Apr 10, 2012
Messages
228
Here is a list of the actual IPKs downloaded by opkg and installed. Notice that libgcc1, libssp0, and libstdc++6 were upgraded.

opkg grabbed all these as dependancies. However

  • ># find /usr -name iostream

fails to show iostream installed...

Which package is supposed to install these? I expected g++_4.3.3-r11.1.5_armv7a.ipk but upon extracting the Data.tar.gz I found no lib directory nor iostream file.

LIST [corrected after solution]

  • binutils-dev_2.18.50.0.7-r7.1.5_armv7a.ipk (was missing)
  • binutils_2.18.50.0.7-r7.1.5_armv7a.ipk
  • cpp_4.3.3-r11.1.5_armv7a.ipk
  • cpp-symlinks_4.3.3-r11.1.5_armv7a.ipk
  • g++_4.3.3-r11.1.5_armv7a.ipk
  • gcc_4.3.3-r11.1.5_armv7a.ipk
  • gcc-doc_4.3.3-r11.1.5_armv7a.ipk
  • gcc-symlinks_4.3.3-r11.1.5_armv7a.ipk
  • glibc-dbg_2.9-r35.3.5_armv7a.ipk
  • glibc-extra-nss_2.9-r35.3.5_armv7a.ipk
  • glibc-pcprofile_2.9-r35.3.5_armv7a.ipk
  • glibc-utils_2.9-r35.3.5_armv7a.ipk
  • g++-symlinks_4.3.3-r11.1.5_armv7a.ipk
  • libc6_2.9-r35.3.5_armv7a.ipk
  • libc6-dev_2.9-r35.3.5_armv7a.ipk
  • libgcc1_4.3.3-r11.1.5_armv7a.ipk
  • libgcc1_4.3.3-r14.1.5_armv7a.ipk
  • libgmp-dev_4.2.4-r0.5.5_armv7a.ipk
  • libmpfr-dev_2.3.1-r1.5_armv7a.ipk
  • libssp0_4.3.3-r11.1.5_armv7a.ipk
  • libssp0_4.3.3-r14.1.5_armv7a.ipk
  • libstdc++6_4.3.3-r11.1.5_armv7a.ipk
  • libstdc++6_4.3.3-r14.1.5_armv7a.ipk
  • libstdc++-dev_4.3.3-r11.1.5_armv7a.ipk
  • linux-libc-headers-dbg_2.6.31-r3.5_armv7a.ipk
  • linux-libc-headers-dev_2.6.31-r3.5_armv7a.ipk
  • localedef_2.9-r35.3.5_armv7a.ipk
  • sln_2.9-r35.3.5_armv7a.ipk
  • update-rc.d-dbg_0.7-r1.5_all.ipk
  • update-rc.d-dev_0.7-r1.5_all.ipk
 
Last edited by a moderator:

Linux-SWAT

Hardcore Member
Joined
Feb 13, 2010
Messages
8,963
Iostream includes are in the g++-gcc package in Slackware. Hope it helps.
 

Kosmos

Member
Joined
Apr 10, 2012
Messages
228
Found it here:

    libstdc++-dev_4.3.3-r11.1.5_armv7a.ipk
        data.tar.gz
            /usr/include/c++/4.3.3

                                                     iostream

Except now when I compile "Pause.cpp" with g++ I get 33K in erros that I did not before.

The code is simply

  • #include <iostream>
  • using namespace std;
  •  
  • int main()
  • {
  •     char ch;
  •     cout << "Press any key to continue...";
  •     ch = cin.get();
  •     return 0;
  • }

The same code compiles fine in PanDebian.

Herre is a sample of the errors

In file included from /usr/include/c++/4.3.3/arm-angstrom-linux-gnueabi/bits/c++config.h:40,
                 from /usr/include/c++/4.3.3/iostream:44,
                 from ./pause.cpp:1:
/usr/include/c++/4.3.3/arm-angstrom-linux-gnueabi/bits/os_defines.h:44:22: error: features.h: No such file or directory
In file included from /usr/include/c++/4.3.3/bits/postypes.h:47,
                 from /usr/include/c++/4.3.3/iosfwd:47,
                 from /usr/include/c++/4.3.3/ios:44,
                 from /usr/include/c++/4.3.3/ostream:45,
                 from /usr/include/c++/4.3.3/iostream:45,
                 from ./pause.cpp:1:
/usr/include/c++/4.3.3/cwchar:55:19: error: wchar.h: No such file or directory
In file included from /usr/include/c++/4.3.3/iosfwd:47,
                 from /usr/include/c++/4.3.3/ios:44,
                 from /usr/include/c++/4.3.3/ostream:45,
                 from /usr/include/c++/4.3.3/iostream:45,
                 from ./pause.cpp:1:
 

skeezix

Internal Development
Joined
Mar 11, 2003
Messages
8,064
Website
www.codejedi.com
Sounds like you're missing more files (features.h, wchar.h, whatever).

You'll have to keep tracing things down .. note that you're delving into Angstrom stuff here, so you'll jsut have to work it out.

Why not use cdevtools and call it a day? :) (installing from Angstrom can be risky..)

jeff
 

Kosmos

Member
Joined
Apr 10, 2012
Messages
228
OK, It was a fun experience and part of my "Why!" is to learn.... It has been a good way to learrn about GCC as I go through my book. I have also learned a lot about dependencies and install order.

anyway I found two things. Order is important.  When a package errors trying to over-write a file from a previous package... Uninstall the first and reverse the order.

Second, DEV packages may be necessary. In this case - bin-utils-dev solved the problem

Native Compiling works again!

Thank You!
 
Last edited by a moderator:

skeezix

Internal Development
Joined
Mar 11, 2003
Messages
8,064
Website
www.codejedi.com
'dev' packages are certainly required for when you want to do 'dev' work :)

Usually a bin package (for average user) will just be compiled binaries (libraries, executables).. whatever is needed. The -dev version usually implies header files or transient files needed to actually build with that unit.

jeff

Glad you are sorted out :)
 
Last edited by a moderator:
Top