Ld.exe linking error in Windows.

  • Thread starter Thread starter zevik
  • Start date Start date
  • Tags Tags
    Error Windows
Click For Summary
SUMMARY

The forum discussion addresses a linking error encountered while using g77 on Windows Vista, specifically related to the space character in the path "C:\Program Files". The error message "ld: cannot open C:\Program: No such file or directory" indicates that the linker fails to process paths with spaces correctly. A suggested solution is to enclose folder names containing spaces in quotes, such as using C:\"Program Files"\... Alternatively, users are advised to avoid using "C:\Program Files" for development by creating a separate directory like "C:\Development" or installing Cygwin for a more compatible environment.

PREREQUISITES
  • Familiarity with g77 compiler usage
  • Understanding of makefiles and build processes
  • Basic knowledge of Windows file path conventions
  • Experience with Cygwin or similar Unix-like environments on Windows
NEXT STEPS
  • Research how to configure makefiles for Windows environments
  • Learn about handling file paths with spaces in Windows command line
  • Explore the installation and configuration of Cygwin for development
  • Investigate alternative compilers compatible with Windows, such as MinGW
USEFUL FOR

This discussion is beneficial for developers using g77 on Windows, particularly those encountering linking errors due to file path issues. It is also useful for anyone looking to optimize their development environment on Windows Vista.

zevik
Messages
5
Reaction score
0
I think this problem has to do with the space character inside "C:\Program Files\...":

I'm trying to use g77 on Vista.
The makefile I'm using is supplied by the developer (it's for MadGraph), but when I "make", this is what I get:
a bunch of successful "g77 -O -i4 -c <somename>.f" lines, till it comes to:
"g77 -O -i4 -o mg2 <bunch of object files>", where the make process stops with messages:

ld: cannot open C:\Program: No such file or directory
make: *** [mg2] Error 1

Is it because somehow Windows gets confused about the space character in "Program Files"?
Any idea?
 
Technology news on Phys.org
zevik said:
I think this problem has to do with the space character inside "C:\Program Files\...":

I'm not sure of the specifics of the problem, but I've had a similar problem in Linux.

To solve it I had to use quotes around any folder names which contained spaces and not the whole path:
Code:
C:\"Program Files"\...

I'm not sure whether or not this would solve your problem but it's worth a try. It's not for all problems, but it does show up every now and then.

Example:

Doesn't work
Code:
"/home/jared/temp directory/..."

Works
Code:
/home/jared/"temp directory"/...
 
A lazy and effective way to solve this would be to not put this stuff in C:\Program Files. Make a C:\Development. Or install Cygwin
 
We have many threads on AI, which are mostly AI/LLM, e.g,. ChatGPT, Claude, etc. It is important to draw a distinction between AI/LLM and AI/ML/DL, where ML - Machine Learning and DL = Deep Learning. AI is a broad technology; the AI/ML/DL is being developed to handle large data sets, and even seemingly disparate datasets to rapidly evaluated the data and determine the quantitative relationships in order to understand what those relationships (about the variaboles) mean. At the Harvard &...

Similar threads

  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 14 ·
Replies
14
Views
3K
Replies
2
Views
3K
  • · Replies 3 ·
Replies
3
Views
4K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
4K
  • · Replies 11 ·
Replies
11
Views
3K
  • · Replies 2 ·
Replies
2
Views
6K
  • · Replies 12 ·
Replies
12
Views
2K
Replies
1
Views
2K