I'm trying to execute the following code in netbeans & eclipse but without success.
http://read.pudn.com/downloads150/sourcecode/comm/651136/NmeaConverter.cpp__.htm
Program has command-line parameter: -f D:\nmea.txt

Eclipse says:

Description	Resource	Path	Location	Type
`endl<<expression error> >' cannot appear in a constant-expression	nmea.cpp	/nmea/src	line 358	C/C++ Problem
`std::endl(std::basic_ostream<_CharT, _Traits>&)' cannot appear in a constant-expression	nmea.cpp	/nmea/src	line 358	C/C++ Problem
expected `;' before '}' token	nmea.cpp	/nmea/src	line 428	C/C++ Problem
no match for 'operator<' in 'std::cerr < "Converting file \""'	nmea.cpp	/nmea/src	line 217	C/C++ Problem
no match for 'operator<' in 'std::cout < "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"'	nmea.cpp	/nmea/src	line 358	C/C++ Problem
parse error in template argument list	nmea.cpp	/nmea/src	line 377	C/C++ Problem
parse error in template argument list	nmea.cpp	/nmea/src	line 428	C/C++ Problem
Invalid project path: Duplicate path entries found (/nmea [Include path] isSystemInclude:true includePath:C:/MinGW/include), path: [/nmea].	nmea		pathentry	Path Entry Problem
Invalid project path: Include path not found (C:\MinGW\lib\gcc\mingw32\4.5.2\include-fixed).	nmea		pathentry	Path Entry Problem
Invalid project path: Include path not found (C:\MinGW\lib\gcc\mingw32\4.5.2\include).	nmea		pathentry	Path Entry Problem
Invalid project path: Include path not found (C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++).	nmea		pathentry	Path Entry Problem
Invalid project path: Include path not found (C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\backward).	nmea		pathentry	Path Entry Problem
Invalid project path: Include path not found (C:\MinGW\lib\gcc\mingw32\4.5.2\include\c++\mingw32).	nmea		pathentry	Path Entry Problem
unused variable 'outfile'	nmea.cpp	/nmea/src	line 215	C/C++ Problem
                operator<(void*, void*) <built-in>	nmea.cpp	/nmea/src	line 217	C/C++ Problem
                operator<(void*, void*) <built-in>	nmea.cpp	/nmea/src	line 358	C/C++ Problem
candidates are: operator<(const char*, const char*) <built-in>	nmea.cpp	/nmea/src	line 217	C/C++ Problem
candidates are: operator<(const char*, const char*) <built-in>	nmea.cpp	/nmea/src	line 358	C/C++ Problem

Netbeans says,

"/usr/bin/make" -f nbproject/Makefile-Debug.mk QMAKE= SUBPROJECTS= .build-conf
make[1]: Entering directory `/c/Users/***/Documents/NetBeansProjects/NMEA'
"/usr/bin/make"  -f nbproject/Makefile-Debug.mk dist/Debug/MinGW-Windows/nmea.exe
make[2]: Entering directory `/c/Users/***/Documents/NetBeansProjects/NMEA'
mkdir -p build/Debug/MinGW-Windows
rm -f build/Debug/MinGW-Windows/main.o.d
g++    -c -g -MMD -MP -MF build/Debug/MinGW-Windows/main.o.d -o build/Debug/MinGW-Windows/main.o main.cpp
main.cpp: In function `int main(int, char**)':
main.cpp:209: error: no match for 'operator<' in 'std::cerr < "Converting file \""'
main.cpp:209: note: candidates are: operator<(const char*, const char*) <built-in>
main.cpp:209: note:                 operator<(void*, void*) <built-in>
main.cpp:209: error: `nmea' was not declared in this scope
main.cpp:350: error: no match for 'operator<' in 'std::cout < "<?xml version=\"1.0\" encoding=\"ISO-8859-1\"?>"'
main.cpp:350: note: candidates are: operator<(const char*, const char*) <built-in>
main.cpp:350: note:                 operator<(void*, void*) <built-in>
main.cpp:350: error: `std::endl(std::basic_ostream<_CharT, _Traits>&)' cannot appear in a constant-expression
main.cpp:369: error: parse error in template argument list
main.cpp:350: error: `endl<<expression error> >' cannot appear in a constant-expression
main.cpp:420: error: parse error in template argument list
main.cpp:350: error: `endl<<expression error> >' cannot appear in a constant-expression
main.cpp:420: error: parse error in template argument list
main.cpp:350: error: `endl<<expression error> >' cannot appear in a constant-expression
main.cpp:420: error: parse error in template argument list
main.cpp:420: error: expected `;' before '}' token
main.cpp:420:5: warning: no newline at end of file
make[2]: *** [build/Debug/MinGW-Windows/main.o] Error 1
make[1]: *** [.build-conf] Error 2
make: *** [.build-impl] Error 2
make[2]: Leaving directory `/c/Users/***/Documents/NetBeansProjects/NMEA'
make[1]: Leaving directory `/c/Users/***/Documents/NetBeansProjects/NMEA'

BUILD FAILED (exit value 2, total time: 1s)

Edited 5 Years Ago by adam25: n/a

Attachments
$GPGGA,135019.74,4736.6215,N,01908.8479,E,1,11,0.756,127.002,M,43.719,M,0,0*6E
$GPRMC,135019.74,A,4736.6215,N,01908.8479,E,0.000,0.000,070511,0,W,A*33
$GPVTG,0.000,T,0.000,M,0.000,N,0.000,K,A*23
$GPGSA,A,3,26,28,8,15,5,27,9,18,17,7,19,37,1.235,0.756,0.976*34
$GPGSV,3,1,12,5,27,210,35,7,12,79,35,8,40,68,43,9,6,267,34*4F
$GPGSV,3,2,12,15,41,304,46,17,14,140,37,18,5,330,42,19,5,24,36*49
$GPGSV,3,3,12,26,83,293,44,27,26,272,36,28,68,88,27,37,35,177,0*7C
$GPGGA,135020.74,4736.6215,N,01908.8479,E,1,11,0.756,127.002,M,43.719,M,0,0*64
$GPRMC,135020.74,A,4736.6215,N,01908.8479,E,0.000,0.000,070511,0,W,A*39
$GPVTG,0.000,T,0.000,M,0.000,N,0.000,K,A*23
$GPGSA,A,3,26,28,8,15,5,27,9,18,17,7,19,37,1.235,0.756,0.976*34
$GPGGA,135021.74,4736.6215,N,01908.8479,E,1,11,0.756,127.002,M,43.719,M,0,0*65
$GPRMC,135021.74,A,4736.6215,N,01908.8479,E,0.000,0.000,070511,0,W,A*38
$GPVTG,0.000,T,0.000,M,0.000,N,0.000,K,A*23
$GPGSA,A,3,26,28,8,15,5,27,9,18,17,7,19,37,1.235,0.756,0.976*34
$GPGGA,135022.74,4736.6215,N,01908.8479,E,1,11,0.756,127.002,M,43.719,M,0,0*66
$GPRMC,135022.74,A,4736.6215,N,01908.8479,E,0.000,0.000,070511,0,W,A*3B
$GPVTG,0.000,T,0.000,M,0.000,N,0.000,K,A*23
$GPGSA,A,3,26,28,8,15,5,27,9,18,17,7,19,37,1.235,0.756,0.976*34
$GPGGA,135023.74,4736.6215,N,01908.8479,E,1,11,0.756,127.002,M,43.719,M,0,0*67
$GPRMC,135023.74,A,4736.6215,N,01908.8479,E,0.000,0.000,070511,0,W,A*3A
$GPVTG,0.000,T,0.000,M,0.000,N,0.000,K,A*23
$GPGSA,A,3,26,28,8,15,5,27,9,18,17,7,19,37,1.235,0.756,0.976*34
$GPGGA,135024.74,4736.6215,N,01908.8479,E,1,11,0.756,127.002,M,43.719,M,0,0*60
$GPRMC,135024.74,A,4736.6215,N,01908.8479,E,0.000,0.000,070511,0,W,A*3D
$GPVTG,0.000,T,0.000,M,0.000,N,0.000,K,A*23
$GPGSA,A,3,26,28,8,15,5,27,9,18,17,7,19,37,1.235,0.756,0.976*34
$GPGSV,3,1,12,5,27,210,36,7,12,79,35,8,40,68,43,9,6,267,36*4E
$GPGSV,3,2,12,15,41,304,46,17,14,140,38,18,5,330,41,19,5,24,36*45
$GPGSV,3,3,12,26,83,293,44,27,26,272,35,28,68,88,25,37,35,177,0*7D
$GPGGA,135025.74,4736.6215,N,01908.8479,E,1,11,0.756,127.002,M,43.719,M,0,0*61
$GPRMC,135025.74,A,4736.6215,N,01908.8479,E,0.000,0.000,070511,0,W,A*3C
$GPVTG,0.000,T,0.000,M,0.000,N,0.000,K,A*23
$GPGSA,A,3,26,28,8,15,5,27,9,18,17,7,19,37,1.235,0.756,0.976*34
$GPGGA,135026.74,4736.6215,N,01908.8479,E,1,11,0.756,127.002,M,43.719,M,0,0*62
$GPRMC,135026.74,A,4736.6215,N,01908.8479,E,0.000,0.000,070511,0,W,A*3F
$GPVTG,0.000,T,0.000,M,0.000,N,0.000,K,A*23
$GPGSA,A,3,26,28,8,15,5,27,9,18,17,7,19,37,1.235,0.756,0.976*34
$GPGGA,135027.74,4736.6215,N,01908.8479,E,1,11,0.756,127.002,M,43.719,M,0,0*63
$GPRMC,135027.74,A,4736.6215,N,01908.8479,E,0.000,0.000,070511,0,W,A*3E
$GPVTG,0.000,T,0.000,M,0.000,N,0.000,K,A*23
$GPGSA,A,3,26,28,8,15,5,27,9,18,17,7,19,37,1.235,0.756,0.976*34

Not sure about Eclipse. It's most likely quite similar to NetBeans, though possibly with diferent categories and subcategoreies. All Projects will have a "Properties" option, with a bunch of sub-options. In NetBeans, right-click your C++ project and select "Properties". Select the "Run" category from within "Properties". Within "Run", Select "General" (it's the only option). Within "General", there is an option called "Arguments". That's where you type in the command line arguments to be passed to the main function. Save it, recompile (recompile probably isn't necessary, but can't hurt), and run again.


[EDIT]
Wait a minute, those look like compiler errors. Runtime arguments are irrelevant if it doesn't compile. Is this a NetBeans-specific thread or a generic thread asking for help on C++ code?
[/EDIT]

Edited 5 Years Ago by VernonDozier: n/a

Well, pretty much everywhere in the code, you use a single < where you need two (outputting with streams). That will fix your problem. And you also need to #include <cstring> to get the strlen function.

Edited 5 Years Ago by mike_2000_17: n/a

I replaced all < with << and it worked fine. Thanks very much everyone for the help!

This article has been dead for over six months. Start a new discussion instead.