cannot find -lwxmsw30u_core and -lwxbase30u in codeblocks - c++

I am getting error like this. I have searched my wxwidgets folder\lib\gcc_dll this particular libraries are not build. Am i missing something here?
I have used this command to build wxwidgets:
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllexport

You have used MONOLITHIC=1 for some reason. If this was intentional, you need to link with the single library produced in this case and not the separate core and base libraries. If it wasn't, then you should remove the build directories (build\msw\gcc_mswu and lib\gcc_dll) and rebuild without using it.

Related

Unable make wxWidgets-3.0.4 on codeblocks

I am facing a problem when I try to install the wxWidgets-3.0.4 and used it with Code::Blocks. I have searched a lot on the internet for something similar, without success.
I had installed the wxWidgets in the directory C:\wxWidgets-3.0.4
I used the instructions from the site here but when I type
mingw32-make.exe -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0
I get
C:\wxWidgets-3.0.4\build\msw>mingw32-make.exe -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0
if not exist ..\..\lib\gcc_dll\msw mkdir ..\..\lib\gcc_dll\msw
process_begin: CreateProcess(NULL, -c "if not exist ..\..\lib\gcc_dll\msw mkdir ..\..\lib\gcc_dll\msw", ...) failed.
make (e=2): The system cannot find the file specified.
makefile.gcc:5642: recipe for target '..\..\lib\gcc_dll\msw' failed
mingw32-make.exe: *** [..\..\lib\gcc_dll\msw] Error 2
So, I cannot figure out the problem. Why I cannot continue.
I suspect you have some Cygwin/MSYS utilities in your PATH and they don't work with these makefiles which are explicitly intended for being used from DOS-like environments.
If you want to use Cygwin, you should build wxWidgets using configure. Otherwise, type path to see the current value and remove anything containing mkdir.exe from it.

CMake is not found when running through make

I'm trying to build https://github.com/AlbertWerner/cryptonotecoinwallet and facing an issue.
According to the README of the repo, I can run cmake command and it completes without any errors. But then, when I run make, it gives me the below error.
$ make
make: /usr/bin/cmake: Command not found
make: *** [Makefile:5138: cmake_check_build_system] Error 127
I'm using MSYS on Windows and here are the corresponding details.
$ echo $PATH
/usr/local/bin:/usr/bin:/bin:/opt/bin:/c/Windows/System32:/c/Windows:/c/Windows/System32/Wbem:/c/Windows/System32/WindowsPowerShell/v1.0/:/usr/bin/site_perl:/usr/bin/vendor_perl:/usr/bin/core_perl:/mingw32/bin
$ which cmake
/mingw32/bin/cmake
Seems like it's looking for cmake in the wrong path.
Makefile
cmake_check_build_system:
$(CMAKE_COMMAND) -H$(CMAKE_SOURCE_DIR) -B$(CMAKE_BINARY_DIR) --check-build-system CMakeFiles/Makefile.cmake 0
.PHONY : cmake_check_build_system # <== Line 5139
I'm not sure what's wrong. Please help me out.
Thanks.
Make sure that you launch MSYS2 using the mingw32.exe executable at the top level of your MSYS2 installation, and that you use that environment when you first run cmake. If you ran CMake in a different environment, remove all the files it created. The commands for running cmake and building the project should be something like this, assuming the developers have set it up in a reasonable way:
mkdir build
cd build
cmake .. -G"MSYS Makefiles"
make
I didn't try this myself because I am wary of running random code from the internet, but I found this note in the CMakefile indicating that the developers do not support MSYS2:
if (WIN32)
if (NOT MSVC)
message(FATAL_ERROR "Only MSVC is supported on this platform")
endif ()
...
So you will have to spend some effort on porting the Windows-specific code in this program to GCC if you really want to do this.

( __ printf __ ) cannot be found in DLL (programfiles(x86)\codeblocks\mingw\bin\as.exe)

