开发者

How to create a header file for my existing C program in linux to connect with MySql?

开发者 https://www.devze.com 2023-03-06 21:38 出处:网络
it\'s my first time I use Linux and C programming. I\'ve wrote a file in C language to connect with MySQL and it\'s working fine now. Now I\'ve to integrate this file into my company web-based system

it's my first time I use Linux and C programming. I've wrote a file in C language to connect with MySQL and it's working fine now. Now I've to integrate this file into my company web-based system which is written with CGI ( C ). So I guess I should make my file as a header file and call this file from the CGI. How should I create a header file ? Or is there any better way ? I google 开发者_Go百科on the net but not so lucky with CGI. Can anybody help me?


I don't think that putting everything in a header file is the best solution.

  • Create a header file and put the function prototypes and structure declarations in it
  • Create a C file and put function definitions in it

Then you can either link with the object file obtained or you can create a dynamic library.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号