cannot compile gtk# example - windows-7

I'm trying to compile the "GTK# Hello World" example at http://mono-project.com/Mono_Basics in Windows 7 (64bits). I'm getting this error:
error CS8027: Couldn't run pkg-config: ApplicationName='pkg-config', CommandLine
='--libs gtk-sharp-2.0', CurrentDirectory=''
I have successfully compiled and run the "Console Hello World" example.
I have installed Mono-2.10.8.
Thanks in advance for your help

I tried to compile a GTK# example in a Windows 7 with Mono 2.10.8 and the options you used with the compiler, so i have the same error then i tried to reference each assembly by hand so it works fine.
Here is the full command, i tested in a Mono 2-10.8 comman prompt.
gmcs ButtonApp.cs -r:C:/PROGRA~2/MONO-2~1.8/lib/mono/gtk-sharp-2.0/pango-sharp.dll,C:/PROGRA~2/MONO-2~1.8/lib/mono/gtk-sharp-2.0/atk-sharp.dll,C:/PROGRA~2/MONO-2~1.8/lib/mono/gtk-sharp-2.0/gdk-sharp.dll,C:/PROGRA~2/MONO-2~1.8/lib/mono/gtk-sharp-2.0/gtk-sharp.dll
I hope this can helps

You were trying to use pkg-config which you do not have. pkg-config with --libs turns specified packages (like gtk-sharp-2.0 in your case) into references to libraries. If you don't want to install pkg-config, you have two options:
manually reference needed libraries with compiler options;
create a project with these libraries referenced.
I recommend the second option, as compiling by specifying all sources and references directly could be good for hello-world examples, but not for the something bigger. You would make your own script to compile the project, so why not use something designed just for that - like xbuild or make. MonoDevelop should contain empty Gtk# project template.

Related

Perl6 NativeCall cannot locate symbol in native library

I have a module using NativeCall that works on both Linux and macOS, but not Windows. When I try to use the module on Windows I get lots of errors like:
# Cannot locate symbol 'TinyTIFFReader_open' in native library 'tinytiff.dll'
I use cmake for my C++ dependency on all three OS's. On Linux and macOS I can just cmake ..; make; sudo make install, and on Windows I cmake -G "Visual Studio 15 2017 Win64" .. and then open the created ".sln" in Visual Studio to compile. The build succeeds with no errors on all three OS's.
Does anyone have any ideas of what I would need to do/change to also get my module working on Windows?
The full module is located here: https://github.com/ryn1x/Graphics-TinyTIFF
I think you will have to give TINYTIFFREADER_LIB_EXPORT and TINYTIFFWRITER_LIB_EXPORT defines a value (either in the source, but probably better to have it be passed by the build system) and on windows i think it has to be __declspec(dllexport), otherwise the symbols may not be made available in the dll.

MQX 4.0.1 program Not Compiled with GCC

I am using TWR-K20D72M and I opened a Sample program which is given in the MQX 4.0.1 Demo examples. When I choose Build tool option as Freescale
the program compiles OK but When I choose Build tool option as GCC It gives me error.The Error is below
error
Description
mingw32-make: *** No rule to make target `C:/Freescale/Freescale_MQX_4_0/lib/twrk20d72m.cw10gcc/debug/bsp/intflash.ld', needed by `explicit-dependencies'.
I read somewhere that The GCC can only work with MQX 4.0.1 and above so I am using MQX 4.0.1 .
Can some suggest me the reason for this error.How I can I remove this error.......
Thanks
You are missing the linker script file for your project intflash.ld.
Normally this file is located on
{mqx_install_dir}\mqx\source\bsp\{your_bsp_name}\gcc_cw
and is copied to
{mqx_install_dir}\lib\{your_bsp_name}.cw10gcc\debug\bsp
and
{mqx_install_dir}\lib\{your_bsp_name}.cw10gcc\release\bsp
after the build process by the scripts for your bsp, located on
{mqx_install_dir}\mqx\build\bat.
Take a look inside your bsp script and verify that intflash.ld is being copied correctly.
My guess is that you compiled your MQX application before compiling the BSP and PSP. With the release of CodeWarrior 4.6, the solution has gotten a bit easier through the use of .wsd files.
If you look at the FSL_MQX_getting_started.pdf, section 2.4 describes how to find a .wsd file which needs to be dragged into your CodeWarrior Project Explorer. Once this is done new projects will be added to your workspace. Compile the bsp_... and psp_... and any other libs that you require (usb, ethernet etc) which will generate binaries and the intflash.ld file in the correct location.
http://cache.freescale.com/files/soft_dev_tools/doc/support_info/FSL_MQX_Getting_Started.pdf

How can I compile C++ code with GCC compiler?

I wrote C++ code in notepad and want to compile with GCC compiler. Is GCC compiler a program? from which site I can download it? I don't have any information about it. What can I do?
You can start by downloading Code::Blocks, its an cross-platform IDE that can be downloaded including MinGW GCC compiler.
http://www.codeblocks.org/
But if You're using Linux you can use just a "gcc" command in the terminal.
GCC is a program. if you have linux its probably installed. to chek just type in the console line gcc. if you get a out put with the syntax - it's installed else - type the command that's suggested. in order to compile something type:
gcc <file name>
it will create a .out file that you could run from the console line.
for more info type:
man gcc
You can also use C-free 5.0 which is small and can use many compilers. Small ide. You just need to make it automatically choose the library and inclue paths.
If you're on Windows you can try one of ports: mingw.
If you're on Linux, you probably have it installed (try gcc --version) or at least available from repository (check your distributions "installer").
There is also a number of (free) IDEs that you can also get and use them instead of notepad. Google for Eclipse/CDT, Netbeans, code::blocks, etc.

use MinGW to create exe file in windows from GNU source package

the basic idea was, I wanted to generate the call graph in text format for several c files. After googling around for long time, i found cflow, which can deliver everything I want, but it is only runable in Linux or else. Then I began to search how to compile the cflow source files on the web to a exe file. I found MinGW which should be able to do the cross-platform compilation.
After installing the MinGW and the MSYS and running the usual commands "./configure; make; make install", I simply got an error that "mkdir" was not found. Actually. Actually I was wondering whether this is the correct way to compile the whole package.
Does anyone has an idea how I can build the cflow.exe correctly in Windows? If there is a tutorial or something like this, I will be very thankful.
Song
Solution
Please try this Github repository "MinGW + MSYS build of GNU cflow 1.4" (For Windows).
https://github.com/noahp/cflow-mingw
It contains already compiled "cflow.exe",and an instruction about how to build cflow using mingw and msys.
Test
System Environment:Win 8.1 (x64)
1.I tested the "cflow.exe" downloaded from the github repository , and amazingly it worked!
2.I followed the mingw compiling instruction,and it successfully compiled "cflow 1.5".
Command:
bash configure
make
I was able to do that today. I'm using cygwin, after installing gcc, binutils, make and after downloading the gnu cflow.tar.gz, it was as easy as ./configure ; make ; make install.

LLVM MinGW installation on Vista?

From llvm.org I've downloaded llvm-2.6-x86-mingw32.tar.bz2 into c:\llvm and llvm-gcc-4.2-2.6-x86-mingw32-tar.bz2 into c:\llvm-gcc as well as setup a desktop shortcut the following batch file in c:\llvm-gcc which attempts to setup an environment for compiling via the llvm-gcc command line too:
#echo off
color 0E
echo Configuring LLVM environment...
set LLVM_LIB_SEARCH_PATH=%~dp0lib
set PATH=c:\llvm;%~dp0bin;%PATH%
Unfortunately, this setup gives the following error when trying to compile a simple hello world program:
C:\CDev\sandbox>llvm-gcc -o hello.exe hello.c
llvm-gcc: CreateProcess: No such file or directory
I've briefly looked through the LLVM binaries and it appears that the MinGW-based Win32 API and runtime files are already included. I also tried adding the MinGW DLL to c:\llvm-gcc\bin to no avail.
What have I missed in setting up the binary LLVM environment and GCC-based front end on Vista?
Thanks, Jon
Because the GNU/MinGW assembler 'as' was required by 'llvm-gcc' to generate the obj file. The problem can be solved by using:
Install GNU/MinGW binutils, extract the as.exe into c:\llvm-gcc\bin
Install a full MinGW package, add %MinGW%\bin your %PATH%
#rwallace is correct that one needs to also install MinGW's binutils along with the LLVM binary download. I've updated the LLVM documentation appropriately at
http://llvm.org/docs/GettingStarted.html#installcf
As far as I can tell, the answer is that the MinGW distribution supplied by LLVM is not complete, in particular, it doesn't come with the 'binutils' programs.
The recommended solution seems to be to download and install MinGW yourself. However, the MinGW download page seems to be saying this requires 10 different packages to be downloaded and installed separately.
The solution I tried today was to use the MinGW that comes with Qt, which does come in a single package; thus far, that appears to work.
It seems like it is looking for the base MinGW installation in C:\MinGW. I just had this error today using gcc.exe in msys. To solve it, I created a symbolic link from c:\msys to c:\MinGW and everything worked.

Resources