Featured post

c# - Usage of Server Side Controls in MVC Frame work -

i using asp.net 4.0 , mvc 2.0 web application. project requiremrnt have use server side control in application not possibl in noraml case. ideally want use adrotator control , datalist control. i saw few samples , references in codepleax mvc controllib howwver found less useful. can tell how utilize theese controls in asp.net application along mvc. note: please provide functionalities related adrotator , datalist controls not equivalent functionalities thanks in advace. mvc pages not use normal .net solution makes use of normal .net components impossible. a normal .net page use event driven solution call different methods service side mvc use actions , view completly different way handle things. also, mvc not use viewstate normal .net controlls require. found article discussing mixing of normal .net , mvc.

compiler construction - Detect undefined symbols in C header file -


suposse coded c library provides bunch of "public" functions, declared in mylib.h header file. functions supposedly implemented in (say) mylib.c file compiled (say) static lib mylib.c -> mylib.o -> mylib.a.

is there way detect forgot provide implementation of declared function in mylib.h? (yes, know unit testing, practices, etc - and, yes, understand meaning of plain function declaration in c).

suppose mylib.h declares void func1(); , function not coded in provided library. trigger error if linker needs use function. otherwise, compile ok , without warnings - afaik. there way (perhaps compiler dependent) trigger warning declared not implemented functions, or there other way deal issue?

btw: nm -u lists not undefined declared functions, "used" library, i.e., functions trigger error in linking phase if not declared somewhere. (which makes sense, library object file not know header files, of course.)

basically, reliable way have program (or possibly series of programs) formally exercise each , every 1 of functions. if 1 of programs fails link because of missing symbol, you've goofed.

i suppose try editing copy of header source file (as in, file ending .c), converting function declarations dummy function definitions:

original:

extern int somefunc(void); 

revised:

extern int somefunc(void){} 

then compile modified source minimum warnings - , ignore "function supposed return value doesn't". compare defined symbols in object file revised source defined symbols in library (using nm -g on unix-like systems). present in object file isn't present in library missing , should supplied.

note: if header includes other headers of own define functions, need process of those. if header includes standard headers such <stdio.h>, won't defining functions such fopen() or printf() in ordinary course of events. so, choose headers reprocess source code carefully.


Comments

Popular posts from this blog

c# - Usage of Server Side Controls in MVC Frame work -

cocoa - Nesting arrays into NSDictionary object (Objective-C) -

ios - Very simple iPhone App crashes on UILabel settext -