Is there a library that I can explicitly link to my Fortran code to find FGETC function? I'm getting linker errors for unresolved external symbol for the fgetc function and I tried using 'USE IFPORT' but that broke a bunch of other stuff. I am building in Visual Studio 2008 and using Intel Fortran Composer XE 2011 compiler.
Since FGETC is a non-standard function which Intel packages in the IFPORT module I'm not sure you have any alternative to use-associating it. If use-associating the whole module causes problems, you might get away with
use ifport, only : fgetc
Related
I am using:
VS 2017
MinGW with GCC/G++ 7.4.0.
Basically what is happening goes as follows:
An executable is built using VS 2017
An .so is built with GCC
The .so is loaded by the executable created in step 1
The issue stems from the MSVCRT. MinGW by default links against MSVCRT.DLL and the executable created using VS 2017 uses VCRUNTIME140.DLL and UCRTBASE.DLL.
When the .so is loaded two CRT exist the one from MSVCRT.DLL and the other from VCRUNTIME140.DLL and UCRTBASE.DLL. This causes random issues/memory issues during application runtime.
The solution for that is to have MinGW link against VCRUNTIME140.DLL instead of MSVCRT.DLL. I have done that by creating an import library from VCRUNTIME140.DLL added it to MinGW and dumped the GCC specs and modified it to have it link to the VCRUNTIME140.DLL and UCRTBASE.DLL.
My problem now is the scanf family functions. I can't seem to find the scanf functions within VCRUNTIME140.DLL or UCRTBASE.DLL.
Where does the scanf family lie now in the whole new UCRT thing?
So, I just compiled a small test application which makes use of scanf and compiled it using VS 2017 and found that it uses API-MS-WIN-CRT-STDIO-L1-1-0.DLL which then uses UCRTBASE.DLL for scanf which appears this way __stdio_common_vscanf.
I am now so confused. Is there any kind of a clean way to reference scanf functions by MinGW GCC?
I was able to get rid of the undefined scanf errors during linking by only adding -D_UCRT to cpp and cc1plus parts of the GCC spec file.
I reached this solution after checking the sources found in stdio folder of mingw src\mingw-w64\mingw-w64-crt\stdio and some threads in the discussion forum of MinGW sourceforge.
MinGW stdio.h had #ifdef _UCRT around scanf related functions.
I have a problem on my cross-compile with Visual Studio Enterprise 2015 and my ARM under Debian 8 (BeagleBone Black).
All is working fine, the code compile, at least the linking of the objects.
I have a message like :
Project/lib/libmysqlcppconn-static.a: error adding symbols: File format not recognized
1> collect2: error: ld returned 1 exit status
I have searched and it seems to be an architecture problem, most of the time. But I tried with a 32 bit version.
For information, I have compiled the same program in the same context, without the Connector/C++ lib, but with another library, static too, with the same extension (. a) too, and it worked fine.
I searched in MySQL Documentation, but nothing explicitly saying that ARM is not supported.
Anyone has information on this?
(PS: First post, and school english, hope it's not too bad !)
I don't think you'll have much luck compiling for Linux using Visual Studio; Microsoft tools use COFF object format and Linux uses ELF (and the libraries are totally different), so at the binary level they are really talking different languages even if you are compiling for the same CPU instruction set.
I am trying to port a piece of software from Linux to Windows. Actual software is written primarily in C++ and significant code is in C language. I tried to compile this code using Visual Studio 2012 (because I am using windows 2007) but at linking time I am getting many errors which says the function calls in C files are unknown entries. This software compiles, links and run fine on Linux so there are no issues with include of or anything silly like that.
Has anyone run into this issue? Does anyone know how to resolve it?
Please note that I have to do a native port so cygwin or other mingw are not options for me.
Thanks for your help in advance.
Chances are, you are using some kind of Linux-specific library. The most obvious example would be unistd.h, which doesn't really have a direct equivalent in Windows.
I want to use boundary fill algorithm with cpp in Visual Studio Environment. I tried to run some code parts for it, but I faced to face an error at every turn. This error is about 'DETECT' keyword in codes. The most of codes include that lines:
int gd=DETECT,gm,n,ch,xc,yc,r,bcolor,fcolor;
initgraph(&gd,&gm,"");
I have an error as "the definition 'DETECT' is undefined" because of this usage.
How can I overcome this problem?
PS: You can reach example code that I used from this link -> http://www.hhhprogram.com/2013/05/draw-circle-and-fill-color-using-boundary-fill-algorithm.html
Thank you.
add header for DETECT, that may solve the issue.
I think this code is Turbo C++ specific ( will work with Turbo C++ only) and will not work in Visual Studio unless you add proper library which contains those BGI.h and initgraph and gd= DETECT blah blah blah whatever you are using.
To draw graphics in your C program you should have some graphics library with your C compiler. Normally you have to download that and link to the compiler yourself. Turbo C++ by default contains graphics.h which provides some basic graphics functions. If you want to use that in your Visual C++ compiler you have to add that so that Visual C++ compiler can recognize what initgraph, gd = DETECT is. I do not know how to add graphics.h in Visual C++ and I would not recommend that. I won't recommend using turbo c++ either. Instead, you can download and install OpenGL with your Visual studio. If you want simpler thing then go for Dev-Cpp and Allegro.
I have written a simple "do-nothing" OpenCL application (in C++ but using the C API) on Linux to get some data about OpenCL speed. It compiles fine and runs without error. I don't have a graphics card that supports OpenCL, but I need to test it on a GPU. I'm trying to build the application on my friend's Windows 7 64bit computer using the OpenCL implementation provided with NVIDIA'S CUDA Toolkit.
When I try to link to the OpenCL.lib file in CUDA\x64 I get undefined references for each OpenCL call within the program (using the standard C API). The same thing happens when I link to the OpenCL.dll in the system32 directory. If I link to the win32 library that came with the CUDA Toolkit, I don't get errors, but OpenCL cannot acquire a platform. All the undefined references I get when linking have an #20 or #46 or some random number on the end of the symbol name. I'm not familiar enough with Windows development to know how to fix this problem. What could be my problem?
I apoligize for any newbie-ness. Thanks for any answers!
I believe you'll want to use the library that doesn't give link errors.
The other errors you're getting are because you're linking mismatched code together.
Then focus on trying to determine what your platform identifier should be.
I think you were close but gave up too soon