[英]how to compile c program on linux that runs on windows
I have got a project that is using jni to connect java wrapper and C code. 我有一个使用jni连接java包装器和C代码的项目。 It was developed by somebody else.
它是由其他人开发的。 I compiled the c code as a dynamic library in netbeans using mingw on windows and it works fine.
我使用windows上的mingw将c代码编译为netbeans中的动态库,它工作正常。 Now I am trying to do the same in ubuntu.
现在我想在ubuntu中做同样的事情。 But when I open a header files in netbeans it underlines the following:
但是当我在netbeans中打开头文件时,它强调了以下内容:
typedef PVOID FT_HANDLE;
typedef ULONG FT_STATUS;
and it says Unable to resolve identifier PVOID and the same for ULONG Also getting several other errors "unable to resolve identifier". 并且它说无法解析标识符PVOID和ULONG相同也会得到其他几个错误“无法解析标识符”。
When I build the proejct I get the following erros: http://pastebin.com/hPrTJwxF 当我构建项目时,我得到以下错误: http ://pastebin.com/hPrTJwxF
I am new to C. I have always programmed in Java. 我是C的新手。我一直用Java编程。 Any hints on that?
有什么提示吗?
They are not standard C types, but it should ve trivial to #define your own replacements on Linux. 它们不是标准的C类型,但在Linux上#define你自己的替代品应该是微不足道的。 See also Visual C++ can't find "Windows types" like PVOID, DWORD, ULONG, etc
另请参见Visual C ++找不到像PVOID,DWORD,ULONG等“Windows类型”
I would expect the following to work, but I have no means to test. 我希望以下工作,但我没有办法测试。
#define PVOID void *
#define ULONG unsigned long
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.