简体   繁体   English

如何在windows上运行的linux上编译c程序

[英]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.

相关问题 如何在Linux上交叉编译Windows的C SDL程序? - How to cross compile a C SDL program for Windows on Linux? C程序将在Linux而非Windows上编译并运行 - C Program will compile and run in Linux but not Windows 如何在Linux中使用Windows套接字编译程序? - How to compile program with windows sockets in linux? 如何在Bochs中的DLX linux中编译C程序 - how to compile a C program in DLX linux in Bochs Windows中的gcc无法编译为Unix / Linux编写的C程序 - gcc in Windows cannot compile C program written for Unix/Linux 如何在Linux上编译可在Solaris上正常运行的“ C”应用程序? - How to compile a 'C' application on Linux which compiles and runs fine on Solaris? 如何使用适用于Linux的g ++编译C ++程序以在Windows操作系统中工作? - how do i compile a C++program to work in the windows operating system using g++ for linux? 如何编写可在Linux和Windows中轻松编译的C ++程序? - How do I write a C++ program that will easily compile in Linux and Windows? 如何编译 C Linux 库以用于 Windows? - How to compile C Linux libraries for use in Windows? 如何编译Linux C程序以在另一台Linux机器上运行? - How to compile Linux C program to run on another Linux machine?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM