简体   繁体   English

在Visual Studio 2012中将c和c ++代码作为一个.exe文件一起编译

[英]compiling c and c++ code together as one .exe file in Visual Studio 2012

I am trying to port a piece of software from Linux to Windows. 我正在尝试将一个软件从Linux移植到Windows。 Actual software is written primarily in C++ and significant code is in C language. 实际的软件主要是用C ++编写的,而重要的代码是用C语言编写的。 I tried to compile this code using Visual Studio 2012 (because I am using windows 2007) but at linking time I am getting many errors which says the function calls in C files are unknown entries. 我尝试使用Visual Studio 2012编译此代码(因为我使用的是Windows 2007),但是在链接时我遇到了很多错误,该错误表明C文件中的函数调用是未知条目。 This software compiles, links and run fine on Linux so there are no issues with include of or anything silly like that. 该软件可以在Linux上编译,链接并正常运行,因此include或类似的东西都没有问题。

Has anyone run into this issue? 有没有人遇到这个问题? Does anyone know how to resolve it? 有人知道如何解决吗?

Please note that I have to do a native port so cygwin or other mingw are not options for me. 请注意,我必须做一个本地端口,所以cygwin或其他mingw对我来说不是选项。

Thanks for your help in advance. 感谢您的帮助。

Chances are, you are using some kind of Linux-specific library. 您可能正在使用某种特定于Linux的库。 The most obvious example would be unistd.h, which doesn't really have a direct equivalent in Windows. 最明显的例子是unistd.h,它在Windows中实际上没有直接的等效项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM