compilation

How do you include files in C++ from the /Library/Framework folder in MAC

℡╲_俬逩灬. 提交于 2019-12-17 23:43:11
问题 I am trying to use SDL. I have a folder in /Library/Frameworks called SDL2.framework . I want to include the file SDL.h in my project. How do I do this? My code looks like: // Example program: // Using SDL2 to create an application window #include <SDL.h> #include <stdio.h> int main(int argc, char* argv[]) { SDL_Window *window; // Declare a pointer SDL_Init(SDL_INIT_VIDEO); // Initialize SDL2 // Create an application window with the following settings: window = SDL_CreateWindow( "An SDL2

C compile : collect2: error: ld returned 1 exit status

荒凉一梦 提交于 2019-12-17 23:23:49
问题 I tried to search for that bug online but all the posts are for C++. This is the message: test1.o: In function ReadDictionary': /home/johnny/Desktop/haggai/test1.c:13: undefined reference to CreateDictionary' collect2: error: ld returned 1 exit status make: *** [test1] Error 1 super simple code and can't understand what's the problem #include <stdio.h> #include <stdlib.h> #include <string.h> #include "dict.h" #include "hash.h" pHash ReadDictionary() { /* This function reads a dictionary line

“Expected a type” error pointing to the return type of a method

≯℡__Kan透↙ 提交于 2019-12-17 23:05:35
问题 I've attempted to compile, but every time I do, one method throws a strange "expected a type" error. I have a method in the header: -(ANObject *)generateSomethingForSomethingElse:(NSString *)somethingElse; The error points at the return type for this method. I've imported ANObject into the header using #import "ANObject.h" and ANObject is compiling fine.. Why is this happening? 回答1: This is to do with the order that the source files are compiled in. You are already probably aware that you can

What does an object file contain?

时间秒杀一切 提交于 2019-12-17 22:33:36
问题 During the various stages of compilation in C or C++, I know that an object file gets generated (i.e., any_name.o file). What does this .o file contain? I can't open it since it's a binary file. Could anybody please help me? Are the contents of the object file mainly dependent on the compiler which we use on Unix? 回答1: Object files can contain a bunch of stuff: Basically it's some or all of the list below: Symbol Names Compiled code Constant data, eg. strings Imports - which symbols the

Java Compile Error: class Appletprac is public, should be declared in a file named Appletprac.java

别说谁变了你拦得住时间么 提交于 2019-12-17 22:28:16
问题 When I am compiling the java program I am getting this error: class Appletprac is public, should be declared in a file named Appletprac.java Here is my java code: import java.applet.*; import java.awt.*; // Graphics Class import javax.swing.*; import java.awt.event.*; /*<applet code="Appletprac.class" width="500" height="500"> </applet>*/ public class Appletprac extends JApplet implements ActionListener { JButton OK; JRadioButton Font_Style1,Font_Style2,Font_Style3; ButtonGroup bg; JCheckBox

Solve PermGen errors when building in IntelliJ with Maven?

戏子无情 提交于 2019-12-17 22:22:27
问题 If I get PermGen OutOfMemoryError from the app server when building my project in IntelliJ with Maven, is it the heap that Maven uses that I should increase? I use Win7, 8GB RAM and I get PermGen from the appserver when I rebuild the project with maven. 回答1: add vm opt to mvn -XX:MaxPermSize=128M 来源: https://stackoverflow.com/questions/19750340/solve-permgen-errors-when-building-in-intellij-with-maven

How to compile a single Java file

亡梦爱人 提交于 2019-12-17 22:10:02
问题 I have searched this, but I could'n find or understand what I found. Now I'm not a Java programmer, but I have the need to compile a single Java file into an existing (compiled) Java program. The source of this Java code is not available to me, therefore I cannot compile the entire project. I'm not interested in decompiling the original project. How to quickly do this using only the JDK and javac? (Through the command line is what I prefer.) I understand that to do so error checking outside

How to override compile command of Visual Studio 2017 Community [duplicate]

元气小坏坏 提交于 2019-12-17 21:34:28
问题 This question already has answers here : How to use Clang compiler with MSBuild? (2 answers) Closed 2 years ago . I would like to override the default Visual Studio C++ compiler with a simple shell script. What I want is to capture the arguments, such as file name, and create some statistics. However I want to override the compilation process completely - that is, I want to call the original compilation from my shell script. I googled but all I found was how to have pre-build and post-build

FFmpeg: building example C codes

不打扰是莪最后的温柔 提交于 2019-12-17 21:34:26
问题 I have configured and compiled the FFmpeg library using this link: https://trac.ffmpeg.org/wiki/CompilationGuide/Ubuntu Now, I am trying to build example C codes provided by FFmpeg from here: https://github.com/FFmpeg/FFmpeg/tree/master/doc/examples However, when I run make install-examples or make install (suggested by /example/README), I receive this kind of message: make: *** No rule to make target '/doc/examples/README', needed by 'install-examples'. Stop. I thought this may be due to the

Target different version of JRE

依然范特西╮ 提交于 2019-12-17 21:29:04
问题 I'm testing Java on a Windows Surface Pro. The Surface Pro has Java 7 Update 55, but does not have the JDK installed. I compiled a program on my MacBook from the command line using javac . The MacBook Has Java 8 Update 5 and it includes the JDK (obviously because I compiled on the MBP). When I move the program from the MackBook to the Surface Pro, I get the following error. Here, "moving the program" means copying the two *.class files to the new machine and trying to execute the byte codes.