I am using CodeBlocks 13.12 on a Win 7 x64 machine.
My intention was to learn a bit about building a wxWidgets project in CodeBlocks, so I created a new wxWidgets project, pointing the location of wxWidgets to "C:\wxWidgets-3.0.1" . Then added all the source files from the sample in the project and trying to build the project in the IDE, I get these errors :
||=== Build: Debug in widgetsSample (compiler: GNU GCC Compiler) ===|
ld.exe||cannot find -lwxmswd_core|
ld.exe||cannot find -lwxbased|
ld.exe||cannot find -lwxpngd|
ld.exe||cannot find -lwxzlibd|
||=== Build failed: 4 error(s), 0 warning(s) (0 minute(s), 1 second(s)) ===|
How do I make corrections so that these errors disappear and project gets built ?
As an additional info, I downloaded the "wxWidgets-3.0.1.tar.bz2, 2014-06-15, 20.1 MB" and followed a Youtube tutorial on compiling the sources with CMD and mingw32-make. I don't suppose that made a big difference since that only produced .O and .D files in "C:\wxWidgets-3.0.1\build\msw\gcc_mswud" folder. Well if someone cared to explain this process and its use as well I would extra appreciate it as a total beginner.
EDIT 1:
This is a snapshot of linker settings that I believe is relevant to the answer:
By the looks of it you did not set the libs dir for the linker. Should be something like Menu "Project" -> Build Options -> Linker settings.
Compiling sources does make another big difference, see "C:\wxWidgets-3.0.1\libs".
Related
I'm not very C++ savvy yet and have been looking at creating a small project to get better used to the language and so on.
Since what I want to do involves lots of disk scanning and file things I decided to look at the Boost libraries, specifically the filesystem library.
I've been working though this guide:
http://www.boost.org/doc/libs/1_61_0/more/getting_started/windows.html
I'm using Microsoft tools including Visual Studio 2015 on Windows 10.
I downloaded boost in zip format and extracted to:
G:\C++\boost\boost_1_61_0
Then ran the described commands:
> bootstrap
> .\b2
> b2 --build-dir="G:\C++\boost-build" --build-type=complete msvc stage
When this last command completed the small report message at the bottom read:
...failed updating 224 targets...
...skipped 20 targets...
...updated 3804 targets...
I don't know if that signifies problems or not.
Everything seems to have worked so far up until the point where I started to try and consume the binaries (Step 6 in the guide).
I added the other lib directory described in step 6.1. Although the lib directory I have is inside the stage directory, not the boost root as described in the guide.
I added this to the "Additional Include Directories", so that string now looks like:
G:\C++\boost\boost_1_61_0;G:\C++\boost\boost_1_61_0\stage\lib
When recompiling, if I remove the first entry I get this error:
C1083 Cannot open include file: 'boost/regex.hpp': No such file or directory
When I compile with both paths set I get:
LNK1104 cannot open file 'libboost_regex-vc140-mt-1_61.lib'
I've confirmed that the file named is in the directory here:
G:\C++\boost\boost_1_61_0\stage\lib
Pretty confused right now. What have I done wrong here?
Is there a better guide to follow? This guide does seem talk about VS2003 and 2005.
Any advice would be great.
As the name states, "Additional Include Directories" are for the files that you want to #include, which in your case is the G:\C++\boost\boost_1_61_0 directory.
The linker won't search for the libraries in the "Additional Include Directories", because those are not meant to be used for libraries, and it so can't find the boost libraries.
The linker searches "Additional Library Directories" for the required libraries, so you should put the path to the libraries there, i.e. G:\C++\boost\boost_1_61_0\stage\lib.
The property is located in Linker -> General.
So it's been now 4 hours I've been trying to get Magick++ to work. For some reason, it never occurred me that an external library worked without problems. Usually it takes about six hours of pure time googling.
After a lot of pain I've finally achieved to get the first part of compilation right (extept the tons of warnings), but the linking is problematic. I've found this post about Imagick linking errors and this one about adding the Imagick paths to the project.
After adding the Imagick/lib to the Linker settings in Visual C++ project this is the only message that coumes out of the compiler:
1>------ Build started: Project: stripes, Configuration: Debug Win32 ------
1>LINK : fatal error LNK1104: cannot open file 'C:\Program Files\ImageMagick\lib.obj'
========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========
What is this supposed to be? Have I accidentally edited something else?
In Project properties -> Configuration properties, I edited following:
VC++ Directories
Include Directories - added C:\Program Files\ImageMagick\include
Library Directories - added C:\Program Files\ImageMagick\lib
Linker
General
Additional Library Directories - added C:\Program Files\ImageMagick\lib
Input
Additional Dependencies
added CORE_RL_Magick++_.lib
added CORE_RL_magick__.lib
added X11_.lib
So, even though the library still does not work for me, I've overcome this particular problem. It took me another hour.
The solution was to:
Download the source archive here.
Run the \VisualMagick\configure\configure.exe1
There should be now a Visual Studio file in \VisualMagick\VisualDynamicMT.sln
Open it. You'll probably need to convert the solution to your visual studio version. Once this is done (it's automatical), clean and build the All project:
By this time the libraries and DLLs should be built. You're interested in \VisualMagick\lib\*. In the installation folder of imagick, backup all present libraries and then copy (and overwrite) all newly compiled ones.
1 All paths are relative to archive root
The project now compiles but does not run.
I'm a beginner to c++ game development. I tried to set up the sdl library on code block; I followed every tutorial I have found on Google, but can't get it to work. I also included SDL2_image-2.0.0 and SDL2_mixer-2.0.0 but it isn't working. The error is:
#include <winapifamily.h> ||=== Build: Debug in tut (compiler: GNU GCC Compiler) ===|
C:\mingw_dev_lib\SDL2-2.0.3\x86_64-w64-mingw32\include\SDL2\SDL_platform.h|121|fatal error: winapifamily.h: No such file or directory|
||=== Build failed: 1 error(s), 0 warning(s) (0 minute(s), 0 second(s)) ===|
include <winapifamily.h>
What is wrong with my code?
I actually just set up SDL2 on Code::Blocks myself a day or two ago. Since I suspect your environment might not be configured correctly, here's how I did it, roughly following the tutorial here:
Download both a runtime binary and a development library from the SDL2 download page. Make sure the runtime binary is appropriate for your apps - in other words, if you're building 32-bit executables, get the 32-bit SDL, and if you're building 64-bit binaries, get the 64-bit SDL.
Unpack the development library into a folder of your choice, and do the same with the runtime binary. Remember what paths you used for these. I used "D:\Programming\C++\SDL\SDL2.dll" for my SDL runtime binary and "D:\Programming\C++\SDL\SDL2-2.0.3" for my development library.
Open your project in Code::Blocks.
Go to the Settings menu and click "Compiler..."
Switch to the "Search Directories" tab, then the "Compiler" subtab.
Click "Add" and browse to the folder for your development library. You'll need to pick whether you're developing for 32-bit apps or 64-bit apps here: if you're going for 32-bit, you'll want to add "\i686-w64-mingw32\include" ("D:\Programming\C++\SDL\SDL2-2.0.3\i686-w64-mingw32\include") and for 64-bit apps you'll want to add "\x86_64-w64-mingw32\include" ("D:\Programming\C++\SDL\SDL2-2.0.3\x86_64-w64-mingw32\include").
Go to the "Linker" tab right next to the "Compiler" tab.
Click "Add" and browse to your the folder for your development library. Once again, based on whether you're going for a 32-bit app or a 64-bit app, add "\i686-w64-mingw32\lib" ("D:\Programming\C++\SDL\SDL2-2.0.3\i686-w64-mingw32\lib") or "\x86_64-w64-mingw32\lib" ("D:\Programming\C++\SDL\SDL2-2.0.3\x86_64-w64-mingw32\lib") respectively.
Take the SDL runtime binary ("D:\Programming\C++\SDL\SDL2.dll") and copy & paste it into the folder your compiled EXE will end up in. Since you're using Code::Blocks, this will usually be %PROJECT_FOLDER%\Bin\%RELEASEMODE%, where %PROJECT_FOLDER% is the path to your project and %RELEASEMODE% is Debug or Release.
Build your project and verify that it works.
You can also set this up on a per-project basis rather than a global basis if you want. Just go into the Project menu and click "Build options..." instead of the Settings menu in step 4.
If SDL still doesn't work after this, I'd suggest getting an updated MinGW and making sure Code::Blocks is properly set up to use it.
I'm using CodeBlocks and trying to link SDL_ttf when compiling my program. I have followed thus instructions:
Add "-lSDL_ttf" in the linker command line
Put SDL_ttf.dll in library directory
Put SDL_ttf.h in include file directory
And I have this error when compiling:
ld.exe||cannot find -lSDL_ttf|
||=== Build finished: 1 errors, 0 warnings ===|
I've tried so many methods to solve this and I feel like banging my head against a brick wall.
I'm running Windows and I have moved the .dll to my system32 as well as the project folder and put the header files in my compilers includes folder.
You also need the .lib file to link against. Put the .lib file in your library directory; you may also need to add that directory to your linker's search path with the -L <path> option.
you have to use -lSDL2_ttf instead -lSDL_ttf
I can compile the DLL project without any error. It says "Build succeeded".
But I don't see any DLL file in the Debug or Release folder.
There are only .exp, .lib and .pdb files
Visual Studio 2010 by default puts the output files in $(SolutionDir)\Debug or $(SolutionDir)\Release. It's quite likely you are looking at Debug and Release folders inside the project - which are the intermediate folders.
To find out where the output files got open Project Properties > General > Output Directory. By default it is $(SolutionDir)$(Configuration)\ which evaluates to either Debug or Release in your solution directory.
EDIT Visual Studio will tell you where it places the output files in the Output window. Just bring it up by going to "View > Output". It'll say something like this:
1> MFCInterop.vcxproj -> C:\temp\sotest\Debug\MFCInterop.dll
========== Rebuild All: 1 succeeded, 0 failed, 0 skipped ==========
I have had issues w/ C# and VB where VS will not create output files.
The root issue seems to be that it lost its mind w/ respect to a reference.
I trouble shot this way
exclude all files
adding in a stub class1 file / compile / verify files are created
add files back one by one and eventually you can determine what the issue is
The issue for me was a .Net version mismatch. The reference had a higher version than the project failing
No answer as to why VS does not yield a compile error in this situation.
If I delete the reference altogether , it definitely complains.
greg
At the bottom Show output from:
Change to Build
Look in the folder identified.