Cannot find -Ifreeglut - c++

I am working on Glut Project in Code::Blocks. I have Freeglut.dll in windows folder in C Drive. I have also copied this file in sysWOW64 (as i am using windows 10). But it still gives the error mentioned in the pictures bellow:

The linker does not find Freeglut.lib. Most probably you missed to add the path to the lib directory to the linker options. I don't know how to do this in Code::Blocks, but in general you have to add these additional library directories using the -L<DIR> switch for the linker.

Related

Getting dll include to work in Visual Studio

I am new to Visual Studio, and to using .dlls, and I am trying to get portaudio running, but have not had success.
I built the .dll file, and created a console application project in VS,
I added the portaudio .lib file to "Additional Dependencies" in the solution properties -> linker -> input options.
I then added the directory for portaudio.h to VC++ Directories --> "Include Directories"
After those steps, I was able to build example code without errors, but when I run the program I would get this error:
The program can't start because portaudio_x86.dll is missing from your computer. Try reinstalling the program to fix this problem.
I tried adding the directory to where the dll and lib files are to "Executable Directories" but still I get the same error.
I don't know what else I need to do to get the dll working in VS. Any help is much appreciated.
The easiest solution is to move the created DLL to the same directory where your executable is running. There is no need to make project setting changes.
The other solution is to move the DLL to a directory specified in your PATH statement, or will be found by Windows using the Dynamic Link Library Search Order criteria.

Visual Studio 2013 cannot open 'glfw3.lib'

I'm having a few issues getting GLFW3 set up. I've downloaded the 64-bit binaries from the official site, added glfw3.dll, glfw3.lib and glfw3.h to their respective places, specified the proper include, and added the appropriate linker input to my project. However, when I test the library with glfwInit(), VS spits this out:
error LNK1104: cannot open file 'glfw3.lib' Path/To/Project
My guess was that VS didn't know what directory the library was in, but seeing as it's in the IDE's own lib folder, I don't think this is it. Does anyone have any suggestions? Sorry if this has already been solved, I got in as deep as to read the steps of compilation before I gave up searching.
Edit: I also changed the solution platform to x64, since I am using the 64-bit GLFW binaries.
Following Andon M. Coleman's advice, I moved the headers and library folders to a new directory outside of Visual Studio's built-in ones (D:\opengl-wrappers\lib & D:\opengl-wrappers\include, for example). After including those libraries in the project settings (C/C++->General-> Additional Include Directories and Linker->General->Additional Library Directories), everything compiled beautifully.

Setting up OpenGL projects in VS2010 with freeglut/glew

I am following the following tutorial my instructor used in class for a graphics class that started last week.
http://cse.spsu.edu/jchastin/courses/cs4363/labs/ProjectSetup/Project_Setup.html
I am trying to set this up under Win8 using VS2010 pro.
I copied freeglut.dll and glew32.dll to C:\windows\sysWOW64
I get to step 5 to include the include directories - http://i.imgur.com/XI1E63q.png
I get to step 7 to include the dependencies - http://i.imgur.com/aOChW8p.png
And finally to step 8 for the library directories - http://i.imgur.com/AzDvD9R.png
I try to compile and I get what seem to be linkage errors according to a quick google search - http://i.imgur.com/5GxhE9u.png
Google says its a linkage error but everything seems to be linked properly on my end. Is there something I am missing since this is under Windows 8?
Thanks for looking.
Edit: Playing around with the linker directories. I am linking them to:
\freeglut-2.8.1\lib\x86
\glew-1.10.0\lib\Release\Win32
takes the error count down to 23 errors. :)
http://i.imgur.com/5PaHJkO.png
Edit2: freeglut.h is located at \freeglut-2.8.1\include\GL and glew.h is located at \glew-1.10.0\include\GL and both of those are pointing right include directories under C/C++/General's tab.
AFAIK, the full path of glew's libs is \glew-1.10.0\lib\Release\Win32(I suppose you use 32bit windows), make sure you path include the lib files correctly. if you didn't modify the directory structure, /glew-1.10.0/lib won't find the libs you want.
Do the same thing for glut libs, I see you got glut link errors as well.
VC++ Directory settings in Visual Studio.

cannot open file 'SDL2.lib'

I am trying to open sdl2 in my project on Visual C++ 2012 but i keep getting this error:
error LNK1104: cannot open file 'SDL2.lib'
I added the additional libraries and include folder but no luck..
I added the link to the libraries through the linker but i get the same error..
what should i do?
I'm referencing VS 2010, but I've read before that some people have had errors when using the VC++ Directories in their project properties as opposed to the Linker->General->Additional Library Directories.
Unfortunately, there really isn't much more to do besides making sure the directories are linked properly. There really is only one answer to this question. It also may depend on the download of SDL you chose, are you donwloading the Development Library as opposed to the binary?
Watch this video https://www.youtube.com/watch?v=or1dAmUO8k0.
In summary, you want to add the path include folder here: (configuration properties> C/C++ > General> Additional Include Directories),
and add the path of the lib folder here: (configuration properties> Linker > General> Additional Library Directories)
and finally, link .lib file in: linker > input > Additional Dependencies.
It seems like you didn't add your library directory path in VC++ Directories/Library Directories.. You have to link your library directory path (Where you have save you libraries of SDL) in your program. After adding, it will definitely work
I would like to add for others experiencing this problem that its an easy mistake if you are using the Development Library to link to the lib folder. SDL needs you link to either the x86 or x64 folder in the lib folder.
If you run or compile your program before you make those required changes of SDL then you will get this error always.. so first add a c++ file then make those changes and then write something and try to run ..this time it will never give this error
It seems like VS can't find the lib files. There are two ways you can do this. One is to configure the appropriate directories in VS as TwinkleBearDev's article shows. Another is to put the libraries directly where VS would look for them, as my article shows. I don't know if the folders for VS2012 are the same though - might be slightly different.

Netbeans C++ using MinGW and the libnoise library

Using netbeans 7.2 and the most recent version of MinGW (using installer) I can't use the libnoise library. I am properly including the header files, the auto completion confirms this, however the library is simply not working. There is a .lib file and a .dll. I have tried every possible combination of adding them under project > properties > Build > Linker as well as putting the .dll in the base project directory. Despite all this I am still getting undefined reference errors whenever I try and run the code. Does anyone know what to do?
I know that it is possible to link import library files (*.lib) with MinGW, but I still suggest to recompile libnoise.
With the current Makefile, this is not very easy and may break. Thus I've written a CMake script, which doesn't only work on Windows, but should work on all CMake supported platforms. In addition to this, I've cleaned up the directory structure. The code itself hasn't been touched and when you build a library it should essentially be the same as the current one.
libnoise on GitHub
After you've built your shared library, you'll have a libnoise.dll.a and libnoise.dll file. You then add libnoise.dll.a to the linking settings and put the DLL itself next to the binary, or in the working directory.
You have to link the lib file (= adding it to linker libraries) and put the dll to
<project root>/dist/<...>/
(where your exe is put to). There's no need to add the dll to linker too.
Can you please post the error message you get?