OpenWrt Forum Archive

Topic: newbie trying to build first project with openwrt - link problem

The content of this topic has been archived on 2 Apr 2018. There are no obvious gaps in this topic, but there may still be some posts missing at the end.

Hello all

Im using an embedded platform which is running openwrt.

To build SW for this platform I have put the tolls on a PC running mandrake linux.

So I start with a very simple program called test1.c


int main(void)
{
   return 0;
   
}


Then on the command line I use

arm-linux-uclibc-gcc test1.c -L /home/denis/work/toolchain-arm_gcc4.1.2/lib 

and I get

/home/denis/work/toolchain-arm_gcc4.1.2/bin/../lib/gcc/arm-linux-uclibc/4.1.2/../../../../arm-linux-uclibc/bin/ld: warning: ld-uClibc.so.0, needed by /home/denis/work/toolchain-arm_gcc4.1.2/lib/libc.so, not found (try using -rpath or -rpath-link)
/home/denis/work/toolchain-arm_gcc4.1.2/lib/libc.so: undefined reference to `_dl_app_init_array'
/home/denis/work/toolchain-arm_gcc4.1.2/lib/libc.so: undefined reference to `_dl_app_fini_array'
collect2: ld returned 1 exit status

Im stuck here
home/denis/work/toolchain-arm_gcc4.1.2/lib  contains     ld-uClibc.so.0   I can see it when I look in File Manager

Do I need another library include path?

Many  thanks for any help.

Regards

Denis

i dont have a build chain here atm - and cant reboot now, but try adding -I /home/denis/work/toolchain-arm_gcc4.1.2/include - since you dont have an include path.

if it doesnt help, just build openwrt, then you will see how the makefile invokes the compiler. just press ctrl+c and read the log searching for compiler calls.

Hm.....

And there was me trying to do the simple things first.

I get the following when I run make

[denis@localhost OpenWrt-SDK-at91-for-Linux-i686]$ make
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'working-gcc'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... failed.
Checking 'zlib'... ok.
Checking 'gawk'... ok.
Checking 'bison'... ok.
Checking 'flex'... failed.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'patch'... failed.
Checking 'perl'... ok.
Checking 'python'... ok.
Checking 'wget'... ok.
Checking 'gnutar'... ok.
Checking 'svn'... failed.
Checking 'autoconf'... ok.
Checking 'gnu-find'... ok.
Checking 'getopt-extended'... ok.
Checking 'non-root'... ok.

Build dependency: Please install ncurses. (Missing libncurses.so or ncurses.h)
Build dependency: Please install flex.
Build dependency: Please install patch.
Build dependency: Please install the subversion client.

Prerequisite check failed. Use FORCE=1 to override.
make[1]: *** [tmp/.prereq-build] Error 1
make: *** [world] Error 2

Guys

It would be a great help to get a simple makefile with a simple C file that created something that would run on the platform.

Anyone got a sample?

Thanks

Denis

Build dependency: Please install ncurses. (Missing libncurses.so or ncurses.h)
Build dependency: Please install flex.
Build dependency: Please install patch.
Build dependency: Please install the subversion client.

do this! you miss dependencies on the build-system. on debian "apt-get install libncurses-dev flex patch subversion"

also those links might help:
http://wiki.openwrt.org/doc/howto/buildroot
http://wiki.openwrt.org/doc/howto/build
http://wiki.openwrt.org/doc/howto/buildvm

Thanks mrii

Im using mandrake http://www2.mandriva.com/

Any idea how I install with it


thanks

Denis

ok right now Mnadrake is a pain for development. Great Desktop though!

I eventually figured out how to log in as root and used urpmi flex etc.....

I now have everything except ncurses.


[denis@localhost OpenWrt-SDK-at91-for-Linux-i686]$ make
Checking 'working-make'... ok.
Checking 'case-sensitive-fs'... ok.
Checking 'working-gcc'... ok.
Checking 'working-g++'... ok.
Checking 'ncurses'... failed.
Checking 'zlib'... ok.
Checking 'gawk'... ok.
Checking 'bison'... ok.
Checking 'flex'... ok.
Checking 'unzip'... ok.
Checking 'bzip2'... ok.
Checking 'patch'... ok.
Checking 'perl'... ok.
Checking 'python'... ok.
Checking 'wget'... ok.
Checking 'gnutar'... ok.
Checking 'svn'... ok.
Checking 'autoconf'... ok.
Checking 'gnu-find'... ok.
Checking 'getopt-extended'... ok.
Checking 'non-root'... ok.

Build dependency: Please install ncurses. (Missing libncurses.so or ncurses.h)

Prerequisite check failed. Use FORCE=1 to override.
make[1]: *** [tmp/.prereq-build] Error 1
make: *** [world] Error 2
[denis@localhost OpenWrt-SDK-at91-for-Linux-i686]$ make


Checking and installing anything to do with ncurses or Libncurses as follows

[root@localhost ~]# urpmi ncurses
Package ncurses-5.7-4.20091227.1mdv2010.1.x86_64 is already installed
[root@localhost ~]# urpmi libncurses
No package named libncurses
The following packages contain libncurses: libncurses-devel, libncurses5, libncursesw-devel, libncursesw5
You should use "-a" to use all of them
[root@localhost ~]# urpmi -a libncurses
To satisfy dependencies, the following packages are going to be installed:
   Package                        Version      Release       Arch   
(medium "Main32")
  libncurses-devel               5.7          4.20091227.1> i586   
  libncurses5                    5.7          4.20091227.1> i586   
  libncursesw-devel              5.7          4.20091227.1> i586   
  libncursesw5                   5.7          4.20091227.1> i586   
13MB of additional disk space will be used.
2.4MB of packages will be retrieved.
Proceed with the installation of the 4 packages? (Y/n) y


    $MIRRORLIST: media/../../i586/media/main/release/libncursesw5-5.7-4.20091227.1mdv2010.1.i586.rpm
    $MIRRORLIST: media/../../i586/media/main/release/libncursesw-devel-5.7-4.20091227.1mdv2010.1.i586.rpm
    $MIRRORLIST: media/../../i586/media/main/release/libncurses5-5.7-4.20091227.1mdv2010.1.i586.rpm
    $MIRRORLIST: media/../../i586/media/main/release/libncurses-devel-5.7-4.20091227.1mdv2010.1.i586.rpm
installing libncursesw5-5.7-4.20091227.1mdv2010.1.i586.rpm libncursesw-devel-5.7-4.20091227.1mdv2010.1.i586.rpm libncurses-devel-5.7-4.20091227.1mdv2010.1.i586.rpm libncurses5-5.7-4.20091227.1mdv2010.1.i586.rpm from /var/cache/urpmi/rpms
Preparing...                     #############################################
      1/4: libncurses5           #############################################
      2/4: libncursesw5          #############################################
      3/4: libncursesw-devel     #############################################
      4/4: libncurses-devel      #############################################
[root@localhost ~]# urpmi -a libncurses.so
No package named libncurses.so
[root@localhost ~]# urpmi -a ncurses.so
No package named ncurses.so
[root@localhost ~]# urpmi -a ncurses
Package ncurses-5.7-4.20091227.1mdv2010.1.x86_64 is already installed
[root@localhost ~]# urpmi -a libncurses
Packages libncursesw5-5.7-4.20091227.1mdv2010.1.i586, libncursesw-devel-5.7-4.20091227.1mdv2010.1.i586, libncurses5-5.7-4.20091227.1mdv2010.1.i586, libncurses-devel-5.7-4.20091227.1mdv2010.1.i586 are already installed
[root@localhost ~]#



No idea whats wrong now.


Any help appreciated

Thanks

Denis

Hi,
After installation of libncurses-devel, you should have the requiered files.
Try make now

The discussion might have continued from here.