LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Slackware (https://www.linuxquestions.org/questions/slackware-14/)
-   -   C compiler cannot create executables (https://www.linuxquestions.org/questions/slackware-14/c-compiler-cannot-create-executables-801900/)

mlangdn 04-14-2010 01:04 AM

C compiler cannot create executables
 
I was trying to compile xbmc today, and got the error about the c compiler not being able to create executables. I did a search on the forum, and found something from 2004. None of the suggestions there worked for me. I can compile libraries, because I did a few for dependencies.

The last thing I compiled with an executable was BloodFrontier, and it works perfectly. I have no idea where to go next.

pixellany 04-14-2010 01:07 AM

I'm not a programmer, but I think you will need to tell us exactly what the error message was.

dugan 04-14-2010 01:09 AM

I'll start with the standard answer: double-check that ARCH is set to x86_64.
http://slackbuilds.org/faq/#x86_64

Using Slackware64 and forgetting to set the ARCH environment variable is the usual cause of this error.

mlangdn 04-14-2010 05:07 AM

Here is the relevant part from configure.log:

Code:

configure:3611: checking whether the C++ compiler works
configure:3633: g++ -O2 -march=i486 -mtune=i686  -I/usr/lib/dbus-1.0/include  -I/usr/lib/glib-2.0/include  conftest.cpp  >&5
conftest.cpp:1: error: CPU you selected does not support x86-64 instruction set
configure:3637: $? = 1
configure:3675: result: no
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME ""xbmc""
| #define PACKAGE_TARNAME "-xbmc-"
| #define PACKAGE_VERSION "9.11"
| #define PACKAGE_STRING ""xbmc" 9.11"
| #define PACKAGE_BUGREPORT "http://xbmc.org/trac/"
| #define PACKAGE_URL ""
| /* end confdefs.h.  */
|
| int
| main ()
| {
|
|  ;
|  return 0;
| }
configure:3680: error: in `/tmp/SBo/xbmc-9.11':
configure:3684: error: C++ compiler cannot create executables
See `config.log' for more details.


mlangdn 04-14-2010 05:20 AM

I think I have my answer after reading the log entry a bit closer. I went back to the slackbuild script and set the arch. :redface:

rfernandez 04-14-2010 06:17 AM

Sometimes, I think that Slackbuilds.org should make the ARCH pattern as

Code:

ARCH=${ARCH:-`uname -m`}
Just to avoid some headaches. Or I'm I too lazy? :p

sahko 04-14-2010 07:16 AM

Quote:

Originally Posted by rfernandez (Post 3935187)
Sometimes, I think that Slackbuilds.org should make the ARCH pattern as

Code:

ARCH=${ARCH:-`uname -m`}
Just to avoid some headaches. Or I'm I too lazy? :p

The scripts in Slackware already started using this and AFAIK thats the future plan for SlackBuilds.org also.

mlangdn 04-14-2010 09:19 AM

One still has to check to make sure the script is updated.
Besides, while it seemed to have compiled, there was still no executable. I got more looking to do.

mlangdn 04-16-2010 12:56 AM

I finally was able to compile xbmc for Slackware64-current. However, I compiled it on an older -current partition that had not been updated since January. I do not update that one as often in case there are problems. The problem I believe was with libpng-1.4x. That package either has problems, or something else has not caught up just yet. The older -current has libpng-1.27x.

XBMC compile and ran just fine there, so I simply installed the package on my fully updated -current partition. It runs just fine here as well. I wish I was able to give better information on the whys, but I am no programmer or code writer. I'm not even a good beta tester, but I seem to insist on running -current for some silly reason. Maybe for Alien's KDE pkgs. :)

Oh, and the XBMC version is 9.11.

rfernandez 04-16-2010 06:50 AM

Quote:

Originally Posted by mlangdn (Post 3937207)
The problem I believe was with libpng-1.4x. That package either has problems, or something else has not caught up just yet. The older -current has libpng-1.27x.

There has been some changes from libpng12 to libpng14, and some functions became deprecated. You should check the libpng changelog on their site to know what those changes are. I had a problem when compiling a program because of libpng14, and that changelog was my answer.

mlangdn 04-16-2010 08:11 AM

I failed to mention last night that I found a patch to fix a problem xbmc had with libpng-1.4x. Evidently, the patch didn't help. So, in the interest of research and learning, I went to peruse the libpng changelog. No help there either. I'm not saying an answer isn't there, I'm just saying I didn't recognize one.

rfernandez 04-16-2010 08:29 AM

I remember that when I tried to compile the program, my answer on the changelog was this:

Code:

replace
        png_check_sig(buf, 8)
with
        png_sig_cmp(buf, 0, 8) == 0

So, what I did was "sed" the configure script and everything was ok - the program compiled just as it should. Maybe, if you put the output of the configure or the build log here, we could see where the problem is, and also what patch you tried to apply.

mlangdn 04-16-2010 02:10 PM

1 Attachment(s)
Each time I tried to build, I deleted everything previous. There is no log from the errors. However, I do have the libpng patch I inserted into the Slackbuild. I will attach that.

rfernandez 04-16-2010 03:20 PM

Yes, I saw the patch and, indeed, there is some fix there. From the libpng changelog:

Code:

5. Other changes

  a. We changed the names of the png_struct and info_struct members "trans"
      and "trans_values" to "trans_alpha" and "trans_color", respectively.

Which is the patch action. But I think that the output of ./configure would be more clarifying.

mlangdn 04-16-2010 09:23 PM

1 Attachment(s)
Well, I was wrong - I do have a config log from a failed attempt. I should also add that I had no errors from configure, and it even seemed to compile in this one. There was just no executable after make.

Make install complained about xbmc.bin - no such file or directory.

I split this into two parts - it was too big for the forum limit. Read it if you like. :)

Part 1:


All times are GMT -5. The time now is 09:17 PM.