flat assembler
Message board for the users of flat assembler.
Index
> High Level Languages > [GCC] Compiler can't create executables Goto page 1, 2 Next |
Author |
|
sid123 18 May 2014, 03:54
I'm curious to know whether it means the "linker cannot create executables". Which means that you've some other linker in your system and your PATH variable is set such that it finds the cross-linker (or something like that) before it searches for the linker that is used by your system. Can you confirm that?
|
|||
18 May 2014, 03:54 |
|
Fixit 18 May 2014, 03:58
I do not understand what you are asking.
Take care, Andy |
|||
18 May 2014, 03:58 |
|
Tyler 18 May 2014, 05:36
Post the config.log. I've only ever seen this with cross compilers, so I don't know what could cause it with a normal compiler.
|
|||
18 May 2014, 05:36 |
|
Fixit 19 May 2014, 01:31
It is attached.
Andy
|
|||||||||||
19 May 2014, 01:31 |
|
m3ntal 19 May 2014, 07:10
Lately, I've been using Raspberry PI with GCC and the Geany editor. Very easy to compile a C program:
* On Desktop, right click Create New.. Blank File.. hello.c * In terminal, enter: Code: cd Desktop gcc hello.c -o hello ./hello |
|||
19 May 2014, 07:10 |
|
sid123 19 May 2014, 14:02
Fixit wrote: I do not understand what you are asking. Hi, Can you please tell us what you have set as "PATH" in your ~/.bashrc file? You can view it like (assuming you've GNU NANO, or pick your favourite text editor) "nano ~/.bashrc" You should see something like this: Quote:
Please tell us what've you got in your PATH environment variable. And yeah like m3ntal said Create a file called envtest.c (or whatever.c) and paste the lines: Code: #include <stdio.h> int main(int argc, const char **argv[]) { printf ("Sample Test....\n"); return 0; } Open the terminal, cd to the directory of this file and type: "cc envtest.c -o envtest.out" "./envtest.out" This will test if your compiler and build environment with the standard system libraries are configured properly. @m3ntal: That's true when your build environment is sane, you've the native system linker but in Fixit's case it looks like the system toolchain isn't configured properly. EDIT: After looking at your log it looks like you haven't installed "GNU Multi precision Library a.k.a. libmpc.so". Quote:
If your distro provides it install it by: "sudo apt-get install libmpc-dev" (Debian & Ubuntu) or using your package manager a.k.a pacman if you're using ArchLinux. m3ntal wrote:
Man, that editor! Much better than vi or Emacs and even gedit! _________________ "Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X XD |
|||
19 May 2014, 14:02 |
|
Fixit 19 May 2014, 19:39
I think there was something wrong with the .configure file.
# fasm hello.asm flat assembler version 1.71.17 (16384 kilobytes memory) 3 passes, 224 bytes. |
|||
19 May 2014, 19:39 |
|
Fixit 19 May 2014, 19:42
.bashrc file
. /etc/profile #v1.0.5 need to override TERM setting in /etc/profile... #export TERM=xterm # ...v2.13 removed. #export HISTFILESIZE=2000 #export HISTCONTROL=ignoredups #...v2.13 removed. PATH=/usr/lib/qt/bin:/bin:/usr/bin:/sbin:/usr/sbin:/usr/local/bin:/usr/X11R7/bin:/root/my-applications/bin:/usr/games:/usr/lib/kde4/libexec:/usr/lib/java/bin:/usr/lib/java/jre/bin:/usr/lib/java/jre/bin:/usr/lib/qt/bin Andy |
|||
19 May 2014, 19:42 |
|
gens 19 May 2014, 21:23
/usr/libexec/gcc/i486-slackware-linux/4.7.1/cc1: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory
check if you have libmpc installed it should also be in the linker line you can do a quick check with gcc -lmpc where it complaining only about main means it found the lib /usr/lib64/gcc/x86_64-slackware-linux/4.8.2/../../../../lib64/crt1.o: In function `_start': /root/glibc-tmp-9002ff5f792dcd78458cea033de7a2d0/glibc-2.19/csu/../sysdeps/x86_64/start.S:118: undefined reference to `main' collect2: error: ld returned 1 exit status PS would you mind using pastebin next time, easier to read |
|||
19 May 2014, 21:23 |
|
Fixit 19 May 2014, 23:44
# gcc -lmpc
collect2: fatal error: cannot find 'ld' compilation terminated. Are you talking about the tar file ? Andy |
|||
19 May 2014, 23:44 |
|
gens 20 May 2014, 00:34
ld is part of binutils
whereis ld to see if its accessible and where weird how in configure's test it didn't complain about it yes, i'm too lazy to untar things |
|||
20 May 2014, 00:34 |
|
Fixit 20 May 2014, 04:45
No problem
Andy |
|||
20 May 2014, 04:45 |
|
sid123 20 May 2014, 08:42
Fixit wrote: No problem Hi, That is quite a problem. It seems that you don't have a system linker, the linker does basically what it's name says, it links object files and libraries so that it produces an executable, which you can run on your system. Quote:
Don't confuse FASM and the GNU Toolchain! They're two different things, FASM is an assembler GCC is a compiler. In fact GCC uses it's own assembler called GNU Assembler. GCC and FASM are not related. Can you try the test C program in my previous post? _________________ "Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X XD |
|||
20 May 2014, 08:42 |
|
TmX 20 May 2014, 14:41
sid123 wrote:
MPC is one of the prerequisite to build GCC. How come it couldn't be loaded? Weird |
|||
20 May 2014, 14:41 |
|
sid123 20 May 2014, 15:27
TmX wrote:
Wow you live quite near. I guess in Fixit's case the system toolchain (gcc, binutils) were precompiled. So he didn't had to install the perquisites of compiling gcc. Not to mention compiling and upgrading the toolchain is a very painful process. _________________ "Those who can make you believe in absurdities can make you commit atrocities" -- Voltaire https://github.com/Benderx2/R3X XD |
|||
20 May 2014, 15:27 |
|
TmX 20 May 2014, 16:34
sid123 wrote: Not to mention compiling and upgrading the toolchain is a very painful process. Indeed building GCC is a pain in the a**. That's why I never interested in building it from source, and instead leave this to the trusty package manager. That means I get GCC and its dependencies (GMP, MPC, MPFR, etc) installed. I don't know how Fixit installed the toolchain that GCC doesn't work properly. Blame the packager, maybe? Why don't he put GCC and it's dependecies together into a single, installable package? BTW, I did a quick Google search about this Puppy Linux. "It has high Slackware binary software packages compatibility". Many years ago, when I didn't have a good internet connection at home, I had a PC that was running Slackware. How could I install applications, then? I download the binary (.txz) packages at campus, and put them in USB flashdrive. Then you can install them with "installpkg" command, if memory serves me right. There are several Slackware binary repos out there. One of them is http://repository.slacky.eu/ Maybe this way can also be applicable. I'm not sure, though, because I've never tried Slacko before. |
|||
20 May 2014, 16:34 |
|
gens 20 May 2014, 17:48
yes, slacko is binary compatible with slackware
so much that it's package manager includes slackware repositories idk if puppy holds things needed for compiling somewhere in some repo i know slackware has everything needed in d/ gcc set, binutils, make, automake, kernel headers etc. has even nasm and yasm, what reminds me that i should try getting fasm there |
|||
20 May 2014, 17:48 |
|
Fixit 21 May 2014, 00:11
# cc test.c -o test.out
/usr/libexec/gcc/i486-slackware-linux/4.7.1/cc1: error while loading shared libraries: libmpc.so.2: cannot open shared object file: No such file or directory I will try to download that library. Andy |
|||
21 May 2014, 00:11 |
|
Tyler 21 May 2014, 05:57
Is there a reason you're using Slackware? It seems to be a real PITA. Even Gentoo wouldn't leave your system in such a broken state (and that is really saying something). If you want to be 1337 and still get *some* stuff done, try Arch. Personally, I've tried the whole super barebones linux distros thing and found that it really just ends up wasting a lot of time that would be better spent doing things I actually want to do instead of spending most of my time just trying to get packages installed that I want to work with. (Eg on Gentoo I spent 2 days installing scipy/matplotlib/OpenOpt and a few others. It was awful and totally unnecessary. And that's not even mentioning graphics cards and kernel config-ing.) Just go with something simple like Mint or XFCE Ubuntu and then you can focus your efforts on programming stuff you want to be working on.
And it is MPC that is missing. But if you don't have ld, then getting MPC installed isn't going to fix the problem entirely. Sorry for the delay, I don't come here often anymore. |
|||
21 May 2014, 05:57 |
|
Goto page 1, 2 Next < Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2025, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.