Using SDCC in Visual Studio 2010? - c

Is there a way to use the Visual Studio 2010 IDE with the Small Device C Compiler (SDCC)? I would like to compile using SDCC within Visual Studio.

If you want to go this route then you are going to have to figure a lot of things out for yourself. Here is how I would start:
Write a Makefile that builds your project with SDCC when you type "make", and cleans your project when you type "make clean", and rebuilds your project when you type "make clean all".
Do File -> New Project and select "Makefile project". Set the build, clean, and rebuild commands to the commands I said above.
You might have to move the .sln and .vcxproj files to the directory with your Makefile and source code so Visual Studio can find it.
At this point you should be able to build your project from inside Visual Studio.
Unfortunately, it looks like Visual Studio does not understand the format of the error messages produced by SDCC, so either you would have to reconfigure Visual Studio or recompile SDCC if you want that to work. I will leave that as an exercise for you.
I expect that Visual Studio will also trip over a lot of the SDCC keywords that it does not understand, such as "__code" so you might have to do something like this to hide those keywords from Visual Studio:
#ifndef SDCC
#define __code
#endif
Overall, I expect you to have a lot of trouble.
If you'd like to see some instructions for using SDCC with Eclipse instead, see the Wixel User's Guide.

Related

how to use install library in c++ in visual studio code?

I want to use a library with c++ in visual studio code with in Mac. I installed scip and VScode but I can't use it.
when I run
1 error generated.
The terminal process terminated with exit code: 1
I am not familiar with c but I know how to use scip's function. So I need to compile scip in c. any help ?
I installed scip in download file. and I have c/c++ Microsoft for visual studio code
You are mixing up a few things here. Visual Studio Code cannot compile code - it's more like a fancy editor. You are probably referring to Microsoft Visual Studio 2017 or 2019. This is a fully-featured IDE that also comes with a C/C++ compiler.
To compile SCIP, I strongly recommend CMake. There are detailed instructions on how to do this in the SCIP docs.
Also keep in mind, that installation of SCIP is different from compiling it yourself. You need the sources and probably your self-built librarires/binaries to link SCIP to your own custom code. If you only want to use SCIP, then it's sufficient to run the installer and start it - no compilation whatsoever is necessary.

GTK Linker Issue Visual Studio C Project

