![]() |
|
Makefiles Won't Work Correctly |
TorrentFire
Member #10,970
May 2009
|
I should note that I am a newbie at Programming. I've never compiled libraries OR used make before. I have looked into tutorials, but the only ones I find are how to create makefiles, not how make works how to set-up for using make (or NMAKE on windows systems.) So, I've been trying to install some libraries to use in Microsoft Visual Studios 2005. (Specifically FBlend and ALOGG), however I keep running into different problems, and I think it's because I don't have something set up correctly. I've tried to run make two separate ways: 1. Visual Studio 2005 Command Prompt -> NMAKE This usually throws syntax errors for the makefiles at me. I am running the correct makefiles (Usually called makefile.vc), and I run the fix batchfiles before trying to run make. Fix always works, then when I run NMAKE I get syntax errors about the makefile. 2. Ubuntu Terminal -> Make This gives me syntax errors as well. I've tried fixing the syntax errors, but I really don't think there are even errors there. I've tried compiling many libraries, and they never have correct syntax? I think it's a problem on my end. Thank you for helping in advanced, and I'm sorry; I know this topic has been hit before, but I can't seem to find anything (or haven't been looking under the correct search terms). |
OICW
Member #4,069
November 2003
![]() |
Maybe somebody could be of any help if you've posted examples of such errors, makefiles and specified version of your tools. [My website][CppReference][Pixelate][Allegators worldwide][Who's online] |
Neil Walker
Member #210
April 2000
![]() |
nmake won't work with gnu make files. I've had fblend working on visual studio so it should be ok, though I can't recall off-hand what problems I encountered. What I tend to do with projects with no ms project file (obviously assuming they aren't huge or complicated) is simply create a lib project and drop all the source files in and make them. As for unix, I have no idea, but have you ran ./configure first? Neil. wii:0356-1384-6687-2022, kart:3308-4806-6002. XBOX:chucklepie |
TorrentFire
Member #10,970
May 2009
|
Thanks for the speedy responses! OICW: Yes, I'm sorry. I don't really know what to provide exactly. I'm kind of new at this. For example: With JGMOD (The MOD audio library) I ran fixmsvc.bat, then I ran NMAKE on the file makefile.vc under jgmod\src\ This was my latest attempt. I thought that should work okay. fix gives me the following: So it didn't quite work... I don't think...? Then, running make gives me: I can try a different one if you'd like? (I'm more concerned about fblend) EDIT: Also, I forgot, the only tools I have are Microsoft Visual Studio 2005. Do I need anything else? I thought that the MSVC Command Prompt ran using the MSVC Compiler? Neil Walker: (I have been looking into makefiles for a while since I last tried working with fblend, before breaking down and coming here for support) |
OICW
Member #4,069
November 2003
![]() |
Most importantly, have you read installation instructions for those libraries? Anyway running GNU make on msvc makefile (or any other specific makefile) is going to fail. [My website][CppReference][Pixelate][Allegators worldwide][Who's online] |
TorrentFire
Member #10,970
May 2009
|
Alright, I went back through to install fblend. Here are the steps I took: 1. The instructions say that I need GCC, with make and Binutils (of specific versions - even for Windows), so I downloaded MinGW, MSYS, and all of the required updates. 2. I run fix msvc as stated in the readme. It completes without any errors. 3. Here's where I run into problems. It tells me to run 'make' and then 'make install'. I'm a little confused, so I tried a few things: - Under MSYS, I run make (because MSVC2005 Command Prompt doesn't run make). It fails, saying that: del ssetest.s The next thing I try is nmake under MSVC2005 Command Prompt... It gives me the following error: fatal error U1052: file '+= .src include' not found Am I doing this very wrong? Because I get the impression that I am... |
OICW
Member #4,069
November 2003
![]() |
Allright, first of all try using mockup code, especially the <terminal></terminal> tags - it will be much easier to read outputs from console. Judging by what you write, it looks like you're using some console in your IDE. If you've really installed gcc (mingw32 on Windows) and binutils (GNU make and others), then they should be accessible via standard command line in Windows - assuming that you've configured your $PATH. Moreso if I rememeber correctly mingw32 comes even with port of GNU make, "mingw-make" or something like that. So installing fblend or anything else - Allegro for instance is simple as this. You run cmd and type in: cd C:\Allegro fix mingw32 make make install Or under linux: cd /tmp/allegro ./configure make sudo make install
[My website][CppReference][Pixelate][Allegators worldwide][Who's online] |
bamccaig
Member #7,536
July 2006
![]() |
TorrentFire said: 'utod' is not recognized as an internal or external command, operable program or batch file. Essentially, the script is trying to run a program named `utod', but that program isn't found in your execution PATH. A good script would want to exit if something required failed, but that one seems to keep going... Windows' default shell isn't very powerful though so writing rich shell scripts is a pain. Anyway... To fix that, you will need to figure out what `utod' is and get its directory into your PATH environment variable (it's good to know what this does before allowing a script to do it, of course). TorrentFire said: - Under MSYS, I run make (because MSVC2005 Command Prompt doesn't run make). It fails, saying that: The fact that it's trying to run `del' and `move' suggests to me that it expects the Windows command prompt, whereas you seem to be running from the MSYS shell. Firstly, make sure the MinGW/MSYS bin directories are in your PATH environment variable in Windows. You can edit an environment variable permanently from...
Or, you can temporarily change an environment variable with the set command, but that only applies to the current command prompt window. Once those directories are in your PATH, you should be able to open a new[1] command prompt window and execute `gcc --help' successfully. Then you can try running `make' from there (it might be `mingw32-make', depending on installation; I've seen both). References
-- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
Audric
Member #907
January 2001
|
About your installation of MSYS and Mingw, be sure to have them installed in directories with no spaces in them. If you have something like "C:\Program files\MSYS", many makefiles will fail when they try to copy a compiled library or headers to their directories. |
TorrentFire
Member #10,970
May 2009
|
OICW: Sorry about not using <terminal>, I will from now on. I checked my MinGW/bin/ directory and it's there, but like you said it was called mingw32-make.exe I renamed it make for easier access, thanks for the note about that. I retried everything. C:\fblend>fix mingw32 Configuring FBlend for Mingw32... Done! Now run make to start the compilation. C:\fblend>make Testing for MMX assembler support... move mmx.h include process_begin: CreateProcess(NULL, move mmx.h include, ...) failed. make (e=2): The system cannot find the file specified. make: [include/mmx.h] Error 2 (ignored) del mmxtest.s Testing for SSE assembler support... move sse.h include process_begin: CreateProcess(NULL, move sse.h include, ...) failed. make (e=2): The system cannot find the file specified. make: [include/sse.h] Error 2 (ignored) del ssetest.s gcc -c src/cadd.c -o obj/mingw32/release/cadd.obj -W -Wall -O2 -ffast-math -fomi t-frame-pointer -mpentium -Iinclude `-mpentium' is deprecated. Use `-march=pentium' or `-mtune=pentium' instead. src/cadd.c:18:21: allegro.h: No such file or directory In file included from src/cadd.c:19: include/fblend.h:14:21: allegro.h: No such file or directory In file included from src/cadd.c:19: include/fblend.h:40: error: syntax error before '*' token include/fblend.h:41: error: syntax error before '*' token include/fblend.h:50: error: syntax error before '*' token include/fblend.h:51: error: syntax error before '*' token include/fblend.h:60: error: syntax error before '*' token src/cadd.c:20:17: mmx.h: No such file or directory src/cadd.c:21:17: sse.h: No such file or directory src/cadd.c:24: error: syntax error before '*' token src/cadd.c:25: error: syntax error before '*' token src/cadd.c:26: error: syntax error before '*' token src/cadd.c:70: error: syntax error before '*' token src/cadd.c: In function `fblend_add': src/cadd.c:79: error: `x' undeclared (first use in this function) src/cadd.c:79: error: (Each undeclared identifier is reported only once src/cadd.c:79: error: for each function it appears in.) src/cadd.c:79: error: `y' undeclared (first use in this function) src/cadd.c:82: error: `src' undeclared (first use in this function) src/cadd.c:96: error: `dst' undeclared (first use in this function) src/cadd.c:105: warning: implicit declaration of function `bitmap_color_depth' src/cadd.c:116: error: `fact' undeclared (first use in this function) src/cadd.c:122: warning: implicit declaration of function `acquire_bitmap' src/cadd.c:180: warning: implicit declaration of function `bmp_unwrite_line' src/cadd.c:181: warning: implicit declaration of function `release_bitmap' src/cadd.c: At top level: src/cadd.c:189: error: syntax error before '*' token src/cadd.c: In function `fblend_add_16': src/cadd.c:191: error: `fact' undeclared (first use in this function) src/cadd.c:194: error: `h' undeclared (first use in this function) src/cadd.c:202: warning: implicit declaration of function `bmp_select' src/cadd.c:202: error: `dst' undeclared (first use in this function) src/cadd.c:203: error: `src' undeclared (first use in this function) src/cadd.c:203: error: `src_y' undeclared (first use in this function) src/cadd.c:203: error: `src_x' undeclared (first use in this function) src/cadd.c:204: warning: implicit declaration of function `bmp_write_line' src/cadd.c:204: error: `dst_y' undeclared (first use in this function) src/cadd.c:204: error: `dst_x' undeclared (first use in this function) src/cadd.c:206: error: `w' undeclared (first use in this function) src/cadd.c:210: error: `MASK_COLOR_16' undeclared (first use in this function) src/cadd.c:234: warning: implicit declaration of function `bmp_write16' src/cadd.c: At top level: src/cadd.c:296: error: syntax error before '*' token src/cadd.c: In function `fblend_add_15': src/cadd.c:298: error: `fact' undeclared (first use in this function) src/cadd.c:302: error: `h' undeclared (first use in this function) src/cadd.c:310: error: `dst' undeclared (first use in this function) src/cadd.c:311: error: `src' undeclared (first use in this function) src/cadd.c:311: error: `src_y' undeclared (first use in this function) src/cadd.c:311: error: `src_x' undeclared (first use in this function) src/cadd.c:312: error: `dst_y' undeclared (first use in this function) src/cadd.c:312: error: `dst_x' undeclared (first use in this function) src/cadd.c:314: error: `w' undeclared (first use in this function) src/cadd.c:318: error: `MASK_COLOR_15' undeclared (first use in this function) src/cadd.c: At top level: src/cadd.c:404: error: syntax error before '*' token src/cadd.c: In function `fblend_add_32': src/cadd.c:406: error: `fact' undeclared (first use in this function) src/cadd.c:409: error: `h' undeclared (first use in this function) src/cadd.c:417: error: `dst' undeclared (first use in this function) src/cadd.c:418: error: `src' undeclared (first use in this function) src/cadd.c:418: error: `src_y' undeclared (first use in this function) src/cadd.c:418: error: `src_x' undeclared (first use in this function) src/cadd.c:419: error: `dst_y' undeclared (first use in this function) src/cadd.c:419: error: `dst_x' undeclared (first use in this function) src/cadd.c:421: error: `w' undeclared (first use in this function) src/cadd.c:425: error: `MASK_COLOR_32' undeclared (first use in this function) src/cadd.c:447: warning: implicit declaration of function `bmp_write32' make: *** [obj/mingw32/release/cadd.obj] Error 1 Here are the versions of GCC and make I'm running: GCC --version = 3.4.5 (mingw-vista r3) Also, one more question for you... I will be compiling the software I use under MSVC compiler, so do I still need to run "fix mingw32" or should I be running "fix msvc". I've tried both ways, after fixing to msvc, I still get some errors. In case you need them, here they are: C:\fblend>fix msvc Configuring FBlend for MSVC... Done! Now run make to start the compilation. C:\fblend>make Testing for MMX assembler support... del mmxtest.s move mmx.h include process_begin: CreateProcess(NULL, move mmx.h include, ...) failed. make (e=2): The system cannot find the file specified. make: [include/mmx.h] Error 2 (ignored) Testing for SSE assembler support... del ssetest.s move sse.h include process_begin: CreateProcess(NULL, move sse.h include, ...) failed. make (e=2): The system cannot find the file specified. make: [include/sse.h] Error 2 (ignored) cl -c src/cadd.c @_tmp.arg -ML -W3 -Ogityb2 -Gs -G4 -nologo cl : Command line warning D9035 : option 'Og' has been deprecated and will be re moved in a future release cl : Command line warning D9002 : ignoring unknown option '-ML' cl : Command line warning D9002 : ignoring unknown option '-G4' cadd.c src/cadd.c(20) : fatal error C1083: Cannot open include file: 'mmx.h': No such f ile or directory make: *** [obj/msvc/release/cadd.obj] Error 2 Thanks for the help so far, I feel like I'm getting somewhere. bamccaig: You are correct, I was running MSYS at the time. I thought I had to. But apparently I don't. I had the PATH environment variable set, but I did not know that make was called mingw32-make as you said. Thanks for the info. Audric: Yes, in the tutorial on the main MinGW website, it states that it's best to not change the install paths, so I left them as is. They installed to C:\mingw and C:\msys respectively. |
bamccaig
Member #7,536
July 2006
![]() |
TorrentFire said: You are correct, I was running MSYS at the time. I thought I had to.
Honestly, it depends on the project and how they wrote their build system. I never know exactly how I'm supposed to be running it... In Windows, I start on the command prompt. If that doesn't seem to be happy, I try from a UNIX-like shell, such as MSYS or Cygwin. Sometimes one way works and the other doesn't. Sometimes all ways work. If they don't work, I curse Windows and return to my beloved Linux. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
TorrentFire
Member #10,970
May 2009
|
Yeah, I'm thinking about working under Ubuntu. I'm just so used to the MSVC2005 setup, it's very user-friendly. Anything you can recommend to use under Ubuntu? I've heard Code::Block (or something like that) was good? |
bamccaig
Member #7,536
July 2006
![]() |
Personally, in Linux, I just work on the command line. In any case, there are a few IDEs available. Eclipse is well liked by many, but I'm not really a fan (after using Visual Studio so regularly it just feels clunky to me). Code::Blocks is available as well and you can probably configure NetBeans for C/C++ (I've never done it, but I've heard it can be done...). -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
OICW
Member #4,069
November 2003
![]() |
TorrentFire: judging by your errors it looks like you're missing allegro installation. Read install instructions supplied for FBlend and install prerequisities first. Anyway this is why I don't like Windows, installing anything from the sources is pain in the arse. As for Linux development if you insist on using IDE I reccomend Code::Blocks. For smaller things Vim + gcc is all you need, though I prefer Kate - I still think that I can get things done faster than thinking half an hour about regular expression that would solve it. But I agree that once you get Vim in your hands you rule. [My website][CppReference][Pixelate][Allegators worldwide][Who's online] |
TorrentFire
Member #10,970
May 2009
|
Well, I appreciate all of the help. I'll look into Vim and Kate and probably move all my source to my Ubuntu partition, maybe I'll actually get stuff done. I've just recently started playing around with Linux so hopefully everything goes smoothly. :p Thanks again for all the help everyone! |
Evert
Member #794
November 2000
![]() |
TorrentFire said: I'll look into Vim and Kate and probably move all my source to my Ubuntu partition, maybe I'll actually get stuff done. I've just recently started playing around with Linux so hopefully everything goes smoothly. Beware vim's very steep learning curve. It's different from anything you've used before and if you decide that you want to use it, it will take you time to get used to it. It is not newbie friendly. Just a word of caution. |
Thomas Fjellstrom
Member #476
June 2000
![]() |
Kate and Nano are my favorite editors. -- |
BAF
Member #2,981
December 2002
![]() |
If you like MSVC, just use it. I'm sure you can find binaries for the libraries you install instead of wasting your life trying to compile the crap. |
|