I'm using GVim on Windows 7 and trying to compile and run my code right in Vim(just like in visual studio).
I've installed minGW, and correctly set the Environment Variable of Windows.
Look at the image below, when i click the shovel, whose function is to "make current project", error message appear(in lower part of screen).
How to fix this~~ thanks^^
Try vim-quickrun plugin.
Write C++ code in the buffer (it should have cpp filetype), and try
:QuickRun
I use vim-quickrun always. I add following in my .vimrc.
silent! nnoremap <unique> <silent> <leader>r :<c-u>QuickRun<cr>
Related
I tried to compile on windows c program with tenserflow c api and tenserflow.dll from https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-1.12.0.zip founded on https://www.tensorflow.org/install/lang_c.
This example:
#include <stdio.h>
#include <tensorflow/c/c_api.h>
int main() {
printf("Hello from TensorFlow C library version %s\n", TF_Version());
return 0;
}
Compiling is success, but when i have run it, i recieved a mistake that libtenserflow.so not found. Its look like that tensorfow,dll from https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-cpu-windows-x86_64-1.12.0.zip was builded with some mistakes for windows sistem, becaurse libtensorflow.so is a target for Linux.
Can you explain or fix this?
I guess it looks for tensorflow.so because you were using GCC tools on VS Code's WSL mode (or other IDEs). But in order to load DLL you need to have Visual Studio.
Here's a simple process to run the Tensorflow for C demo:
Create a new project in Visual Studio;
Configure the project properties(assume the Tensorflow path is C:\tensorflow\; replace it with yours):
C/C++ > General > Additional Include Directories, add "C:\tensorflow\include\"
Debugging > Environment, add "PATH=C:\tensorflow\lib\;%PATH%"
Don't forget the "PATH=" before your tensorflow.dll path.
Compile and run.
You may also add the Tensorflow path to system environment (replace C:\tensorflow\ with your path):
SET PATH=%PATH%;C:\tensorflow\lib\
P.S. If you don't like the Visual Studio IDE and prefer to use Tensorflow with command line mode, try Bazel for Windows instead.
I am trying to learn C programming. And I am using VS Code for running almost everything.
But none of my C Codes execute. The c_cpp_properties.json is configured with the MinGW header files library path included in the "msvc-x64" section. It says "cannot open source file "vcruntime_string.h" (dependency of "string.h")" all the time.
First of all, it's weird that it is not letting you compile by not finding string.h dependency. I suggest to try the following:
Try compiling your files either with gcc or g++ (depending on the language you're using) directly from the terminal, to see if you get the "a.out" file.
Ex: Open your terminal. Find your .c files (if you're programming in C) gcc *.c then ./a.out
Try using CodeBlocks, Build and Run to see if you get the same error.
If 1 or 2 worked, it means your VS software didn't like something when you made the installation process. Reinstall VS.
I had the same problem.
I solved it just by reloading the window.
You can either press Ctrl + R or type "Developer: Reload Window" in the command palette.
You can open the command palette either by pressing Ctrl + Shift + P or going to "View"(up left corner) then "Command Palette..."
I have switched to Linux Mint from Windows 7 and now I am using Geany to write C programs in it.
As I mentioned in the question that I want to execute my program line by line in Geany. During execution is there a way where I can see the value of variables in Geany?.
I am using Geany because it's light weight and it has an integrated terminal, compiler, scribble, etc. which is very simple to use...
Install Geany Debugger Plugin and then you can easily execute your program line by line.
Step 1:
Install Optional Add Ons:
Graphical GDB Front end for geany
set of plugins for geany
from Ubuntu Software centre or anything you have which do similar job
2.Step 2:
Go to Main Menu > Tools > Plugin Manager
3.Step 3:
Set Debugger to active by ticking the checkbox and then click O.K.
Now, you may see Debug option at the bottom of geany:
4.Step 4:
Now, I think rest of the debugging is easy - just select the file and load it in the debugger and there you'll have all the options including breakpoints and executing line by line.
Note:
Don't forget that now you have got debug terminal, you can straight away use any of the gdb's (I am thinking you have GDB debugger) commmands. By the way, don't forget to check out the reference links for complete detail (especially the 2nd and 5th).
Reference:
1. http://plugins.geany.org/debugger.html
2. http://ubuntuforums.org/showthread.php?t=1400668
3. http://betterexplained.com/articles/debugging-with-gdb/
4. Line by line c - c++ code debugging in Linux ubuntu
5. http://www.yolinux.com/TUTORIALS/GDB-Commands.html
This is my first time of trying to develop with C programming language. I tried installing codeblock on my window 8 operating system, but whenever I run the codeblock program I get this error in the image below
I installed codeblock hopping that it would install the compiler alongside, but I was disappointed. I do not know how to install the standalone compiler, I checked it up online, but I really do not know from where to start, and I do not know if the problem is with my system. I would appreciate help on how to make my codeblock work properly or any other suggestions. Thanks all.
When running CB for the first time, you are prompted with a "Compiler auto-detection" dialog/window.
It looks like you chose the WRONG COMPILER -> GCC for MSP430 micro controller!
Correct that to GCC/MinGW
EDIT - 1: Its usually the first option on the "Compiler auto-detection" dialog
EDIT - 2
I think you may also have selected the wrong compiler for your CB project
For C project, Follow these steps:-
Create a new project -> Console application for C/C++,
Skip the first page, click next
Provide a title & path, click next
at compiler selection screen, select "GNU GCC Compiler" instead of "GNU GCC Compiler for MSP430"
The compiler might not be included in the Code::Blocks you downloaded (if you got codeblocks-12.11-setup.exe). There's another downloadable binary (codeblocks-12.11mingw-setup.exe) that includes the MinGW environment with the GNU GCC compiler. You might want to try that one.
Step-1 : Visit www.mingw.org/
Step-2 : Download and install all package.(Specially mark the the file starting from mingw)
Step-3 : Goto to installation and Apply Changes.
Step-4 : Now open your code block
Step-5 : Goto to Setting->Compiler
Step-6 : Now click toolchain executable AND SELECT GNU GCC COMPILER
Step-7: Click autodetect and then OK
I hope this will definitely work out, All the best
Just goto setting > compiler and click on "restore default" . Then yes and ok .Done . I think it will never occur the error.
I have looked through both the CodeBlocks and MinGW FAQ and wiki to no avail. As stated above I am a noob.
I want CodeBlocks to act like a Unix compiler in that it overwrites a single output file every time it compiles unless told to do otherwise.
In Unix:
[cc example.c] -> [a.out], [cc example2.c] -> [a.out]. If I want to save the output file from being overwritten i just [cc -o newname example3.c] - [newname.out].
If this is possible with CodeBlocks/MinGW on XP I'd like to know how to do it. If not I would appreciate recommendations for another GUI compiler/IDE that could. Any help is appreciated. Thank you.
I want CodeBlocks to act like a Unix
compiler in that it overwrites..
First of all, C::B isn't a compiler -- it's an IDE. Saying you want C::B to act like a compiler makes no more sense then saying you want vim, emacs, or visual studio to 'act' like a compiler.
Second, you change the name of the final executable by right-clicking a project in your workspace. Goto properties->Build targets tab->select which build target you want to change. On the right side of this you'll see Output filename. Enter the executable filename the linker should output here. Alternatively, you can just navigate to the location of your existing executable and just rename it to something else.
And thirdly, chances are you're not even going to be checking back on this site so I'm probably just wasting my time giving an answer to your post.