I wanted to try a program distributed in source for *nux on Windows. It’s simple program with couple of C source files and headers
-
I have Mingw/Msys and first I tried to compile it there, by running
make, but unfortunatelly I get obscure error(.text+0x175): undefined reference to 'strsep'which maight indicate a problem with autotools or similar, according Google search, but that’s all about it I could get -
As I mentioned that it is a simple program, I also tried to compile it with VS2008, until I figured it uses unix header file for parsing command line arguments, so nothing I can do there too
-
I launched my Ubuntu laptop and compiled the program in second, and tested it all fine, then I copy binary in my Windows Msys folder. No luck again as file can’t be execeted (under Msys prompt of course) – it doesn’t have execute flag and
chmodon Msys has a “feature” that makeschmod +xunavailable
Update:
This is the error I get from msys prompt while trying to compile:
f77_diagram.c: In function 'handle_goto':
f77_diagram.c:57:4: warning: implicit declaration of function 'strsep' [-Wimplicit-function-declaration]
[...]
gcc -o f77_diagram block.o do_loop.o f77_diagram.o if.o label.o \
links.o parse_fortran.o
f77_diagram.o:f77_diagram.c:(.text+0x175): undefined reference to `strsep'
collect2: ld returned 1 exit status
That means that the function/variable strsep wasn’t properly initialized. It most likely is a linking error. All it probably means is that you don’t have a dependency installed. You’ll need to post more information about the error.
By the way, you can’t run linux binaries on windows.
Judging by your error, it looks like your compiler doesn’t support the strsep function. To deal with this you will probably have to code your own, like this:
Here is the process that you will have to go through:
1- Find the file f77_diagram.c in the src directory.
2- Copy and paste the above code right after the
#includestatements.3- Return to your command shell in the main make directory.
4- Re-run
./configure5- Re-run
makeIf this doesn’t work, there are a few other things you could try.