changing c++ windows code for linux [closed] - c++

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I am working on Linux and need to change given code using win32 api functions into code that can run on linux
bool ret = ::TlsSetValue(tlsInChessFlag, (void *)(((size_t)TlsGetValue(tlsInChessFlag))+1));
can some please tell me what could be equivalent code in c++ ubuntu??
Thanx in advance

You could also use the __thread keyword available in GCC (it is a GCC extension).
And to develop C++ code which is portable on both Windows and Linux, you could use some cross-platform library, like e.g. Qt

Use pthreads facilities:
http://en.wikipedia.org/wiki/Thread-local_storage#Windows_implementation

Use boost's portable thread local API on both Windows and Linux.
http://www.boost.org/doc/libs/1_35_0/doc/html/thread/thread_local_storage.html

You could use the boost::thread implementation for thread local storage

Related

What is wmain or _tmain alternatives in linux? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Closed 8 years ago.
Improve this question
I want to read some unicode parameters via C++ main function. In Windows I can use wmain which is Mircosoft extension to standard C++. But I don't know to how to do the same in Linux platforms.
On linux you use the Standard C++ main function, and your data will be conveyed through char const*.
You should probably expect the encoding to be UTF-8 because this is the default on Linux.

Magic Particles [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I really like this Particle Emitter software here:
http://www.astralax.com/projects/particles
They have an API and even an OpenGL Wrapper for IOS but I cannot figure out how to integrate these particle emitters in to my standard UIKit Xcode project.
They have a sample for Cocos2dX (not interested in that) and they have a sample using OpenGL (which is pretty advanced) but no easy sample of how I can integrate to my existing standard Xcode projects referencing from my standard .h and .m files.
Has anyone figured out how to use this program with basic Xcode?
EDIT: I guess it says I am "Off Topic"...never seen that here before. Curious, I didn't even know there was a specific topic going on. I'm confused (sort of why I made the post in the first place).
You can use CAEmitterLayer extented from CALayer. See Apple documentation.

Bindind to keys C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Closed 8 years ago.
This question appears to be off-topic because it lacks sufficient information to diagnose the problem. Describe your problem in more detail or include a minimal example in the question itself.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Improve this question
Hello there I am a realative newbie when it comes to using different "commands" in order to achieve things so I was wondering if any of you know a way to bind a key to do a certain task anywhere in the programme ,so I would be able to display a function for example and after the display finishes the programme carries on normally like nothing happened and then that same key on any other push would still do the display . Thanks in advance
Plain C++ does not have any concept of "key binding". The platform (e.g., the operating system) has this knowledge and it provides some libraries to handle it. So, you must provide more information about the operating system, or use a cross-platform library like Qt.

How can I mix C/C++ with python? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
I want to use C++ for opengl and python for scripting various social api calls. IS there a better option?
Prototype with your OpenGL calls in python - it is much quicker to prototype than C/C++ and then see if it is quick enough - if it is then you are done - if not then find the bottlenecks and consult the documentation on C/C++ plug in to address those issues.
Note that there are python OpenGL bindings available here which already use C/C++ on the OpenGL side so should be as fast as anything you are likely to come up with quickly.

Graphics in Visual C++ [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
Questions asking for code must demonstrate a minimal understanding of the problem being solved. Include attempted solutions, why they didn't work, and the expected results. See also: Stack Overflow question checklist
Closed 9 years ago.
Improve this question
What header file should I include to use graphics in Visual C++? I use Visual Studio 2010. Thank you in advance!
"Graphics" is a broad subject. Native Win32 applications do not require any extra libraries but are very low level (ie You write a lot of code yourself). I found this website very useful. You can find others by searching up "win32 tutorial". You will need to include "windows.h" and possibly "windowsx.h" for this.
Two main competing APIs (Application Programming Interfaces) are DirectX and OpenGL. You can search them up as they are widely used for graphics and you should get some good resources and tutorials. These two will may need extra libraries which you can get from the internet (just search it). For DirectX the headers, it will vary on which version of DirectX you use and OpenGL will require "gl/gl.h" and possibly others depending on what you want to do.