| 
 | 
 | 
 
Home » U++ TheIDE » U++ TheIDE: Compiling, Linking, Debugging of your packages » Console 'Hello World' won't build. 
	
		
		
			| Console 'Hello World' won't build. [message #10906] | 
			Fri, 03 August 2007 23:30   | 
		 
		
			
				
				
				
					
						  
						JohnO
						 Messages: 4 Registered: August 2007  Location: Ireland
						
					 | 
					Junior Member  | 
					 | 
		 
		 
	 | 
 
	
		Hi, 
 Here is a simple console program which won't build (in theIDE). 
It gives this error: 
 
 syntax error : missing ';' before identifier 'a' 
 
This code is basically from the Core value types tutorial. 
Type 'String' doesn't appear to be recognised. 
Any idea what's up with this code? 
 
Thanks, 
John 
 
--------------------------- 
#include "stdio.h" 
#include <iostream> 
 
using namespace Upp; 
 
int main(int argc, const char *argv[]) 
{ 
char dummy; 
String a; 
 
a = "Howdy"; 
a = a + " Partner!"; 
 
std::cerr << "Hello, platform! " << std::endl; 
std::cerr << a << std::endl; 
std::cin >> dummy; 
return 0; 
} 
		
		
		
 |  
	| 
		
	 | 
 
 
 |  
	
		
		
			| Re: Console 'Hello World' won't build. [message #10907 is a reply to message #10906] | 
			Sat, 04 August 2007 01:35    | 
		 
		
			
				
				
				  | 
					
						  
						fudadmin
						 Messages: 1321 Registered: November 2005  Location: Kaunas, Lithuania
						
					 | 
					Ultimate Contributor Administrator  | 
					 | 
		 
		 
	 | 
 
	
		If I recall well, one can't use "naked" "main" function with U++... 
Have a look at console apps examples (e.g CParser) 
 
3 minimum U++ requirements : 
 
1. include at least one U++ package which recursively includes <Core/Core.h> 
 
2. Your code must be wrapped inside: 
2.a 
  
OR 
 2.b 
  
3. Main package configuration flags must be set accordingly: CONSOLE or GUI.  
 
 
==== 
"String" is not recognized because it gets included with "Core" mentioned above.
		
		
		[Updated on: Sat, 04 August 2007 01:37] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	
		
		
			| Re: Console 'Hello World' won't build. [message #10939 is a reply to message #10936] | 
			Sun, 05 August 2007 21:41   | 
		 
		
			
				
				
				  | 
					
						  
						fudadmin
						 Messages: 1321 Registered: November 2005  Location: Kaunas, Lithuania
						
					 | 
					Ultimate Contributor Administrator  | 
					 | 
		 
		 
	 | 
 
	
		Ok, correct me if I'm wrong: 
 
If I recall well, one can't use "naked" "main" function with U++... (I didn't say C++ !!!   ) 
Have a look at console apps examples (e.g CParser) 
 
 
*** 3 minimum requirements If you use U++ *** 
(but you have to be able to compile Upp examples first!!!) 
 
You have to have: 
========= 
1. at least one  #include in at least one of your files (directly or recursively) usually 
1.a <Core/Core.h> for CONSOLE apps 
 <CtrlLib/CtrlLib.h> for GUI apps 
 
1.b (Synchronically, in parallel or any similar word of your choice) at least one U++ package with the same name added to  
to your packages (check the top-left list of names (they are the names of packages) or in MyPackageName.upp file) 
[How to find MyPackageName.upp file - a separate topic] 
========= 
2.  your code wrapped inside: 
2.a 
  
OR 
 2.b 
  
========== 
3. Main package configuration flags set accordingly: CONSOLE or GUI.  
 
 
Edit: 
BTW, have you read this: 
http://www.ultimatepp.org/app$ide$GettingStarted$en-us.html
		
		
		[Updated on: Sun, 05 August 2007 21:51] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 08:48:04 CET 2025 
 Total time taken to generate the page: 0.03895 seconds 
 |   
 |  
  |