C code in OpenEmm

Use this forum for all questions related to the source code of OpenEMM

Moderator: moderator

maschoff
Site Admin
Posts: 2187
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: C code in OpenEmm

Post by maschoff » Fri May 17, 2013 11:11 am

I mailed you new file "agn.h". If it works, I will build a new source tarball.
OpenEMM Maintainer

Wendy
Posts: 11
Joined: Thu May 16, 2013 2:58 am

Re: C code in OpenEmm

Post by Wendy » Mon May 20, 2013 3:10 am

Hi Maschoff,

Thanks for your new agn.h file, I rebuild the c code but the bad news is errors still happened in it. And here is the error log in agn.h

Code: Select all

c:\workspace\openemm_vc\src\lib\agn.h(247) : error C2061: syntax error : identifier 'sigset_t'
c:\workspace\openemm_vc\src\lib\agn.h(248) : error C2061: syntax error : identifier 'oldmask'
c:\workspace\openemm_vc\src\lib\agn.h(248) : error C2059: syntax error : ';'
c:\workspace\openemm_vc\src\lib\agn.h(251) : error C2059: syntax error : '}'
c:\workspace\openemm_vc\src\lib\agn.h(266) : error C2065: 'PATH_MAX' : undeclared identifier
c:\workspace\openemm_vc\src\lib\agn.h(266) : error C2057: expected constant expression
c:\workspace\openemm_vc\src\lib\agn.h(267) : error C2229: struct '' has an illegal zero-sized array
c:\workspace\openemm_vc\src\lib\agn.h(363) : error C2061: syntax error : identifier '__attribute__'
c:\workspace\openemm_vc\src\lib\agn.h(363) : error C2059: syntax error : ';'
c:\workspace\openemm_vc\src\lib\agn.h(363) : error C2059: syntax error : ','
c:\workspace\openemm_vc\src\lib\agn.h(363) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(363) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(364) : error C2061: syntax error : identifier '__attribute__'
c:\workspace\openemm_vc\src\lib\agn.h(364) : error C2059: syntax error : ';'
c:\workspace\openemm_vc\src\lib\agn.h(364) : error C2059: syntax error : ','
c:\workspace\openemm_vc\src\lib\agn.h(364) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(364) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(435) : error C2143: syntax error : missing '{' before '*'
c:\workspace\openemm_vc\src\lib\agn.h(436) : error C2143: syntax error : missing '{' before '*'
c:\workspace\openemm_vc\src\lib\agn.h(436) : error C2143: syntax error : missing ')' before '*'
c:\workspace\openemm_vc\src\lib\agn.h(436) : error C2143: syntax error : missing '{' before '*'
c:\workspace\openemm_vc\src\lib\agn.h(436) : error C2059: syntax error : ')'
c:\workspace\openemm_vc\src\lib\agn.h(437) : error C2143: syntax error : missing ')' before '*'
c:\workspace\openemm_vc\src\lib\agn.h(437) : error C2143: syntax error : missing '{' before '*'
c:\workspace\openemm_vc\src\lib\agn.h(437) : error C2059: syntax error : ')'
c:\workspace\openemm_vc\src\lib\agn.h(438) : error C2143: syntax error : missing ')' before '*'
c:\workspace\openemm_vc\src\lib\agn.h(438) : error C2143: syntax error : missing '{' before '*'
c:\workspace\openemm_vc\src\lib\agn.h(438) : error C2059: syntax error : ')'
c:\workspace\openemm_vc\src\lib\agn.h(464) : error C2061: syntax error : identifier '__attribute__'
c:\workspace\openemm_vc\src\lib\agn.h(464) : error C2059: syntax error : ';'
c:\workspace\openemm_vc\src\lib\agn.h(464) : error C2059: syntax error : ','
c:\workspace\openemm_vc\src\lib\agn.h(464) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(464) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(465) : error C2061: syntax error : identifier '__attribute__'
c:\workspace\openemm_vc\src\lib\agn.h(465) : error C2059: syntax error : ';'
c:\workspace\openemm_vc\src\lib\agn.h(465) : error C2059: syntax error : ','
c:\workspace\openemm_vc\src\lib\agn.h(465) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(465) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(466) : error C2061: syntax error : identifier '__attribute__'
c:\workspace\openemm_vc\src\lib\agn.h(466) : error C2059: syntax error : ';'
c:\workspace\openemm_vc\src\lib\agn.h(466) : error C2059: syntax error : ','
c:\workspace\openemm_vc\src\lib\agn.h(466) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(466) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(467) : error C2061: syntax error : identifier '__attribute__'
c:\workspace\openemm_vc\src\lib\agn.h(467) : error C2059: syntax error : ';'
c:\workspace\openemm_vc\src\lib\agn.h(467) : error C2059: syntax error : ','
c:\workspace\openemm_vc\src\lib\agn.h(467) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(467) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(468) : error C2061: syntax error : identifier '__attribute__'
c:\workspace\openemm_vc\src\lib\agn.h(468) : error C2059: syntax error : ';'
c:\workspace\openemm_vc\src\lib\agn.h(468) : error C2059: syntax error : ','
c:\workspace\openemm_vc\src\lib\agn.h(468) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(468) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(469) : error C2061: syntax error : identifier '__attribute__'
c:\workspace\openemm_vc\src\lib\agn.h(469) : error C2059: syntax error : ';'
c:\workspace\openemm_vc\src\lib\agn.h(469) : error C2059: syntax error : ','
c:\workspace\openemm_vc\src\lib\agn.h(469) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(469) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(470) : error C2061: syntax error : identifier '__attribute__'
c:\workspace\openemm_vc\src\lib\agn.h(470) : error C2059: syntax error : ';'
c:\workspace\openemm_vc\src\lib\agn.h(470) : error C2059: syntax error : ','
c:\workspace\openemm_vc\src\lib\agn.h(470) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(470) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(471) : error C2061: syntax error : identifier '__attribute__'
c:\workspace\openemm_vc\src\lib\agn.h(471) : error C2059: syntax error : ';'
c:\workspace\openemm_vc\src\lib\agn.h(471) : error C2059: syntax error : ','
c:\workspace\openemm_vc\src\lib\agn.h(471) : error C2143: syntax error : missing ')' before 'constant'
c:\workspace\openemm_vc\src\lib\agn.h(471) : error C2143: syntax error : missing ')' before 'constant'


