Bug 76177 - C compiler cannot create executables
Summary: C compiler cannot create executables
Status: RESOLVED NOT A BUG
Alias: None
Product: kdevelop
Classification: Applications
Component: general (show other bugs)
Version: 3.0.0
Platform: Slackware Linux
: NOR normal
Target Milestone: ---
Assignee: KDevelop Developers
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-02-26 10:43 UTC by Giuseppe Torelli
Modified: 2004-02-26 15:37 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Giuseppe Torelli 2004-02-26 10:43:33 UTC
Version:           3.0.0 (using KDE KDE 3.2.0)
Installed from:    Slackware Packages
Compiler:          gcc version 3.2.3
OS:          Linux (i686) release 2.4.20

When you modify some options of the project through the menu Project/Project Options, Kdevelop asks you: Rerun configure now ? You click yes and in the messages window you get:

cd "/home/gt/mizio_pthread" && LDFLAGS="-lkio -lkdeui -lkdecore -lqt -dl" CPPFLAGS="-g" CXX=-g "/home/gt/mizio_pthread/configure" 
*checking build system type... i686-pc-linux-gnu 
*checking host system type... i686-pc-linux-gnu 
*checking target system type... i686-pc-linux-gnu 
*checking for a BSD-compatible install... /usr/bin/ginstall -c 
*checking for -p flag to install... yes 
*checking whether build environment is sane... yes 
*checking for gawk... gawk 
*checking whether make sets $(MAKE)... yes 
*checking for style of include used by make... GNU 
*checking for gcc... gcc 
*checking for C compiler default output...  
*configure: error: C compiler cannot create executables 
*See `config.log' for more details. 
**** Exited with status: 77 ***

That's all. This is a bug that occured also in 2.x releases.
Comment 1 Giuseppe Torelli 2004-02-26 10:44:23 UTC
Sorry, I forgot to mention that my gcc compiler works !
Comment 2 Jens Dagerbo 2004-02-26 10:51:10 UTC
"When you modify some options.."

It might help if you stated exactly what you changed.
Comment 3 Amilcar do Carmo Lucas 2004-02-26 11:08:14 UTC
This is a "user bug" :)

Please read the config.log file for more details :)
Comment 4 Giuseppe Torelli 2004-02-26 11:17:10 UTC
That is what I changed:

The project version in the General options and I removed -lpthread from the Linker flags (LDFLAGS) field in the Configure Options.
Comment 5 Jens Dagerbo 2004-02-26 12:12:40 UTC
Are you working from an existing template? If you do, what template is that?
Comment 6 Giuseppe Torelli 2004-02-26 14:27:37 UTC
Yes, I used the template C++/KDE/Simple KDE Application
Comment 7 Jens Dagerbo 2004-02-26 14:34:50 UTC
I have no -lpthread in that template.. Was it really there by default?
Comment 8 Giuseppe Torelli 2004-02-26 14:54:49 UTC
I added -lpthread because my app needed it ! Then I switched to QThread and I removed -lpthread from the project configure options !
Comment 9 Jens Dagerbo 2004-02-26 15:30:38 UTC
OK, I think I see what is happening.. (check the config.log file, like Amilcar suggests)

if you add linker flags to that box in configure options, those flags will be applied to the test builds made during the configure tests. For this to work, but linker will need to be told what those flags mean. Most likely it's not finding one of the flags you pass it.

For instance, if I add "-lkio" to the LDFLAGS box of a "simple kde program" it fails with the following in config.log:

configure:2576: gcc    -lkio conftest.c  >&5
/usr/lib/gcc-lib/i686-pc-linux-gnu/3.2.2/../../../../i686-pc-linux-gnu/bin/ld: cannot find -lkio
collect2: ld returned 1 exit status

If I on the other hand add "-lkio -L/opt/kde/lib" then the configure test works as expected.

A better way to add flags and linker paths is in the automake manager. Unless I'm mistaken, those flags are only applied to the related and not the configure test. (which is better, unless of course you have a configure test that actually need extra flags.)


I agree with Amilcar, user error. Closing.
Comment 10 Jens Dagerbo 2004-02-26 15:37:21 UTC
 "...those flags are only applied to the related TARGET and not..." 

is what I meant to say.