Author Topic: missing link.exe  (Read 1592 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: 6252
    • 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 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
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: 6252
    • 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 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org

Offline stahta01

  • Lives here!
  • ****
  • Posts: 6252
    • My Best Post
C Programmer working to learn more about C++ and Git.
On Windows 7 64 bit and Windows 10 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
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: 6252
    • 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 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
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: 6252
    • 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 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
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: 6252
    • 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 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
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: 6252
    • 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 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
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: 6252
    • 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 32 bit.
On Debian Testing, compiling CB Trunk against wxWidgets 3.0.2.
--
When in doubt, read the CB WiKi FAQ. http://wiki.codeblocks.org