maschoff
Site Admin
Posts: 2187
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: C code in OpenEmm

Post by maschoff » Tue May 21, 2013 7:00 am

Hm, the "missing" definitions are at line 52 and later. For some reason this part of the program seems to be not executed. Do you use the right build.bat for compilation?
OpenEMM Maintainer

Wendy
Posts: 11
Joined: Thu May 16, 2013 2:58 am

Re: C code in OpenEmm

Post by Wendy » Tue May 21, 2013 7:07 am

I removed the #ifdef OSS and reserved #ifdef WIN32, the problem is gone, I hope the change will not influence any functionality of the C part of openemm

Code: Select all

#	ifdef	OSS
# ifdef		WIN32
# undef		_PATH_DEVNULL
# define	_PATH_DEVNULL		"nul"
# undef		_PATH_VARRUN
# define	_PATH_VARRUN		"\\OpenEMM\\var\\run\\"
# undef		_PATH_VARTMP
# define	_PATH_VARTMP		"\\OpenEMM\\var\\tmp\\"
# define	PATH_MAX		1024
# define	PATH_SEP		'\\'
typedef int	mode_t;
typedef int	sigset_t;
# define	__attribute__(xxx)
# define	inline
static int
snprintf (char *buf, int blen, const char *fmt, ...) /*{{{*/
{
	va_list	par;
	int	rc;
	
	va_start (par, fmt);
	rc = vsprintf (buf, fmt, par);
	va_end (par);
	return rc;
}/*}}}*/
# endif		/* WIN32 */
#	endif

maschoff
Site Admin
Posts: 2187
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: C code in OpenEmm

Post by maschoff » Tue May 21, 2013 7:37 am

I am sorry, where is the difference from the file I mailed you?
OpenEMM Maintainer

Wendy
Posts: 11
Joined: Thu May 16, 2013 2:58 am

Re: C code in OpenEmm

Post by Wendy » Wed May 22, 2013 9:14 am

at line 24 in the new "agn.h", there is "# ifdef OSS" to prevent compling of the the following statement "# ifdef WIN32" at line 25.
I removed line 24, and it seems no error happened in agn.h any more.

maschoff
Site Admin
Posts: 2187
Joined: Thu Aug 03, 2006 10:20 am
Location: Munich, Germany
Contact:

Re: C code in OpenEmm

Post by maschoff » Wed May 22, 2013 3:55 pm

Ah, I see. I just mailed you a new version.
OpenEMM Maintainer

Wendy
Posts: 11
Joined: Thu May 16, 2013 2:58 am

Re: C code in OpenEmm

Post by Wendy » Thu May 23, 2013 7:57 am

Hi maschoff,

Thanks for the new agn,h file and it is working well. Now I can build src/c/lib, src/c/xmlback/grammar successfully, but when build src/c/xmlback, it reminds me there is an error like this: fatal error LNK1104: cannot open file 'libslang.lib'.

I read slang-1.4.9/INSTALL.pc which indicates slang-1.4.9/src/mkfiles/README, and entered commands under both DOS CMD command promot and MinGW Shell like this:
mkmake.exe
mkmake BCC < makefile.all > makefile

it generats nothing a makefile in the folder, and I want to know how to create libslang.lib in WIN32?

Regards,
Wendy

Wendy
Posts: 11
Joined: Thu May 16, 2013 2:58 am

Re: C code in OpenEmm

Post by Wendy » Mon May 27, 2013 11:10 am

Hi Maschoff,

When build slang-1.4.9/src with your provided build.bat, there is an error:

Code: Select all

sltime.c(28) : fatal error C1083: Cannot open include file: 'windows.h': No such file or directory
but the libslang.lib still generated.

so I use it to compile src/c/xmlback, I got error like this:

Code: Select all

xml.obj : error LNK2019: unresolved external symbol _cache_free referenced in function _xconv_free
xml.obj : error LNK2019: unresolved external symbol _cache_alloc referenced in function _xconv_alloc
xml.obj : error LNK2019: unresolved external symbol _cache_add referenced in function _converter
xml.obj : error LNK2019: unresolved external symbol _cache_find referenced in function _converter
libslang.lib(slstd.obj) : error LNK2019: unresolved external symbol __SLang_init_sltime referenced in function _SLang_init_slang
xmlback.exe : fatal error LNK1120: 5 unresolved externals
it seems that generated libslang.lib is not well compiled, please suggest what I should do to fix the problem.

Thanks,
Wendy

Post Reply