Click here to Skip to main content
15,892,575 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
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
Posted
Comments
Richard MacCutchan 3-Dec-12 7:13am    
I have not used eclipse for C++ development for a few years, but when I was using it I was able to set breakpoints, display Unicode characters, and anything else necessary to test the programs. If you want to use the Windows definitions then you need to include the appropriate headers or create your own.
BadJerry 4-Dec-12 6:16am    
Sorry - I replied as a solution!
I will enquire some more about the C++ debugging. We are using code for an android dev... ideally we would like to view variables and run step by step... but still no luck!
As for the inclusion of appropriate headers, I catually want to prevent the default header inlcusion llike winnt.h!
Thanks in advance!

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.
 
Share this answer
 
in winnt.h they use
#ifndef _WINNT_
just define it in your project definition, and it will not be automatically included.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900