I have setup eclipse as per this tutorial:
https://www.youtube.com/watch?v=KfKvDIrabUw
I have intalled java and GCC on my windows 10 laptop. It cannot build my c project, because I get the error "fatal error: stdio.h -std=gnu99: No such file or directory".
I assume this file exists on my computer somewhere, if not by default then with thte GCC that I downloaded and installed. I just need to find, in the hundreds of option menus, the place where I locate the directory. Maybe I'm blind but I can't find it, and if I do, where to I link it to? (Getting a little frustrated if you couldn't tell...)
Many many thanks,
Andy.
I solved it. If anyone else is experiencing this problem, open up the project explorer, right click on your project and open up the properties. Make sure Text file encoding and New text file line delimiter are both set to UTF-8.
It is now working.
Related
I am trying to run the
https://code.qt.io/cgit/qt/qtbase.git/tree/examples/opengl/cube?h=5.13
example. It builds fine, starts up, then gives the message
QOpenGLShader: Unable to open file ":/vshader.glsl"
QOpenGLShader: Unable to open file ":/fshader.glsl"
QOpenGLTexture::setData() tried to set a null image
The files are there, the .qrc file found (I think from the message),
What can be the problem? (the error message is not helpful in locating he reason) The files are there, readable (by the other applications),
already moved all files in the same subdirectory.
I just tried to run the example on Qt5.13 windows 10 MSVC2017 64 bit without a problem so there must be something else going on here.
the same example is already installed in Your Qt installation directory. Can you try it from there? Should work.
Do you have Read write rights? Are all files in the same folder as the pro file?
Can you open the qrc file in Qt Creator and see if you have missing links?
I started using VS Code, and after messing around with it I kind of managed to make it detect Windows and Direct3D SDK's with the c_cpp_properties.json, but I'm failing to make the Standard Library work. So, if I do:
#include <string>
#include <vector>
It throws me an error just like this:
//Include file not found in include path
I've searched all over the web and didn't find any clue, so here I am! Strangely enough, if I just create a new .cpp file in an empty window/editor, it works. But the moment I 'load' the folder that file is in, then it fails. So, this is really driving me crazy.
I'm using Windows 10, with .NET 4.6.2, the 2015 Visual C++ Redist, and the Windows 10 SDK, all blazing new installs from today. My ultimate goal is to port a project I made in VS2013 to GNU/Linux, so I'm trying to make things work step by step.
Thanks a lot beforehand!
EDIT: Compiling with g++ works just fine, even though VS Code complains. This is what happens.
VS Code need to locate the include libraries.
First of all locate where g++ is located. You mentioned that it works fine. It's an .exe file (windows). So you may find g++ directory in path settings. view path variables.
Now after getting g++.exe directory you may easily find a file names string in nearby folders or parent folders. After successfully locating it copy its full path.
Now back in VS Code put cursor over green underline and you should see a bulb. Click it and in the options you will see option Edit "includePath" setting or Update "browse.path" setting. Select it and a file will open named c_cpp_properties.json
Now in that file locate "name": "win32". In the include path option paste the directory name of string file like this and you are good to go.
In vscode go to file>preferences>settings then select edit in settings.json (This can be hard to find, certain settings have this option by them, others do not. There is probably a better way to access this file, but I don't know it)
This will open up the settings.json file, where you can add the line:
"C_Cpp.default.includePath": ["C:\\Program Files (x86)\\Microsoft Visual Studio 14.0\\VC\\include"]
(or whatever your include path is) This will add that include path for all projects, or only the current workspace depending on if you open the settings.json file for "User Settings" or for "Workspace Settings"
I tried to run C++ in Eclipse Mars but it failed. It is showing "Launch failed. Binary not found" .It is also showing another fatal error "sdkddkver.h: No such file or directory". I pasted a snapshot so that you can see these. I have installed MinGw and added the "C:/MinGW/bin" to windows path. The MinGW packages which are added, can be seen in the left on the snapshot. Appreciate any help. I have seen, lot of similar posts, but nothing helped.
I further explored the process mentioned by ali. I clicked Project -> Build Project. And I got following error message, which came before also. I fear this may due to this missing file "sdkddkver.h". Related to this missing file "sdkddkver.h" I saw lot of earlier posts also, but not pertaining to this specific problem. Does anybody know about this file? How to get this and will that solve the problem or not.
You must build an object file before you can compile it. So if you don't “BUILD” your file, then it will not be able to link and load that object file, and hence it does not have the required binary numbers to execute.
So basically right click on the Project -> Build Project -> Run As Local C/C++ Application should do the trick
I'm trying to use the cpu of bochs in my graduate course project. I want to create a project of it in eclipse so I can modify it and compile it and also see the errors ...
I have the source code and I use visual studio's nmake to build, compile it. but the problem is that it doesn't report me the errors and the only way to know the error happens or not is to wait until nmake ends and see if the .exe file is created or not. after that the process of finding errors is a bad headache.
so I'm trying to use ubuntu OS and use eclipse. anyone knows how to create a project for bochs in this?
Also the more important thing is a tutorial that I can learn bochs cpu codes. because the official site's tutorial has no use.
haha,
I found it myself.
just go to bochs official site and download the source code for linux.
extract the zip file somewhere.
open a terminal and go to the extracted folder.
type:
./configure
this will check your system and set the values for the #define arguments in a file called makefile.
now open eclipse.(I assume that you have the c/c++ CDT). FILE>NEW PROJECT
In the opened dialogue open c/c++ tree, and select "Makefile project with existing code" and click next. next put a name for your project and in the "existing code location" browse the extracted folder. next select CROSS GCC as toolchain. then click finish.
there you go. now build the project and it should work.
remember that for running project you must give bochs command line arguments which is available in eclipse and you can find out how with a search in forums.
So I'm pretty new to Qt, and I've just inherited a project from someone else who is also new to Qt. He isn't around this week btw. We are using Visual Studio 2008, and have the latest version of Qt installed(4.6.2).
The project builds on my coworker's machine fine, and I can get the project from svn and build it directly. But under any other circumstances it refuses to build on my machine, and it doesn't give me much of an explanation why. Even if I just do a 'build clean' and then a 'build' it doesn't work. Any slight modification will make it fail.
When I try to build the entire project I get the error message:
1>Moc'ing MatrixTypeInterface.h...
1>moc: Cannot create
.\GeneratedFiles\Debug\moc_MatrixTypeInterface.cpp;.\GeneratedFiles\Debug\moc_matrixtypeinterface.cpp
1>Project : error PRJ0019: A tool
returned an error code from "Moc'ing
MatrixTypeInterface.h..."
The moc tool doesn't give any sort of error message as to why it isn't working, and I wasted most of yesterday trying to figure out why. I got the command that VS was using to call moc, and I entered in the command line myself. It didn't write anything to the screen.
Any ideas?
I finally found the answer. my coworker was back in the office today, and I used the build log off his machine to get his full moc command(about 4 lines long). Our moc commands were basically the same except at the very end. His command ended in:
-o ".\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp"
My command ended with:
-o ".\GeneratedFiles\$(ConfigurationName)\moc_$(InputName).cpp;.\GeneratedFiles\Debug\moc_matrixtypeinterface.cpp"
I checked the custom build step for that file, and removed the excess bit. After that the file compiled fine. I don't know how or why qt decided to add in this extra tidbit, but it did.
Thanks for your help guys. A couple of you suspected that it was a filesystem issue, and indeed a semicolon is not allowed in a windows filename. But I feel the root cause was Qt creating the wrong build string.
I'm accepting my own answer in the hope that it will help someone else.
It's most likely a filesystem error, you probably don't have a "GeneratedFiles" folder or don't have the correct permissions on it.
I have had issues where different versions of the moc and the add-in use "Generated" or "Generated Files" or "GeneratedFiles" for the folder. Check the settings on all the build steps.
Its possible that your .vcproj file is corrupted. I've had this issue before which resulted from having different versions of Qt and the Qt VS add-on ended up corrupting my .vcproj files. For a while, I had to manually fix the .vcproj file (My AdditionalDependencies="..." line was being swapped around and cut off for various header files that needed to be mocced, I was manually fixing these for every new header that needed to be mocced).
A clean reinstall of Visual Studios + Qt + Qt add-on ended up fixing this. Check your .vcproj file and see if its making sense.
Are you sure your file paths are correct and existing before moc runs? Since it appears that relative paths are provided to moc, I'd find out what moc's working directory is when it runs.
How was your .vcproj file generated? Was qmake used? Or cmake? Or was it by scratch?