473,657 Members | 2,420 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

does not name a type using g++ compiling

2 New Member
I have a program like this
1.Analyze.h as follows

#if !defined(AFX_AN ALYZE_H__550791 A7_B441_4AD3_BC EB_4F391A71D410 __INCLUDED_)
#define AFX_ANALYZE_H__ 550791A7_B441_4 AD3_BCEB_4F391A 71D410__INCLUDE D_
#if _MSC_VER > 1000
#pragma once
#include <direct.h>
#include "symbol_macros. h"
#include "ShareTools .h"
#endif // _MSC_VER > 1000

extern ShareTools g_Tools;

using namespace std;

class Analyze
{
public:
Analyze();
virtual ~Analyze();

public:
virtual bool setSwitches(Cod ingScheme encoding=UTF8_C ODING,char *ListPath="", char *DataPath="");
.......
}
#endif
2. ShareTools.h as follows
#if !defined(AFX_SH ARETOOLS__INCLU DED_)
#define AFX_SHARETOOLS_ _INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#pragma warning(disable :4786)

#include <time.h>
#include "codingConverse .h"
#include "Counterpoint.h "
using namespace std;

class ShareTools
{
public:
ShareTools()
....
}
#endif
3.symbol_macros .h as follows
#if !defined(AFX_SY MBOL_MACROS_INC LUDED)
#define AFX_SYMBOL_MACR OS_INCLUDED

///to screen C4786 warning information when compiling
#pragma warning(disable :4786)

#include "LIMITS.H"
#include <vector>
#include <string>
using namespace std;

enum ConversorName {GB_UNICODE, UNICODE_GB, UTF8_UNICODE,
UNICODE_UTF8, BIG5_UNICODE, UNICODE_BIG5,
UCS2_UNICODE,UN ICODE_UCS2};

const unsigned short ConversorMaxNum =UNICODE_UCS2+1 ;

/// the encoding schemes the system can treat. GB series, BIG5, UTF-8
enum CodingScheme {GB_CODING, UTF8_CODING, BIG5_CODING, UCS2_CODING};
.....
#endif

but when using g++ to compile this on linux, errors like this:
'ShareTools'doe s not name a type
'CodingScheme'h as not been declared

why? how to solve this?
this program can be compile successfully on VS 2005
Jun 2 '08 #1
2 6658
gpraghuram
1,275 Recognized Expert Top Contributor
How are you compiling the code and what options u use for compiling it?

Raghu
Jun 2 '08 #2
medrifter
2 New Member
How are you compiling the code and what options u use for compiling it?

Raghu
thank you for your reply, I have solved it, it's because of #if _MSC_VER > 1000,
it will not be defined in linux, so the include file will not be included.
Jun 2 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

6
5513
by: blueblueblue2005 | last post by:
Hi, below is the code I copy from c++ tutorial, it is about template specialization, but when I compile, I got error message: error: template-id `module<>' for `int mypair<int>::module()' does not match any template declaration tmp.cpp:28: error: syntax error before `{' token I guess it might be that my compiler does not recognize this type of using template??? I am using g++-3.3 compiler under Ubuntu linux. any help will be...
11
7385
by: Jon Smith via DotNetMonster.com | last post by:
Hi all, I'm new to C# and am practising the language by writing simple contact manager programmes. I'm having a problem using ADO. I'm trying to connect to an Access 2000 database using ADO.Net. When compiling I'm getting the following error : The type or namespace name 'ADO' does not exist in the class or namespace 'System')are you missing an assembly reference?) I've included the 'using System.Data.ADO' namespace, although when I...
7
9985
by: Clint Herron | last post by:
Howdy! I posted this question on CSharpCorner.com, but then realized I should probably post it on a more active newsgroup. This will be my only cross-post. I'm creating a game engine, and using CodeDOM for my scripting needs (I realize I could use yacc or something else, but I wanted to try using CodeDOM -- this is more of an exercise for me to learn this stuff). Well, I compile my in-game scripts just fine. See appendix A for my code
5
2614
by: Mariame | last post by:
Hi Everyone is there is a way to get the name of the WebForm Loaded & set it in a Variable???? Thx in Adv.
89
6035
by: Cuthbert | last post by:
After compiling the source code with gcc v.4.1.1, I got a warning message: "/tmp/ccixzSIL.o: In function 'main';ex.c: (.text+0x9a): warning: the 'gets' function is dangerous and should not be used." Could anybody tell me why gets() function is dangerous?? Thank you very much. Cuthbert
15
2281
by: amit.man | last post by:
Hi, i have newbie qestion, when i write #include <somthing.h> the precompiler subtitue that line with the lines from "somthing.h" header file. when, where and how the compiler insert the lines in "somthing.c" implementation file into my source code?
22
2523
by: Cogito | last post by:
For the first time, I'm attempting to write a small Javascript program using one on the online reference sites. I need some confirmation as to the behaviour of the break statement. In the following code: for ( row = 0 ; row <= 7 ; row++ ) A <---- { for ( col = 0 ; col <=7 ; col++ ) B <---- {
13
30298
by: sharat | last post by:
hi groups, i have created 2 .cpp and .h(header) file and one main.cpp file, such as file1.cpp and .h similarly file2.cpp & .h . i have include the apropriate header files also .now i am creating the object of class A (which is declare and define in file1.h) into class B(which is declare and define in file2.h). i am getting an error that "class a " doesnot name a type and the object i have creted is undeclared . i am unable to get why...
11
2696
by: MonkeeSage | last post by:
A quick question about how python parses a file into compiled bytecode. Does it parse the whole file into AST first and then compile the AST, or does it build and compile the AST on the fly as it reads expressions? (If the former case, why can't functions be called before their definitions?) Thanks, Jordan
0
8395
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8826
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
4155
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1955
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.