FreeRTOS - Creating Project MinGW or MSVC, undefined reference to "xTaskCreate" - visual-c++

I'm newbie with FreeRTOS and i'm trying to compile a simply example application.
If i open the demo application with Microsoft Visual Studio, it works greatly, but once i remove all .c leave only main.c with some simply instatements like xTaskCreate(), cause this errors:
undefined reference to: xTaskCreate();
I've tried also to create a new project with include all header, but the result it's the same.
Toolchain tried: Codeblock and Eclipse Luna with MinGW header and Microsoft Visual Studio with header MSVC
I've seen that in the source file, there aren't .lib or .dll but only .h.
Thanks in advance :)

This was the solution posted on the FreeRTOS support forum:
"Don't delete any files from the "FreeRTOS Source" directory in the MSVC
project. They implement the FreeRTOS kernel, so without them your
application will not link."

Related

Does Android Studio support Code completion for C/C++?

The code completion is fine on Android Studio java project. But I want to use Android Studio to edit some existing C file(.cpp).
for example, if i have declared some function, then i type the function in other section. But the android studio doesn't show up the code suggestion or some debugging.
Can Android Studio support Code completion for C/C++ like this:?
Yes it does, as long as the project is setup to use the NDK and the C/CPP sources are included in the project.
Try pulling the ndk sample repo and try opening one of the projects.
If you have a java project and want to edit some arbitrary C or C++ source, then no. It does not have enough information about the source file, include paths, compiler etc...
If your project uses Android.mk to build, it will be a bug of Android Studio. I have been reported.
Android.mk project cannot show code completion for cpp.
It seems that old version of Android Studio does not support code completion of jni native build (with Android.mk as configuration file), and that should already be fixed now.
But if you are using CMake in your project as external building tool and code completion still does not work, It's probably because you have more than one version of cmake installed. You can try to remove extra ones from SDK manager and restart Android Studio, it should work.
To see installed CMake version, you can open the SDK manager and check the 'show package details' on the right bottom. You can view cmake tools installed with different versions.

Makefiles for Microsoft Visual C++

I have few queries regarding makefiles for MSVC. I want to create makefiles which will compile my project on Visual C++ compiler. One thing I found in the web named "nmake" which is said to be the makefiles for MSVC(correct me if I am wrong).
So, I introduced myself with nmake and compiled a single source file successfully with this. But the issue is, I need to run this nmake file using command prompt of visual studio. I haven't found a way to use the file in normal command prompt. Is it really possible?
Suppose, I don't have a visual studio installed. I have only the visual C++ compiler. Then how I will be able to compile my projects using nmake?
One Additional question, if I have only visual C++ compiler installed(like the old compilers eg. microsoft visual C++ 2005), then is it certain that I will get nmake command on this?
Thanks in advance.
Solved! Answering myself, so that if anyone intend to compile makefiles using nmake for Visual C++ compiler.
Yes, it is compiles in older version of visual C++ also. I have tested and it works fine. But it may cause problems when some properties are use of latest visual C++ compiler. Because you will not find those properties in older version of C++ compiler. Otherwise it is quite OK.

How to link to a .so library in Visual Studio?

What I am trying to do is to link my project to a .so library that I have. Is it enough to add it in the Project Properties -> Linker, as I am doing with every static library (.lib), or is it another way to do it??
My project is an Win32 Console C++ Application.
You can't use Visual Studio to link to a .so file, because that's a Unix kind of shared library (and it will also be compiled for some Unix operating system). Visual Studio can only link for the Windows operating system. In this case, recompile your library to a windows .dll file.
http://en.wikipedia.org/wiki/Library_(computing)#File_naming

Use Clang with MSVC 2010

First of all, I want to ask if Clang compiler is better than MSVC's default compiler? And how can I use Clang with MSVC? For example, I write code in MSVC then when I hit Build, it call Clang to build the project.
https://github.com/ishani/ClangVSx
AddIn for Visual Studio 2010 that allows use of the Clang C/C++ compiler in place of MSVC++. Translates VC project and build settings into gcc-friendly command line arguments, along with existing platform tools (MSVC Linker, Librarian, RC) to complete the build chain.
Using clang compiler on Windows is still considered to be in experimental state. However, some progress has been made recently. As I answered similar question:
LLVM provides Windows snapshot builds - a clang toolset for Visual Studio as Windows installer. Currently it should integrate with Visual Studio 2010, 2012 and 2013. More information can be found on LLVM's blog post A path forward for an LLVM toolchain on Windows.
You can use a "makefile project" to have Visual Studio invoke a makefile (or any command-line process) when you tell it to build.
I've done this before to get MSVC's nice source navigation for non-Windows embedded projects.
The drawback is that you have to manually keep the makefile in sync with the files in the project (or vice-versa depending on how you want to look at it) - generally not a huge problem.

porting MSVS proj files to makefiles?

Does anyone know if/how to automatically generate makefiles from a .sln/.vcproj files of a C++ application in MSVS to be used to compile and build this application on Linux ?
Thanks, --Yariv
You can create a makefile from within Visual Studio. It's not exactly the same thing as in Linux, but the numner of required modifications is not too big.
MSDN: Creating a Makefile Project

Resources