This Bugzilla instance is a read-only archive of historic NetBeans bug reports. To report a bug in NetBeans please follow the project's instructions for reporting issues.

Bug 227868 - syntax error near unexpected token `(x' by compiling c/cpp-project mingw
Summary: syntax error near unexpected token `(x' by compiling c/cpp-project mingw
Status: RESOLVED DUPLICATE of bug 228730
Alias: None
Product: cnd
Classification: Unclassified
Component: Toolchain (show other bugs)
Version: 7.3
Hardware: PC Windows 7 x64
: P3 normal (vote)
Assignee: Alexander Simon
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-03-24 18:15 UTC by MrMacSpooky
Modified: 2013-05-20 12:22 UTC (History)
0 users

See Also:
Issue Type: DEFECT
Exception Reporter:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description MrMacSpooky 2013-03-24 18:15:54 UTC
I've selected a 'new Project', 'c/c++', 'c/c++ application'.

As a result, the IDE created the project with a main.cpp

Because this was the first project, IDE asked me to configure its C/CPP setup.

I did so - using CodeBlock's MinGW-System; furthermore I read, i need to use MSYS.

For completeness I've downloaded cmake, too - qmake is yet missing; but i won't code for QT.

After Setup is done I click 'Versions...'

All programms will be listed with its Version-Number (expect QMake - it's not installed).

None of the Path's are displayed 'red'.

But all of the files reside in 'c:\program files (x86)\codeblocks\mingw\bin\', 'c:\program files (x86)\msys\1.0\bin\' and 'c:\program files\cmake-2.8.10.2-win32-x86\bin\'

To this point all seems to be well - but:

Without changing the Sample-Main.cpp, which was generated automatically, I tried to compile and got follwoing Error in the Output-Window:

###
"/c/Users/user1/Documents/NetBeansProjects/CppApplication_1/"C:/Program Files (x86)/msys/1.0/bin/make.exe"" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .clean-conf
/bin/sh.exe: -c: line 1: syntax error near unexpected token `(x'
/bin/sh.exe: -c: line 1: `"/c/Users/user1/Documents/NetBeansProjects/CppApplication_1/"C:/Program Files (x86)/msys/1.0/bin/make.exe"" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .clean-conf'
make.exe": *** [.clean-impl] Error 2


CLEAN FAILED (exit value 2, total time: 219ms)
###

Surely I googled to this - and the only answer I found, was to install mingw in a path without spaces.

Surely it's a bad answer - windows provides the paths 'prgram files' or 'program files (x86)' for storing application. It doesn't make sense ignoring this guideline and begin trashing the root-folder.

A common cause, faulting with path-name-spaces is either not to escape spaces or not to use quotation-marks ("a path with spaces\bin\")

Is the User able to control this behavior (without moving the bins) and if so, how?
Comment 1 soldatov 2013-03-24 19:21:32 UTC
(In reply to comment #0)
> Surely it's a bad answer - windows provides the paths 'prgram files' or
> 'program files (x86)' for storing application. It doesn't make sense ignoring
> this guideline and begin trashing the root-folder.
Can you post any link from MinGW.org where tutorial speaks "user can install mingw tool in Program Files"?

My link from http://www.mingw.org/wiki/Getting_Started
MinGW may have problems with paths containing spaces, and if not, usually other programs used with MinGW will experience problems with such paths. Thus, we strongly recommend that you do not install MinGW in any location with spaces in the path name reference; i.e. you should avoid installing into any subdirectory of "Program Files" or "My Documents", or the like.
Comment 2 MrMacSpooky 2013-03-24 20:08:51 UTC
(In reply to comment #1)
> Can you post any link from MinGW.org where tutorial speaks "user can install
> mingw tool in Program Files"?
> 
> My link from http://www.mingw.org/wiki/Getting_Started
> MinGW may have problems with paths containing spaces, and if not, usually other
> programs used with MinGW will experience problems with such paths. Thus, we
> strongly recommend that you do not install MinGW in any location with spaces in
> the path name reference; i.e. you should avoid installing into any subdirectory
> of "Program Files" or "My Documents", or the like.

As I described, I got MinGW by installing CodeBlocks.
According to this issue, I downloaded the current Version 12.11 and its default's path is "c:\program files (x86)\codeblocks\" - The CodeBlocks-Path contains MinGW.

Coding with CodeBlocks shows, that both - CodeBlocks and its MinGW - doesn't matter if bins are stored in paths with spaces.

The Text you clipped only says, MinGW *may* have Problems, and if not, other *may* have Problems. CodeBlocks installer uses Path with spaces *and* has *no Problem*.

Would it be wrong to guess Netbeans IDE handles Paths different than CodeBlocks by interacting with MinGW?
Comment 3 soldatov 2013-03-24 21:07:07 UTC
(In reply to comment #2)
> Would it be wrong to guess Netbeans IDE handles Paths different than CodeBlocks
> by interacting with MinGW?
I think NetBeans uses more utilities from MinGW/MSYS then CodeBlocks
Comment 4 Leonid Lenyashin 2013-04-22 10:29:03 UTC
Please provide more detailed test case that we can reproduce.
Comment 5 MrMacSpooky 2013-04-22 11:56:29 UTC
(In reply to comment #4)

My Box is a Windows 7 Ultimate 64Bit.
I downloaded CodeBlocks from http://www.codeblocks.org/downloads/binaries#windows => http://sourceforge.net/projects/codeblocks/files/Binaries/12.11/Windows/codeblocks-12.11mingw-setup.exe/download 
This is CodeBlocks with including MinGW.
During Setup the Installation-Folder
C:\Program Files (x86)\CodeBlocks
is recommended. You see - with Spaces.

MinGW is installed in this CodeBlocks-Folder.

By Setting-Up NetBeans for C/Cpp with CodeBlock's MinGW, I've choosen this MinGW-Folder - and Netbeans was able to use all Tools (tested by the Versions...-Button)

Now creating a Standard CPP-Application (with just a main-function) results to this error while compilling.

Meanwhile I've installed Cygwin - to "C:\Program Files\cygwin" (with Spaces), and Netbeans works with its (Cygwins') GNU-C/CPP. The WebSite of Cygwin warns not to use Spaces in Path, too.

Summary:
a) cygwin & netbeans works with spaces
b) codeblock & its MinGW works with spaces
c) codeblock's MinGW & netbeans won't work with spaces.
Comment 6 Leonid Lenyashin 2013-04-22 12:22:41 UTC
Ok, clear. Sounds like a valid bug, not a P2 though.
Comment 7 Andrew Krasny 2013-05-20 12:22:47 UTC

*** This bug has been marked as a duplicate of bug 228730 ***