I'm trying to learn wxwidgets for cross platform GUI development, however I faced a problem.
When try to build wxwidgets with mingW32 I run into errors. I installed minGW32 with codeblocks 16.1 (works fine), added PATH to System Environment. Downloaded all possibilities from wxwidgets.org. None of them wants to compile when I try to compile wxwidgets library from cmd with mingw32. I go into wxwidgets/build/msw, typed several versions but to mention one:
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITIC=1 UNICODE=1
(tried without shared, monolitic, even debug mode)
About the error:
( __ printf __ ) cannot be found in DLL
(programfiles(x86)\codeblocks\mingw\bin\as.exe)
I have the exe, tried to reinstall everything from scratch several times. I'm using Windows 10.
gcc -c -o gcc_mswudll\wxregex_regcomp.o -O2 -mthreads -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_dll\mswu -D__WXMSW__ -D_UNICODE -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
makefile.gcc:5778: recipe for target 'gcc_mswudll\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1
Update:
After reinstalling and deleting everything connected to this, the problem has changed. The code I use, tried without the flag, and with flag but only"-std=gnu++11" too:
mingw32-make -f makefile.gcc SHARED=1 UNICODE=1 BUILD=release CXXFLAGS="-fno-keep-inline-dllexport -std=gnu++11"
The new error code:
gcc -c -o gcc_mswudll\wxregex_regcomp.o -O2 -mthreads -DHAVE_W32API_H -DNDEBUG -I..\..\include -I..\..\lib\gcc_dll\mswu -D__WXMSW__ -D_UNICODE -MTgcc_mswudll\wxregex_regcomp.o -MFgcc_mswudll\wxregex_regcomp.o.d -MD -MP ../../src/regex/regcomp.c
gcc: error: CreateProcess: No such file or directory
makefile.gcc:5702: recipe for target 'gcc_mswudll\wxregex_regcomp.o' failed
mingw32-make: *** [gcc_mswudll\wxregex_regcomp.o] Error 1
Any infos about the fact that I could not ever compile wxwidget with codeblocks' built in compiler? without addons?
Delete everything: wxWidgets, Code::Blocks and MinGW or TDM-GCC
* Download and install C::B, without MinGW or TDM
* Download TDM-GCC from here. If you install both 32 & 64 bits versions I suggest you to install them in two different folders.
* Download wxWidgets
Open a command window. Say you have TDM at "C:\TDM32" and wxWidgets at "C:\myWX".
Use these commands to compile wxWidgets:
PATH=%PATH%;C:\TDM32\bin
cd C:\myWX\build\msw
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITIC=1 UNICODE=1
This should build an only .dll file with most of wxWidgets. Not OpenGL.
If you prefer several .dll don't use "Monolitic=1"
If you prefer not using wx'dlls, but static '.a' files added to your app, don't use "shared=1"
If you want to step into wxWidgets code when using a debugger, use "BUILD=debug"
If you want OpenGL use "USE_OPENGL=1"
To build wxWidgets with C++11 use CXXFLAGS="-std=gnu++11"
For your own app you must tell C::B:
* where the TDM compiler can be found
* where the wxWidgets headers can be found
* where the wxWidgets libraries (.dll or .a depending if you compiled with "shared") can be found

Compiling a static version of wxWidgets

I tried a lot now but nothing is working..
I saw a lot of posts about this and a lot of answeres, but none of it is working for me...
Did anybody successfully build wxWidgets as static and now the right commands?
I downloaded wxWidgets here: http://www.wxwidgets.org/downloads/
I tried for example the following commands:
mingw32-make -f makefile.gcc -j4 SHARED=0 MONOLITHIC=1 BUILD=release clean
mingw32-make -f makefile.gcc -j4 SHARED=0 MONOLITHIC=1 BUILD=release
or this:
mingw32-make -f makefile.gcc -j4 SHARED=0 MONOLITHIC=1 BUILD=release clean
mingw32-make -f makefile.gcc -j4 SHARED=0 MONOLITHIC=1 BUILD=release
But when the build is finished and I tried to compile a simple programm in Code::Blocks I get a lot of 'undefined reference' errors.
Has anybody experience with it and successfully build a static copie of wxWdigets?
And if so, could you please tell me the commands you used...
I have a dynamic build which I already build and this is working... but I need a static version so I can get a working standalone exe....
If you want to see how to build wxWidgets, good..but no with mingw, it takes ages...you can try binaries for both compilers, see wx's sourceforge site.

wxWidget 2.8.12 not working in Codeblocks

I'm learning to use wxWidget 2.8.12 with Codeblocks 12.11. I have followed the instructions on this site to install wxWidgets and Codeblocks:
http://wiki.codeblocks.org/index.php?title=WxWindowsQuickRef
When I try to create the project and run the demo app I get the error:
fatal error: wx/setup.h: No such file or directory
The following picture will show this better:
I have followed the instructions, but still I get the error...what seems to be the problem? :(
Thnx for any help
P.S.
Here is an overview what I have done:
1) I downloaded Codeblocks including MinGW (codeblocks-12.11mingw-setup.exe)
http://www.codeblocks.org/downloads/26#windows and I have installed them using the .exe file
2) I have edited my User PATH environment variable to according to the reference page I have used
3) I have downloaded wxWidgets installer from this link and installed it:
http://sourceforge.net/projects/wxwindows/files/2.8.12/wxMSW-2.8.12-Setup.exe/download?use_mirror=garr
4) I have entered the directory C:\<wxWidgets root>\build\msw and inputted the following command in command prompt:
mingw32-make -f makefile.gcc BUILD=release SHARED=1 MONOLITHIC=1 UNICODE=1 CXXFLAGS=-fno-keep-inline-dllexport
After letting wxWidgets build and trying to run my demo app I get the error I mentioned in Codeblocks :(
NOTICE FUTURE READERS: Install wxWidgets to a directory without whitespace in the path name! Otherwise this will cause trouble
Please have a look at the Below Link which i have put.It will be very useful.I have also installed wxWidget 2.8.12 with Codeblocks 12.11 using This Link.
Setting up wxWidgets(2.9.4) with Code::Blocks(12.11) in Windows
Type These below steps in Command Prompt after you finish installing the wxWidgets2.8.12 and CODEBLOCKS 12.11.
gcc -v
mingw32-make -v
cd /D C:\wxWidgets-2.8.12\build\msw
mingw32-make -f makefile.gcc clean
mingw32-make -f makefile.gcc BUILD=debug SHARED=0 MONOLITHIC=1 UNICODE=1
mingw32-make -f makefile.gcc BUILD=release SHARED=0 MONOLITHIC=1 UNICODE=1
If the problem still persists after doing all the above steps then You're missing an important compiler search path in your build options.
Make sure you choose the correct wxWidgets build configuration when running the wxWidgets project wizard.
If re-running the wizard isn't an option, then open your project's build options and add "$(#wx.lib)\gcc_dll\mswu" (assuming a monolithic Unicode DLL build) to the compiler search paths.