News:

The new Release 25.03 is out! You can download binaries for Windows and many major Linux distros here .

Main Menu

missing link.exe

Started by gweather, December 30, 2017, 01:46:58 PM

Previous topic - Next topic

gweather

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?

stahta01

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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

gweather

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.

stahta01

What commands are used in the toolchain settings?

Please post the build log!

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

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

gweather

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.

stahta01

C Programmer working to learn more about C++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

gweather

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

stahta01

Quote from: gweather 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

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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

gweather

What do I replace link.exe with.  I can find nothing about what it should be.

stahta01

Quote from: stahta01 on December 30, 2017, 02:19:16 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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

gweather

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?

stahta01

Quote from: gweather 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?

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++.
On Windows 10 64 bit and Windows 11 64 bit.
--
When in doubt, read the CB WiKi FAQ. [url="http://wiki.codeblocks.org"]http://wiki.codeblocks.org[/url]

gweather

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?

stahta01

Quote from: gweather on December 30, 2017, 03:27:24 PM
I was writing the code in c not c++.
Quote from: gweather on December 30, 2017, 03:27:24 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

Quote from: gweather on December 30, 2017, 03:27:24 PM
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!

Quote from: gweather on December 30, 2017, 03:27:24 PM
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.
Quote from: gweather on December 30, 2017, 03:27:24 PM
Is there an explanation about the problem that I missed?
See the above answer.

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