使用Android复制开发环境 [英] Replicating development environment with Android

查看:70
本文介绍了使用Android复制开发环境的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好!



我正在尝试为Android项目复制C ++环境。我们还没有找到在Eclipse中设置断点或任何远程现代的方法。或者就此而言使用Unicode。但是这已经超出了这一点,虽然建议非常受欢迎!



所以我们采用旧的时尚方式并在Visual Studio的控制台应用程序中测试代码确保代码有效。



是否有编译设置使用我们的TCHAR,LPCTSTR等定义...而不是WinNT.h in - 建一个?



提前致谢!

Jerry

Hello!

I am trying to replicate a C++ environment for a project for Android. We have not found ways to set breakpoints or anyting remotely modern in Eclipse. Or use Unicode for that matter. But that''s beyond the point although advices are VERY welcome!

So we are going the old fashion way and testing the code in a console app in Visual studio to make sure that the code works.

Is there a compiling settings to use "our" definition of TCHAR, LPCTSTR, etc... and not the WinNT.h in-built one?

Thanks in advance!
Jerry

推荐答案

我同意Richard的观点,你应该能够使用Eclipse和Android开发工具插件设置断点并逐步执行代码。

但是关于构建Visual Studio应用程序而不包含任何Windows的具体问题具体定义。它可以做到,但并不是那么容易。我已经进入了这个,因为我正在开发一个跨平台框架,这需要能够获取相同的源并为许多平台构建一个exe而无需修改。

关键Visual Studio C /要查找的C ++属性是预处理器下的忽略标准包含路径和链接器/输入下的忽略所有默认库。

使用这些设置可以阻止VC自动拉入任何Windowsy 。然后你需要手动添加你需要的所有内容。

要记住的一点是,无论exe是多么独立,它必须链接到Kernel32.lib才能成为有效的Windows可执行文件。有传言称在Vista下添加了新的安全检查以强制执行此操作,尽管我还没有尝试过。在实践中,几乎不可能编写一个无用的链接Kernel32的有用的exe。

如果你可以指向C / C ++ \General \ Additional的包含目录位于Bionic C库标题然后有一些机会能够使用C库函数,但你需要一个x86版本的Bionic来链接。这可以从Androidx86项目获得,具体取决于版本的兼容性。

祝你好运。它听起来好像你可能需要它。
I agree with Richard, you should be able to set breakpoints and step through code using Eclipse with the Android Development Tools plugin.
However on the specific question of building a Visual Studio app without the inclusion of any Windows specific definitions. It can be done but it''s not all that easy. I''ve been into this because I''m developing a cross platform framework which necessitates being able to take the same source and build an exe for many platforms without modification.
The key Visual Studio C/C++ Properties to look for are ''Ignore Standard Include Paths'' under Preprocessor and ''Ignore All Default Libraries'' under Linker/Input.
With these settings you can stop VC pulling in anything Windowsy automatically. Then you''ll need to manually add in everything you do need.
One thing to remember is that no matter how standalone an exe is it must link to Kernel32.lib to be a valid Windows executable. There are rumours of a new security check added under Vista to enforce this although I haven''t tried it out. In practice it''s almost impossible to write a useful exe that doesn''t link Kernel32 anyway.
If you can point the C/C++\General\Additional Include Directories at the location of the Bionic C library headers then there''s some chance of being able to use C library functions but you''ll need an x86 build of Bionic to link with. This may be available from the Androidx86 project depending on version compatability.
I wish you luck. It rather sounds as though you might need it.


在winnt.h中的


他们使用

#ifndef _WINNT_

只需定义它您的项目定义,它不会自动包含在内。
in winnt.h they use
#ifndef _WINNT_
just define it in your project definition, and it will not be automatically included.


这篇关于使用Android复制开发环境的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