- 论坛徽章:
- 0
|
公司一个人走了,他的程序让我接手,我不是程序员,不熟悉编程,我要做的是把他写好的程序在LINUX中编译好可以运行就可以了。当时他交给我的时候源程序是装在Fedora Core 5上的,还编译了一次给我看,当时没有显示错误信息。后来我把这个程序COPY到一个RedHat机器上编译过也没出问题(那台RedHat的机器走的那位在上面工作过)。
现在需要把程序放到一台Debian的服务器上运行,把手里的源程序全部COPY到Debian上编译,出现如下错误:
g++ -DHAVE_CONFIG_H -I. -Icommoncpp2-1.1.0/include -D_REENTRANT -D_THREAD_SAFE -g -DDEBUG -c srvmgrd.cpp
commoncpp2-1.1.0/include/cc++/string.h:89: error: ISO C++ forbids declaration of "MemPager" with no type
commoncpp2-1.1.0/include/cc++/string.h:89: error: expected ';' before '*' token
commoncpp2-1.1.0/include/cc++/thread.h:917: error: using typedef-name 'ost::Thread::Cancel' after 'enum'
commoncpp2-1.1.0/include/cc++/thread.h:892: error: 'ost::Thread::Cancel' has a previous declaration here
commoncpp2-1.1.0/include/cc++/thread.h: In member function 'ost::Thread::Cancel ost::Thread::getCancel()':
commoncpp2-1.1.0/include/cc++/thread.h:1195: error: invalid conversion from 'int' to 'ost::Thread::Cancel'
commoncpp2-1.1.0/include/cc++/socket.h: At global scope:
commoncpp2-1.1.0/include/cc++/socket.h:136: warning: inline function 'virtual void ost::InetMcastAddrValidator: perator()(in_addr) const' used but never defined
make: *** [srvmgrd.o] Error 1
上面提示错误的相关文件和其中提示错误的附近几行内容如下:
------------------------------------
string.h
private:
friend class MemPager;
static MemPager *pager; <==== this is line 89
static char **idx;
---------------------------------------
------------------------------------------
thread.h
typedef enum Cancel
{
cancelInitial=0, /**< used internally, do not use */
cancelDeferred=1, /**< exit thread on cancellation pointsuch as yield */
cancelImmediate, /**< exit befor cancellation */
cancelDisabled, /**< ignore cancellation */
cancelManual, /**< unimplemented (working in progress)
@todo implement */
cancelDefault=cancelDeferred
/**< default you should use this for compatibility instead of deferred */
} Cancel; <==== this is line 892
private:
Thread *_parent;
enum Cancel _cancel; <==== this is line 917
Semaphore *_start;
inline Cancel getCancel(void)
{return _cancel;}; <=== this is line 1195
--------------------------------------------
---------------------------------------
socket.h
inline void
operator()(const in_addr address) const; <=== this is line 136
---------------------------------------
我把源程序再COPY到另外两台运行Fedora的服务器上(分别装的是Fedora Core 6和Fedora Core 5)试验,还是出现同样的错误。
急求各位帮助判断错误出在什么地方以及如何处理。用GOOGLE搜索出来的信息都是程序写得有问题,但这个源程序我在原来那台Fedora Core 5以及RedHat上编译都没问题。
谢谢。 |
|