c++ - How do I run a class from another project? -


i new c++ , trying figure out best way run class project in solution.

lets have 2 projects in solution: proj_a , proj_b.

now create instance of class in proj_b inside proj_a. have tried including headers , source files proj_b proj_a. problem source files in proj_b have lot of dependencies , keep out of proj_a. because feel that merging 2 projects together. maybe going things wrong way. (i have c# background, looking equivalent adding reference project)

please me out here. =)

in c++, have 2 options splitting application modules. can use libraries, linked directly executable, or can use dlls, familiar c#.

it sounds using dlls. if case, need export classes dll (proj_b) want use in main executable (proj_a).

http://www.codeproject.com/kb/cpp/howto_export_cpp_classes.aspx

since worried exposing dependencies, suggest consider option 3 code project article. i've used 3 approaches described in article, , option 3 has become preferred method.


Comments

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -