C MySQL error “fatal error LNK1107: invalid or corrupt file: cannot read at 0x368”

旧街凉风 提交于 2021-01-29 04:24:24

问题


first off i'd like to start by explaining i am new to none web based programing languages, so this is really all new to me. But ive been trying to solve this problem all night and cant seem to get it.

so I just installed a bunch of MySQL libraries. I create links to all the libraries and since I have done that, this error message has been popping up.I did a little bit of research on it, and it appears that the sarah message is happening because I'm using the dynamic library.but I have absolutely no idea how to go 5about fixing it.also I must point out that I am using it the Microsoft Visual C++ 2010 compilerand the code blocks Ide, even though I am currently working in the C language. any help anyone can give me is greatly appreciated. Thank you.

Also not sure if it helps but heres my code.

#include <my_global.h>
#include <mysql.h>

int main(int argc, char **argv)
{
  printf("MySQL client version: %s\n", mysql_get_client_info());

  return 0;
}

回答1:


This might help you http://www.chriscalender.com/?tag=libmysql-dll-fatal-error-lnk1107-invalid-or-corrupt-file I think.

"The problem is trying to use the .dll instead of the .lib, so replace libmysql.dll with libmysql.lib."

Try and see.



来源:https://stackoverflow.com/questions/23419364/c-mysql-error-fatal-error-lnk1107-invalid-or-corrupt-file-cannot-read-at-0x36

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!