Visual Studio 2013 Professional linker errors [closed] - c++

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I really want to use Visual Studio Professional's debugger to take a look at a segmentation fault I encountered in my program. However, the IDE would not compile even a simple program such as this:
// test_aug.cpp : Defines the entry point for the console application.
//
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
cout << "Test" ;
return 0;
}
It keeps throwing the error "error LNK1104: cannot open file 'gdi32.lib'.
The thing is I don't want to fix this one linking error just to keep getting more for different libraries (I have also seen it for different libraries).
Can someone please tell me how to fix this error in general so I will not encounter it anymore, and can move on to ACTUALLY DEBUGGING.

If the linker cannot find that library check for its existence and/or set the path to find it into additional library directories.
The linking phase won't go on without solving that error first.
Other two thoughts:
gd123.lib sounds wrong, I believe you wanted to use gdi32.lib. Make sure the name is right
make sure that is included into the Windows SDK (express editions don't include it)

Related

Undefined reference when using "Hello world" of Irrlicht library [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 3 years ago.
Improve this question
I'm trying to compile the very first code given by Irrlicht library website.
As said in the title, I get an undefined reference. I'm using 8.2 netbeans IDE.
This is what I've done so far :
Installed Irrlicht library from the Linux repository (I'm using Ubuntu 18.04).
Using these command lines : sudo apt-get install libirrlicht1.8 libirrlicht1.8-dbg libirrlicht-dev libirrlicht-doc
In the "project properties", I've added the include directory, as well as the include headers (e.g all the files contained in /usr/include/irrlicht. Also, in the "Additional Options" (the linker part, I guess ?) , I've seen online that I should add -lIrrlicht command line, and it still got me the undefined reference.
I've tried also the following command line : -L /usr/include/irrlicht -lIrrlicht, still got me the undefined reference.
I know that the compiler finds the library, as it does not make a compilation error saying that it doesn't know "irrlicht.h", so the problem is coming from the linker. What command line does the linker expects ?
Note : I'm not able to make any update. Talking about irrlicht, it seems that I have 363 packages outdated. Could the problem be from there ?
Edit : Here is the minimum code, as requested. There is no point showing it, as the error comes from the linker command line :
#include <cstdlib>
#include <iostream>
#include <irrlicht.h>
using namespace std;
using namespace irr;
using namespace core;
int main(int argc, char** argv) {
IrrlichtDevice *device=createDevice(video::EDT_SOFTWARE,dimension2d<u32>(640,480),16,false,false,false,0);
return 0;
}
I had a similar problem with another library. I fixed it by changing the path in the linker?
according to https://de.wikibooks.org/wiki/Irrlicht_-_from_Noob_to_Pro:_C%2B%2B_f%C3%BCr_Irrlicht_einrichten
you have to link lIrrlicht like:
LIBS += -L/.../Irrlicht/irrlicht-1.7.1/lib/Linux
LIBS += -lIrrlicht
instead of -L /usr/include/irrlicht -lIrrlicht (for unix).
Did you try that?

How to include std::vector, std::complex<double>, std::cout, etc. in Visual Studio C++ [closed]

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 3 years ago.
Improve this question
I am new to Visual Studio for C++ (just moved in from Ubuntu g++ / gcc).
I am having trouble since Visual Studio does not seem to recognize
std::vector, std::complex<>, std::complex<double>, etc.
That all worked fine for Linux. How to do incorporate these in Visual Studio?
You probably copy pasted functions but forgot to include appropriate headers (newbie mistake).
Just try this:
#include <iostream>
#include <vector>
#include <complex>
using namespace std;
int main()
{
cout<<"Hello World";
return 0;
}

c++ win32 console application is not recognized as an internal or external command operable program or batch file

so I just installed vs2015, and I'm having issues starting a project. For my intro school programming class, we are learning with the win32 console. I started up my own project at home so I could work on my projects at home, but I'm having issues starting. Thanks in advance for any help. Link to image
Your issue is annoying yet simple to fix, before I answer it you're using visual studio 2015 which means by default you would have been "given " a header file and your main would have looked like the following.
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
return 0;
}
You can modify the main function, as in remove every thing but int main() but I would suggest not doing this.
The answer to your question is, your program will not compile because you are not using #include "stdafx.h"
simply put that in and your projects will work assuming you code them right...
Also after looking at your picture more closely ( next time post your code here)
I see that your only source file showing is named R4.Que? Rename it R4.cpp

Netbeans C++ Application won't build [duplicate]

This question already has an answer here:
How to add a library include path for NetBeans and gcc on Windows?
(1 answer)
Closed 8 years ago.
I recently installed the MiniGW compiler so that I can start learning C++. But when I go to create a new project and have it include main, I get two error messages from the start(after the project has been created) Cannot Find Include File <cstdlib> and Unable to resolve identifier std and when I try and 'Clean and Build' the project, the clean is successful and the build is not. I have done a google search and ran across this post Netbeans 7.2 shows "Unable to resolve identifier" , although build is successful , but I'm not sure my problem is exactly the same since my project won't build (or maybe it is, I don't know), and I'm also not sure I understand the accepted answer. Can this be multiple problems or just one? I want to get this fixed so I can learn!
/*
* File: main.cpp
* Author: Zf
*
* Created on December 16, 2014, 1:50 PM
*/
#include <cstdlib>
using namespace std;
/*
*
*/
int main(int argc, char** argv) {
return 0;
}
Edit: Lines 7 and 8 are where the error messages are.
Have you Tool Collection set properly ?
for example
<cstdlib> is found in C:\minGW\lib\gcc\mingw32\4.8.1\include\c++
Sounds like you need to tell the compiler where to find cstdlib. See this: How to add a library include path for NetBeans and gcc on Windows?
Cstdlib contains C functions, they are not wrapped in a namespace. Remove the using namespace std; line

Linking g++ with opengl (glm, glew and freeglut) [closed]

Closed. This question needs debugging details. It is not currently accepting answers.
Edit the question to include desired behavior, a specific problem or error, and the shortest code necessary to reproduce the problem. This will help others answer the question.
Closed 4 years ago.
Improve this question
This is the c++ code I want to run on my computer: http://pastebin.com/66BEyTWK
On the university computer, this code displays a white square. But when I try to run it on my computer all I get is a blank screen.
I read on the opengl faq that the problem might be that I am linking with the wrong combination of opengl libraries.
The include part of the code suggests that I need to link glm, glew and freeglut.
#include <iostream>
#include <GL/glew.h>
#include <GL/freeglut.h>
#include <glm/glm.hpp>
I read that it is not necessary to link glm, because it is only a header file. So this is the compile statement I came up with:
g++ -o main white_square.cpp -lGL -lglut -lGLEW
At my university they have setup a custom makefile which I can't get much sense out of: http://pastebin.com/3DxST3Xs