Click here to Skip to main content
Sign Up to vote bad
good
See more: C++Android
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 3 Dec '12 - 0:50
BadJerry7.1K

Comments
Richard MacCutchan - 3 Dec '12 - 7:13
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:16
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!

2 solutions

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

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

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 414
1 Arun Vasu 253
2 OriginalGriff 190
3 CPallini 163
4 Aarti Meswania 158
0 Sergey Alexandrovich Kryukov 10,169
1 OriginalGriff 7,749
2 CPallini 4,181
3 Rohan Leuva 3,482
4 Maciej Los 3,089


Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 11 Apr 2013
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid