Author Topic: missing link.exe  (Read 8748 times)

Offline gweather

  • Single posting newcomer
  • *
  • Posts: 9
missing link.exe
« on: December 30, 2017, 01:46:58 pm »
Windows 10 PRO 64BIT
CODE BLOCKS 16.01 (just downloaded from sourceforge.net codeblocks-16.01-mingw-setup.exe

created a c project and tried building the default code.

BUILD LOG:

-------------- Build: Debug in HelloWorld (compiler: GNU GCC Compiler)---------------

gcc.exe -Wall -g  -c C:\Work\HelloWorld\main.c -o obj\Debug\main.o
link.exe  -o bin\Debug\HelloWorld.exe obj\Debug\main.o   
Execution of 'link.exe  -o bin\Debug\HelloWorld.exe obj\Debug\main.o' in 'C:\Work\HelloWorld' failed.

TOOLCHAIN POINTS TO C:\Program Files (x86)\CodeBlocks\MinGW\bin

No link.exe file there and after a search of c: no link.exe found at all

Is this file missing or is another file used in its place?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: missing link.exe
« Reply #1 on: December 30, 2017, 02:19:16 pm »
I know of no time that GCC used an link.exe.

For DLL/Shared/normal linking gcc.exe or g++.exe is normally used in CB.
For Static library, I think ar.exe is use; but, I am not sure of that.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline gweather

  • Single posting newcomer
  • *
  • Posts: 9
Re: missing link.exe
« Reply #2 on: December 30, 2017, 02:41:07 pm »
I printed out the build log.  That is the only thing I have to go on and it says link.exe failed.  I am not sure what else to look for.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: missing link.exe
« Reply #3 on: December 30, 2017, 02:43:47 pm »
What commands are used in the toolchain settings?

Please post the build log!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline gweather

  • Single posting newcomer
  • *
  • Posts: 9
Re: missing link.exe
« Reply #5 on: December 30, 2017, 02:56:54 pm »
The full build log is in the original message.  Here it is again:


-------------- Build: Debug in HelloWorld (compiler: GNU GCC Compiler)---------------

gcc.exe -Wall -g  -c C:\Work\HelloWorld\main.c -o obj\Debug\main.o
link.exe  -o bin\Debug\HelloWorld.exe obj\Debug\main.o   
Execution of 'link.exe  -o bin\Debug\HelloWorld.exe obj\Debug\main.o' in 'C:\Work\HelloWorld' failed.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: missing link.exe
« Reply #6 on: December 30, 2017, 02:58:21 pm »
What commands are used in the toolchain settings?
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline gweather

  • Single posting newcomer
  • *
  • Posts: 9
Re: missing link.exe
« Reply #7 on: December 30, 2017, 03:06:23 pm »
C compiler: gcc.exe
C++ compiler: g++.exe
Linker for dynamic libs: link.exe
linker for static libs: ar.exe
Debugger: GDB/CDB debugger:Default
Resource compiler: windres.exe
Make program: make.exe

The compiler's installation directory: C:\Program Files (x86)\CodeBlocks\MinGW

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: missing link.exe
« Reply #8 on: December 30, 2017, 03:11:02 pm »
C compiler: gcc.exe
C++ compiler: g++.exe
Linker for dynamic libs: link.exe
linker for static libs: ar.exe
Debugger: GDB/CDB debugger:Default
Resource compiler: windres.exe
Make program: make.exe

The compiler's installation directory: C:\Program Files (x86)\CodeBlocks\MinGW

Fix this "Linker for dynamic libs: link.exe" as I stated in my first post!

Edit: If you plan to use C++, change "link.exe" to "g++.exe"

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline gweather

  • Single posting newcomer
  • *
  • Posts: 9
Re: missing link.exe
« Reply #9 on: December 30, 2017, 03:12:10 pm »
What do I replace link.exe with.  I can find nothing about what it should be.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: missing link.exe
« Reply #10 on: December 30, 2017, 03:18:42 pm »
For DLL/Shared/normal linking gcc.exe or g++.exe is normally used in CB.

The normal value is g++.exe
If you plan to never use C++, some people use gcc.exe.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline gweather

  • Single posting newcomer
  • *
  • Posts: 9
Re: missing link.exe
« Reply #11 on: December 30, 2017, 03:27:24 pm »
I was writing the code in c not c++.  I used the default settings and got the error.  The ar.exe links static libraries according to the toolchain menu.  Is there an issue with the defaults for CB?  Is there an explanation about the problem that I missed?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: missing link.exe
« Reply #12 on: December 30, 2017, 03:29:58 pm »
I was writing the code in c not c++.  I used the default settings and got the error.  The ar.exe links static libraries according to the toolchain menu.  Is there an issue with the defaults for CB?  Is there an explanation about the problem that I missed?

FIX THE LINKER IN THE TOOLCHAIN SETTING!!!!!!!!!!

You changed the value; the default was never link.exe till you changed it!!!

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline gweather

  • Single posting newcomer
  • *
  • Posts: 9
Re: missing link.exe
« Reply #13 on: December 30, 2017, 03:38:46 pm »
These are the default values.  I did not change anything after the install.  I ran  codeblocks-16.01mingw-setup.exe that I downloaded from sourceforge.net from the Code Blocks web download link and then created a console app and used the defaults.  Again, I did not change anything and clicked the build icon and it gave the posted error.

What is suppose to be there?

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: missing link.exe
« Reply #14 on: December 30, 2017, 03:41:18 pm »
I was writing the code in c not c++.


I used the default settings and got the error.
No you used what someone set the values to on your computer; not the default settings


The ar.exe links static libraries according to the toolchain menu.

Correct.
But, the Shared/DLL linker is used for linking everything that is not an static library!


Is there an issue with the defaults for CB?
No, the issue is user error and the fact that CB setting can only be manually deleted; so, they stay during an uninstall/install cycle.
 
Is there an explanation about the problem that I missed?
See the above answer.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: missing link.exe
« Reply #15 on: December 30, 2017, 03:42:21 pm »
These are the default values.  I did not change anything after the install.  I ran  codeblocks-16.01mingw-setup.exe that I downloaded from sourceforge.net from the Code Blocks web download link and then created a console app and used the defaults.  Again, I did not change anything and clicked the build icon and it gave the posted error.

What is suppose to be there?

I stated the normal value twice, I give up on you.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline gweather

  • Single posting newcomer
  • *
  • Posts: 9
Re: missing link.exe
« Reply #16 on: December 30, 2017, 03:47:10 pm »
I am the only person using this computer.  I did not change anything after the install.  The values in the tool chain are what were put there by the installation.  If the linker command is wrong, then there is an issue with the installer.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: missing link.exe
« Reply #17 on: December 30, 2017, 03:49:32 pm »
I am the only person using this computer.  I did not change anything after the install.  The values in the tool chain are what were put there by the installation.  If the linker command is wrong, then there is an issue with the installer.

The issue is with the user being unable to read and understand what I posted!

Goodbye.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline gweather

  • Single posting newcomer
  • *
  • Posts: 9
Re: missing link.exe
« Reply #18 on: December 30, 2017, 03:57:42 pm »
ok.  I apologize.  I finally replaced the link.exe with gcc.exe and it now compiles and runs.  I'm afraid I did not understand what you had said.  But, the default is wrong in the installation.  I have uninstalled and installed several times and it is always the same.

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: missing link.exe
« Reply #19 on: December 30, 2017, 03:58:34 pm »
List of solutions to your user created problem.

1. Manually fix the linker command. (What I would do.)
2. Reset the Compiler to default settings using the Toolchain settings button that does this.
3A. Delete the CB Configuration file (Do *not* have Code::Blocks running while doing this)
3B. Starting CB will then create the configuration files with the default values
4. Reformat your hard drive and reinstall all software (This option is likely only used by complete idiots)

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: missing link.exe
« Reply #20 on: December 30, 2017, 03:59:58 pm »
ok.  I apologize.  I finally replaced the link.exe with gcc.exe and it now compiles and runs.  I'm afraid I did not understand what you had said.  But, the default is wrong in the installation.  I have uninstalled and installed several times and it is always the same.

I thought I had reading comprehension issues; yours are much worse than me.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 7582
    • My Best Post
Re: missing link.exe
« Reply #21 on: December 30, 2017, 04:02:03 pm »

I used the default settings and got the error.
No you used what someone set the values to on your computer; not the default settings


Is there an issue with the defaults for CB?
No, the issue is user error and the fact that CB setting can only be manually deleted; so, they stay during an uninstall/install cycle.
 
Is there an explanation about the problem that I missed?
See the above answer.

Tim S.
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 64 bit.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org