it is the third day that I am trying to set up the visual studio 2013 with the GTK libraries. I need to use VS: I've used GCC (both command line and with code blocks) in the past (both on windows and slackware linux too..), but now I have a lot of projects in VS and I want to start making some GUI for them. After seeing that the so called "all-in-one-bundle" is not more available/maintained in the GTK website, I followed a bunch of tutorials (including GTK+ 3.0 setup in Visual Studio 2013, How to configure gtk on Visual studio 2010, How do you install GTK+ 3.0 on Windows?) and I started to install MSYS2 according to this one: https://blogs.gnome.org/nacho/2014/08/01/how-to-build-your-gtk-application-on-windows/.
Maybe the problem is here: I followed this step properly pacman -S mingw-w64-x86_64-toolchain, but I skipped the creation of PKGBUILD file and successive installation due to the fact that I did not understand the procedure. Furthermore the mingw toolchaing seemed to be already installed.
Sorry for the big introduction, I wanted to be specific.
The problem is at the linking-stage of Visual Studio C Project building. I had also some problem at compilation involving the different inline interpretation of VS (added #define inline __inline // Necessary to make the GTK library Visual Studio compatible definition before calling the GTK header). The linking stage issue consist in the fact that, using pkg-config --libs gtk+-3.0 --msvc-syntax command, I receive a list of files (/libpath:C:/msys64/mingw64/lib gtk-3.lib gdk-3.lib gdi32.lib imm32.lib shell32.lib ole32.lib -Wl,-luuid winmm.lib dwmapi.lib z.lib pangowin32-1.0.lib pangocairo-1.0.lib pango-1.0.lib atk-1.0.lib cairo-gobject.lib cairo.lib gdk_pixbuf-2.0.lib gio-2.0.lib gobject-2.0.lib glib-2.0.lib intl.lib) that does not exists in the msys2 directory. As a consequence I receive this error from the linker: error LNK1104: cannot open file 'gtk-3.lib'.
Someone has the same problem (see Error 3 error LNK1104: cannot open file 'gtk-3.lib'), but the solution is to use the all-in-one-bundle.
What shall I do? Have I followed the correct procedure or am I missing something? I've also tried to link to VS the *.a files located in the lib directory of mingw63 (e.g. libgtk-3.dll.a), but the linker error remains.
Best Regards and thank you for the attention
Davide

Can ARM desktop programs be built using visual studio 2012?

I was working with visual studio 2012 beta and my desktop (win32) program compiled fine in ARM architecture.
After upgrading to visual studio 2012 RC, the compiler would not work and spews out the following error:
"Compiling Desktop applications for the ARM platform is not supported"
I found a forum post on this
http://connect.microsoft.com/VisualStudio/feedback/details/745580/arm-configuration-doesnt-work
Is it correct that Microsoft is really cutting off win32 development on ARM?
And that compiling in VS2012 beta was just a fluke?
You can edit the file:
C:\Program Files (x86)\MSBuild\Microsoft.Cpp\v4.0\V110\Platforms\ARM\Microsoft.Cpp.ARM.Common.props
In the <PropertyGroup> section add the line:
<WindowsSDKDesktopARMSupport>true</WindowsSDKDesktopARMSupport>
before </PropertyGroup>
And that's all, you can build ARM desktop apps with VS2012.
I was able to get around that error and compile a little "hello world" cpp file for ARM by adding the "/D _ARM_WINAPI_PARTITION_DESKTOP_SDK_AVAILABLE" command-line argument to the ARM version of cl at C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_arm. I found that #define from sn0w's answer on this question in the crtdefs.h file, without having to modify that file. Now, I can't guarantee that anything more complex will actually work, or that Microsoft hasn't instituted some sort of whitelisting or digital signature verification for Windows RT desktop apps, so even though it may compile, it may not be allowed to run when Windows RT is finally available.
Note that before you can run the ARM version of cl.exe from the command line, you must set the environment variables using this batch file: "C:\Program Files (x86)\Microsoft Visual Studio 11.0\VC\bin\x86_arm\vcvarsx86_arm.bat"
Even if you compile the app, you won't be able to run it on Windows 8 RT as unsigned apps will not start.
I just tested this, and unfortunately it is the case.
You receive the following message:
Windows cannot verify the digital signature of this file
I imagine there is probably a work around for this, but it will never be officially supported.
yes of course. i practised with VS2012 RC.
now i'll explain how to avoid "Compiling Desktop applications for the ARM platform is not supported" and build win32 application.
1st way: fix build tools - the goal is to patch (or try to substitute it with beta's one) MSBuild's lib: Microsoft.Build.CPPTasks.Common.v110.dll
2nd way: run the "VS2012 ARM Cross Tools Command Prompt" from Visual Studio Tools start menu, then execute cl [cl params] myfile1.cpp myfile2.cpp myres.res ... /link [linkparams]
for both this cases you also need to commentout an #error directive in crtdefs.h on line 332. (Microsoft Visual Studio 11.0\VC\include)

Opening an Existing MakeFile Project in VS2010 or VS 2008 for debugging

I am exploring the code of an open source project..The project has its own directory structure and has several makefiles for building it on different platforms. I am working on the windows and want to pull it's source code in Visual Studio 2008 or 2010 by making visual studio project..I am able to build the project with Nmake utility of visual studio but I don't know how to debug if I don't have any .vcproj files or solution.
So can someone has some link or provide me some guidance about how can one make a visual studio project from make file. For more information the project I am trying to build is webP api project..
http://code.google.com/speed/webp/docs/api.html
To anwser your embedded question rather than your headline question - you can debug the output of the NMake process simply by invoking 'devenv' and passing it the the executable as an argument. I typically do this in the output directory of the build process so that devenv can find related DLLs and PDB files with debugging information.
My devenv (on a 32-bit VS2010 system) lives in "c:\Program Files\Microsoft Visual Studio 10.0\Common7\IDE\devenv.com"
Hopefully this can get you debugging!

How to configure visual studio 2010 with opencv cvblobs library

I'm having difficulty of installation/ compilation of cvBlob into OpenCV Microsoft Visual Studio 2010 in WINDOW. I understood that there is a installation guide work on linux but I couldn't find how it can be done in Window.
I would appreciate if someone may provide me the installation guide in WINDOW as I found that cvBlob is very useful for my project.Thanks
For the moment there is no pre-built cvBlob for Visual Studio, so you are going to have to compile it yourself.
So before you start, make sure you have OpenCV installed in your computer.
Download CMake for Windows. CMake creates the Visual Studio project files that are needed to compile cvBlob.
Once you open cmake-gui, fill in the edit boxes "Where is the source code" and "Where to build the binaries" accordingly (adjust these to your settings):
C:/Documents and Settings/user/Meus documentos/Downloads/cvblob-0.10.3-src/cvblob
C:/Documents and Settings/user/Meus documentos/Downloads/cvblob-0.10.3-src/cvblob/build
Note: the build folder was created manually.
Click on button Configure to check for dependencies (CMake will try to find OpenCV on your computer) and then on Generate so it can generate the Visual Studio project files.
From here on it's the standard compilation procedures.
karlphillip's answer is correct, and you should follow it. Be advised, however, that if you're building the files using VS 2010, a few of them will fail and return this error:
LINK : fatal error LNK1104: cannot open file '..\lib\Debug\cvblob.lib'
To get around this, add the following to your cvblob.h file:
#define EXPORT __declspec (dllexport)
In the extern "C" block below that, add EXPORT before every function. For example:
EXPORT double cvContourPolygonArea(CvContourPolygon const *p);
After running into this error myself, I found the explanation here (which I adapted to make this post; all credit belongs to this link's author): https://code.google.com/p/cvblob/issues/detail?id=34
Just something you might want to watch out for. Hope it helps!

Resources