Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 357048 - 'Libraries' option UI does not handle paths with spaces correctly
Summary: 'Libraries' option UI does not handle paths with spaces correctly
Status: NEW
Alias: None
Product: CDT
Classification: Tools
Component: cdt-build-managed (show other bugs)
Version: 8.0   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact: Jonah Graham CLA
URL:
Whiteboard:
Keywords:
Depends on: 186069
Blocks:
  Show dependency tree
 
Reported: 2011-09-08 05:18 EDT by Mario Pierro CLA
Modified: 2020-09-04 15:17 EDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mario Pierro CLA 2011-09-08 05:18:07 EDT
Build Identifier: Eclipse 20110615-0604, CDT 8.0.0.201106081058

I have noticed that adding a library to a project using the Paths and Symbols > Libraries tab > Add button will fail if the path contains spaces.

The problem seems to be that quotes are added to the library filename, which are subsequently doubled when the -l option is built and thus stripped from the actual command line.


Reproducible: Always

Steps to Reproduce:
1. Create a new C project using the MinGW GCC toolchain and the Hello World C template.

2. Add a library to the project using Project > Properties > C/C++ Build > C/C++ General > Paths and Symbols > Libraries > Add > File System, and browse to a library file containing a space in its path

3. Verify that the corresponding option Project > Properties > C/C++ Build > C/C++ General > MinGW C Linker > Libraries > Libraries now contains the library file with quotes around it

4. Build the project, and verify that build fails since the -l option is sent to gcc without quotes around the path

>> WORKAROUND

5. Edit the option in Project > Properties > C/C++ Build > C/C++ General > MinGW C Linker > Libraries > Libraries and _remove_ the quotes around the path

6. Verify that the project now builds correctly, since the library path is sent in the -l option
Comment 1 Mario Pierro CLA 2011-09-08 05:21:45 EDT
Note that this problem happens in all toolchains using an option with valueType="libs" . 

I think this has been around since CDT 6.
Comment 2 Andrew Gvozdev CLA 2011-09-08 09:17:28 EDT
Most likely the same root cause as for bug 186069.