Click here to Skip to main content
15,889,216 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello All,

It's an C++/CLR project.
I have below structure in my header file:
C++
value struct CONFIG
{	
	System::String^ Exch_Feeds;
	System::String^ Exch_Type;
	System::String^ Feeds_Type;
	int Feeds_port;
	int Max_Users;

	int IML_port;

	System::String^ Interface_IP;

	System::String^ Nse_Mcast_Host;
	int Nse_Mcast_Port;
	System::String^ Fno_Mcast_Host;
	int Fno_Mcast_Port;
	System::String^ Curr_Mcast_Host;
	int Curr_Mcast_Port;

	System::String^ Nse_Tcp_Host;
	int Nse_Tcp_Port;
	System::String^ Fno_Tcp_Host;
	int Fno_Tcp_Port;

	System::String^ Mcast_Host;
	int Mcast_Port;
	int Log_file;
	int Row_feed_file;

	System::String^ DownloadHost;

	short exchange_ctr;

	System::String^ dbserver;	
	System::String^ dbuser;
	System::String^ dbpass;
	System::String^ dbdb;
	int dbport;
};


And using it in my .cpp file as CONFIG cfg;

But it's giving me below errors:

Error	1	error C2146: syntax error : missing ';' before identifier 'cfg'		9	1
Error	2	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int		9	1
Error	3	error C4430: missing type specifier - int assumed. Note: C++ does not support default-int		9	1


Can some one have look and explain why am getting these errors.

It's an C++/CLR project.

What I have tried:

Tried using it by making my structure as a class, but still same error.
Posted
Updated 19-Feb-18 1:32am
v2
Comments
CHill60 19-Feb-18 7:34am    
You will need to share the code that is actually giving the error

1 solution

Your problem does not seem to be in the structure declaration, but rather where you try to use it.
The code you showed does not hold any cfg identifier. Find this identifier in your code, you most likely forgot to terminate one of your statements with a semicolon.
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900