I am currently have an issue of binding c library. I am following the introduction from this link to bind C library in Xamarin project: https://www.youtube.com/watch?v=ZUoPLcmnf1o (It is a Xamarin Unversity Turtorial regarding binding c/c++ library, I literally did the same thing except those caused by environment differences ). However, I am stuck at the last step: using functions from the c library in the Xamarin project, it always shows "Native linking failed, undefined symbol *". I have tried to solve it for around 2 days, but did not go any further, may I ask for your help? Thank you very much in advance.
Environment: iOS: macOS High Sierra, xcode: 10.1, SDK: 12.1, IDE: Visual Studio for Mac
Does anyone has followed the same tutorial before and know how to do it? I am totally stuck on this. Any suggestion welcome.
This is an overview of the approach which also refers to this step-by-step guide will give an idea of how to prepare the binding for c/cpp. The is also a video with a quick demo.
Related
I'm sure this is documented somewhere but I'm struggling to find what I'm after. I am developing a project in C (and explicitly not C++), and having had good experiences developing Java projects with JUnit for TDD, I'd like to take a similar approach for this new project.
Can anyone provide a walkthrough for creating and running a simple C project, and running a couple of unit tests on them within Eclipse CDT? I have Eclipse CDT (Luna) and the unit-testing plugin as described in the frequently referenced blog. Most of the guidance appears to be for C++.
FWIW I'm running on Windows 7 and compiling with MinGW GCC.
Have you given google test a try? Its technically a c++ library, but has very little overhead to test your functions. A c++ test project would easily be able to consume the library generated from your c code, so should be pretty easy.
For example, this is what a test would look like
#include "gtest/gtest.h"
#include "MyProject/myFunc.h
TEST (myFuncTest, calculate) {
EXPECT_EQ (18.0, myFunc_calculate (324.0));
}
You can find more details at IBM Developerworks on YouTube etc.
After a lot of research, I tried most of the libraries for C and C++ testing and the one that was the right one for me was the Acutest.
I have created a public repository with an example that also uses Github Actions and a makefile in order to accomplish Continuous Integration (CI) by compiling the code and the tests and running them on every push automaticly.
Repository Link : CPP_Unit_Testing
I want to get a clarification that this plug-in only works for C++ and won't work for C. I tried to run with C code in the src directory and it doesnt return anything unlike the C++ projects.
Anyway for me to run C code for free (Community versions), my cppcheck
The c++ community plugin will by default import any c files found under project dir, the parsing will be done using a compatibility mode (so it might not be complete). Default properties and values for this to work are:
sonar.cxx.cFilesPatterns - .c,.C
sonar.cxx.suffixes.sources - .cxx,.cpp,.cc,.c
sonar.cxx.suffixes.headers - .hxx,.hpp,.hh,.h
See details in documentation wiki
Not sure that you'll get an answer to this question on StackOverflow. I would ask this question by directly creating an issue on the relating github project : https://github.com/wenns/sonar-cxx
I'm trying to learn Cuda and its very interesting but I'm having problems creating code without a bit of help from an IDE. I know Java/Python but I'm unfamiliar with C/C++ so I have been using eclipse and Xcode to help me with commands and finding things(via code code completion). I can't seem to get these options for CUDA?
I have seen examples and can build them find(nvcc is working) but without the IDE to help catch some of my mistakes I'm a bit lost editing the code in just a text editor. I found a toolkit plugin for eclipse but although it seems to install I think its for a older build of eclipse because most of the options in the instructions do not match my version(Indigo). Nvidia has a plugin for Visual studio only on their site(I'd rather not install windows on my mac to use Cuda).
I'm sorry if this sounds bad but I'm curious to how people are developing cuda on Mac's. I don't care what IDE I use as long as it helps me see the options and warn me if I have syntax issues,etc..(I'm not the best programmer but switching IDE's for me has just been a matter of finding out where things are so I'm really fine with any solution as long as it helps me as I'm learning).
Nsight Eclipse Edition is available as a part of the CUDA Toolkit 5.0 (no additional download required).
Qt Creator!
You can read Qt Creator + CUDA + Linux for inspiration on how to setup the build environment on Mac OS X.
You could think about using JCuda:
http://www.jcuda.de/
There is XCode plug-in for CUDA development. I found it there. There is the main discussion on nvidia.com
Visual Studio Code + this extension:
https://github.com/gangliao/VS-Code-Cuda.
For me, Visual Studio Code is my favorite IDE for every language I found out there
Hi I am a beginner in C programming and I have made a C program that automatically logins into a website using socket programming, particularly made for UNIX systems. I am now interested in bringing this program into "life" in windows application form, so that it would be much easier to use. But I am clueless on where to start because I have never programmed in Windows before. A simple guide to what steps I should take would be very much appreciated. Thank You.
Get yourself a Windows installation and install an express version of the C++ IDE. In there you can create Win32 API applications from which you could start to build your app. You will need to use the Win32 API to build your form. This API is fairly well documented on the internet. Here is a website with some tutorials on it.
Hope this helps.
You could use a library for that. For example i like Qt but it tends to be large but it is multiplatform. You could also use Win32++ for that. But it requires some reading since it is very close to the windows api (WinAPI).
Just for completeness there is also ATL, WTL, MFC, GTK (multiplatform), wxWidgets and some others i don't recall.
I'd like to embed Mozilla's SpiderMonkey in one of my C apps. On linux, I don't think it'll be a problem (I'm a linux user) but I must confess that I'm afraid that I have no clue on how to do it on windows using MINGW (I want the app to be portable)
Is it possible to, say, just use the dll that comes with firefox? (I, honnestly, don't even know how to use dlls with MINGW)
Do you have any tips, hints, tutorials on how to build (or just embed spidermonkey) on windows using MINGW (I refuse to use Visual Studio :) )
Or do you have an alternative solution other than SpiderMonkey that's easy to use, and can do some basic javascript stuff (I don't need DOM for eg.) ?
Thanks a LOT!
As far as I know Mozilla build it's software on Windows using MSVC.
https://developer.mozilla.org/En/Developer_Guide/Build_Instructions/Windows_Prerequisites
You may be on your own if building with Mingw32 is a must.